Re: keep getting "undefined reference to" linker error

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



"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 of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux