Re: undefined reference to 'NewDouble'
- Posted by jimcbrown (admin) Apr 21, 2013
- 1851 views
ghaberek said...
So I have been testing some methods for rebuilding wxEuphoria. Trying to link the Euphoria library (eu.a) into my DLL, the linker cannot find a reference to NewDouble.
I've distilled my problem down to this simple code. What am I doing wrong?
test.c said...
#include <stdint.h> #include "euphoria.h" object box_int( intptr_t x ) { if(x > NOVALUE && x < MAXINT) return (object)x; else return (object)NewDouble((double)x); }
$ gcc -c test.c -o test.o -IC:\Euphoria\include $ gcc -shared -o test.dll C:\Euphoria\bin\eu.a test.o test.o:test.c:(.text+0x24): undefined reference to `NewDouble' collect2.exe: error: ld returned 1 exit status make: *** [test.dll] Error 1
-Greg
I'm not sure what's going on. NewDouble is defined be_alloc.c, but eu.a should have been built with that object file (be_alloc.o), which should have been enough to resolve the reference.