Chris Masters <[EMAIL PROTECTED]> writes: >UPDATE - It's not a perl issue. > >> > >1 - I know the static (.a) C++ library works >> > because I >> > >can compile and run programs that use it. >> > >> > Any chance .a file was _in_ that directory. >> > >> >> It was. I'll check if this works otherwise. >> > >If I move the test cpp to /tmp and try and compile, it >fails. The header file is located in /usr/include. > >It succeeds if I move the header file into /tmp. > >So this isn't a perl-XS issue!! > >However, why would linking fail if the header is in >/usr/include??
Linking has (nearly) nothing to do with the headers. Only header effect is whether names of functions are C style i.e. 'FunctionName' is just that, or C++ style where it has other characters added to encode numner and types of arguments. It is vital that the program loading the library declares the function the way it _is_ in the .so Thus if library is a C API then it MUST be declared as extern "C" to use from C++, but if it is C++ then it must NOT. > > > > > >__________________________________ >Do you Yahoo!? >Yahoo! Hotjobs: Enter the "Signing Bonus" Sweepstakes >http://hotjobs.sweepstakes.yahoo.com/signingbonus