Re: undefined reference to 'NewDouble'
- Posted by ghaberek (admin) Apr 21, 2013
- 1805 views
jimcbrown said...
I did find this, but since we aren't using -l here I'm not sure if it's relevant.
http://www.mingw.org/wiki/Specify_the_libraries_for_the_linker_to_use said...
Finally, please do not fall into the all-too-common trap of placing any "-l <name>" specification before the name of any source or object module which requires it. Where the source file bar.c has dependencies on the library archive libfoo.a, the command:
$ gcc -lfoo bar.c
is incorrect, and will surely lead to "undefined reference" errors. The correct form for this command is:
$ gcc bar.c -lfoo
Yeah, I'm also two-stepping the process and that seems to imply compiling and linking in one step.
-Greg