This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: keep getting "undefined reference to" linker error


"H.S." wrote:

> So, any advice how I can get this working with a C++ program? This was

Yes, edit taucs.h so that it has an 'extern "C"' block surrounding the
function declarations but not for the entire file (i.e. just for the
body of the file, not around headers that it includes.)

> If there is way to create a
> routine which does this in C and then link to it with my C++ program,
> that would be great too, but I guess I will still need to solve the
> problem of including taucs.h somehow.

Well that is also a solution but it essentially just moves the problem
out of the taucs.h header and into a header of your own.  No matter how
you slice it, at the junction between C++ code calling a C function you
need 'extern "C"' on the declaration.

Brian


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]