Forums
You are not logged in.
#1 2012-03-25 00:35:24
- chrisKilshaw
- New member
- Registered: 2012-03-25
- Posts: 7
Eclipse "undefined reference" problems while compiling.
Hi All
I am having some trouble configuing Eclipse with Cygwin. Essentially it seems to be having dificulty resolving the 3Delight.lib, and making the references during the build process.
This is the error message I get.
Invoking: Cygwin C Linker
gcc -L"C:\Program Files\3Delight\lib" -o "renderman" ./squareEg.o -l3Delight
./squareEg.o: In function `main':
/cygdrive/z/TOOLS/MAYA/renderman/Default/../squareEg.c:13: undefined reference to `_RiBegin'
/cygdrive/z/TOOLS/MAYA/renderman/Default/../squareEg.c:14: undefined reference to `_RiWorldBegin'
/cygdrive/z/TOOLS/MAYA/renderman/Default/../squareEg.c:15: undefined reference to `_RiSurface'
/cygdrive/z/TOOLS/MAYA/renderman/Default/../squareEg.c:16: undefined reference to `_RI_P'
makefile:29: recipe for target `renderman' failed
/cygdrive/z/TOOLS/MAYA/renderman/Default/../squareEg.c:16: undefined reference to `_RiPolygon'
/cygdrive/z/TOOLS/MAYA/renderman/Default/../squareEg.c:18: undefined reference to `_RiWorldEnd'
/cygdrive/z/TOOLS/MAYA/renderman/Default/../squareEg.c:19: undefined reference to `_RiEnd'
collect2: ld returned 1 exit status
make: *** [renderman] Error 1
I have included the lib path and the includes path in the Cygwin settings, but am a bit stuck now. Could anyone shed some light on the problem.
Cheers
Offline
#2 2012-03-25 10:39:09
- olivier
- 3Delight Developer
- Registered: 2007-01-09
- Posts: 1930
Re: Eclipse "undefined reference" problems while compiling.
I think you have an ABI compatibility issue. The cygwin compiler expects a _ to be prepended to symbol names but the symbols in 3Delight.lib don't have that as they are meant to be compatible with the microsoft and intel compilers.
I'm not familiar with the cygwin compiler enough to know how to make it expect the correct symbol here. You should find something in its documentation (look for information about linking with libraries compiled with the microsoft compiler) or on a cygwin related forum as I'm certain this has come up thousands of times before.
Offline
#3 2012-03-25 16:12:06
- chrisKilshaw
- New member
- Registered: 2012-03-25
- Posts: 7
Re: Eclipse "undefined reference" problems while compiling.
thanks Olivier, I'll check that out.
Offline
#4 2012-03-25 19:38:32
- chrisKilshaw
- New member
- Registered: 2012-03-25
- Posts: 7
Re: Eclipse "undefined reference" problems while compiling.
I found this in the docs in the Linking Against DLLs section of the docs http://cygwin.com/cygwin-ug-net/dll.html
...If you do not have the source or a supplied working import library, you can get most of the way by creating a .def file with these commands (you might need to do this in bash for the quoting to work correctly)
and a linux example on converting the lib, but nought for windows.
I think it'll be easier to look into a different compiler.
Offline
#5 2012-03-26 06:28:05
- olivier
- 3Delight Developer
- Registered: 2007-01-09
- Posts: 1930
Re: Eclipse "undefined reference" problems while compiling.
I'm fairly sure that example is for windows. It should work fine with 3Delight.dll.
Of course, since you can get the microsoft compiler for free, it's probably a better long-term solution for compatibility with other libs.
Offline
#6 2012-03-28 04:27:17
Re: Eclipse "undefined reference" problems while compiling.
Hey Chris,
it looks you came a long way since we worked in HB2. :)
But why are you developing on Windows??? Are you into self torture? ;)
.mm
Render faster, get to the party earlier — /*jupiter jazz*/
Offline
#7 2012-04-03 03:26:35
- chrisKilshaw
- New member
- Registered: 2012-03-25
- Posts: 7
Re: Eclipse "undefined reference" problems while compiling.
Hi Moritz
Yep been around the world a bit. Trying to get myself back up to speed with renderman after a couple of years of not playing with it.
Self torture? surely you remember that masochistic tendancy.
Unfortunatly I'm stuck in windoze at the moment.
Hope all is well
Offline
#8 2012-04-03 03:30:38
- chrisKilshaw
- New member
- Registered: 2012-03-25
- Posts: 7
Re: Eclipse "undefined reference" problems while compiling.
Sooo... I've installed Visual Express, and using the cl command from the docs
cl /I"%DELIGHT%\include" "%DELIGHT%\lib\3delight.lib" main.cpp
I get this error...
main.cpp
Microsoft (R) Incremental Linker Version 10.00.30319.01
Copyright (C) Microsoft Corporation. All rights reserved.
/out:main.exe
"C:\Program Files\3Delight\\lib\3delight.lib"
main.obj
main.obj : error LNK2019: unresolved external symbol __imp__RiEnd referenced in
function _main
main.obj : error LNK2019: unresolved external symbol __imp__RiWorldEnd referenced in function _main
main.obj : error LNK2019: unresolved external symbol __imp__RiPolygon referenced in function _main
main.obj : error LNK2019: unresolved external symbol __imp__RI_P referenced in function _main
main.obj : error LNK2019: unresolved external symbol __imp__RiSurface referenced in function _main
main.obj : error LNK2019: unresolved external symbol __imp__RiWorldBegin referenced in function _main
main.obj : error LNK2019: unresolved external symbol __imp__RiBegin referenced in function _main
main.exe : fatal error LNK1120: 7 unresolved externals
seems no different from the errors I was getting using cywin, which is a POSIX complier.
Something more fundamental must be up
Offline
#9 2012-04-11 19:25:49
- olivier
- 3Delight Developer
- Registered: 2007-01-09
- Posts: 1930
Re: Eclipse "undefined reference" problems while compiling.
I'm not sure but perhaps you're using a 32-bit compiler with a 64-bit 3Delight lib?
Offline
#10 2012-04-13 21:23:09
- chrisKilshaw
- New member
- Registered: 2012-03-25
- Posts: 7
Re: Eclipse "undefined reference" problems while compiling.
Managed to sort it out. Uninstalled 3Delight and Visual Studio Express and the Microsoft SDK, and reinstalled 3Delight and Microsoft SDK and it works now. Avg is now broken, but that is probably just a reinstall.
Thanks for your time Olivier
Offline

