> On Oct 20, 2014, at 4:16 PM, Jeremy Darling <[email protected]> wrote: > > Ok, stuck again. Got everything working with the integer and pointer thing > from all the help before (thanks!) but now I'm stuck in another place. The > source files I have are .C files with .H headers. I can compile them using > node-gyp with no issues and apparently bind them to my .CC file with no issue. > > When I try and actually USE them though I get back an error saying undefined > symbol: <somevalue> where <somevalue> is always _Z11<methodName>v the _Z11 > and v never changes. The <methodName> part is always the name of the method > from the .C file. > > I'm guessing this is something really simple, but I don't know enough about > C/CC/whatever to know where I'm screwing up. > > Here is a simple example, while this isn't the real code it blows up just > like the real code :) > > /* lib.c */ > #include lib.h > int test_linked(void){ > return 1; > } > > /* lib.h */ > #ifndef _LIB_ > #define _LIB_ > int rest_linked(void);
This, here, is being included from both C and C++ -- it will need to add an extern "C" to generate the right symbol from C++ -- in C++, it's _Z11rest_linked; in C, it's _rest_linked. If you declare extern "C" on it, it'll always use the C convention. Aria -- Job board: http://jobs.nodejs.org/ New group rules: https://gist.github.com/othiym23/9886289#file-moderation-policy-md Old group rules: https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines --- You received this message because you are subscribed to the Google Groups "nodejs" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/nodejs/ECCC2A05-138E-4BEE-A282-C4FCB1691D3C%40nbtsc.org. For more options, visit https://groups.google.com/d/optout.
