Problems with function/header file, Undefined symbol

T

Travis Stewart

Hi,
I've been working on some software to control an older GPIB
card for the past couple of weeks. I have function prototypes in a
header file pc-mate2.h and the functions are defined in pc-mate2.c. I
am using the Borland Turbo C 2.01 compiler (it is the compiler that
the person I am writing this for uses) and when I compile the program
I am writing I get an error:

Turbo Link Version 2.0 Copyright (c) 1987, 1988 Borland
International
Undefined symbol '_readByte' in module enter2.c

a very similar error occurs if I try to compile with gcc. These
errors are strange as last year when they were first written these
problems did not occur.

I've made sure the header file is in my include directory, and that
the proper #include statements in pc-mate2.c where readByte is
defined, as well as the program I am writing that utilizes (at this
time I have other functions that are in pc-mate2.c commented out as
they cause the same error). I was wondering if anyone might have an
idea why this is happening.

Thanks for any help,
Travis
(e-mail address removed)
 
M

Malcolm

Travis Stewart said:
Turbo Link Version 2.0 Copyright (c) 1987, 1988 Borland
International
Undefined symbol '_readByte' in module enter2.c
The linker, not the compiler, is producing this error. What it means is that
it can't find the function body for _readByte(). If the function is a
library function you need to tell the linker to link the library, if you
wrote it you need to include the object file in which it resides.

I have occasionally been trapped by the leading underscore nonsense.
Sometimes adding the underscore to the function when it is called will allow
it to link properly, even though it is documented without the underscore.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,013
Latest member
KatriceSwa

Latest Threads

Top