Mail Archives: djgpp/1999/06/11/19:17:24
Joey Lloyd wrote:
>
> Below is a copy of an assembly and a C file that i am
> trying to combine. I am using NASM to assemble the
> .ASM file and GCC to compile/make/link these files.
> When I run GCC i get the following error message:
>
> undefined reference to 'getvmode(void)'
>
> What am I doing wrong?
>
>
> --------------------- Filename: gvm.asm -------------------
> ------- Assembled using: nasm gvm.asm -fcoff -ogvm.o ------
>
> global _getvmode
>
> section .text
>
> _getvmode: mov ah,0x0f ;get video mode
> int 0x10 ;call BIOS
> ret ;Current video mode in AL
>
> ----------------------------------------------------------
>
>
> --------------------- Filename: j.cc ---------------------
> ------- Compiled using: gcc j.cc gvm.o -o j.exe ----------
>
>
> #include <stdio.h>
>
> extern int getvmode();
Try `extern "C" int getvmode();'
C++ normally uses name mangling; this will stop it.
And please don't post in HTML.
> int main()
> {
> int i;
>
> i=getvmode();
>
> printf("Video Mode: %d\n",i);
> }
>
>
> ----------------------------------------------------------
>
> Thanks.
>
> Joey Lloyd
> jolloyd AT bellsouth DOT net
>
>
--
Nate Eldredge
nate AT cartsys DOT com
- Raw text -