Well the problem was that there's a duplicate symbol/definition of the name beginWinCoords where a particular static library had 2 definitions and this is disallowed by the standards. So the resolution was to remove the directories under /Developer/CUDA and reinstall the CUDA 2.1 SDK entirely.
In detail, here's what happened.
When i first installed CUDA 2.1 ontop of CUDA 2.0 and next attempt to rebuild the sample projects, in particular Nbody i hit into the following problem:
ray:nbody ray$ make
ld: duplicate symbol beginWinCoords() in ../../lib/libparamgl.a(paramgl.cpp.o) and ../../lib/libparamgl.a(paramgl.cpp_o)
collect2: ld returned 1 exit status
make: *** [../../bin/darwin/release/nbody] Error 1
What's happened is that there are two definitions of the same function i.e. beginWinCoords() in the static archived file libparamgl.a (.a is the file extension for static archive libraries instead of .dylib, .so, .dll)
Next thing i did was to compare the contents of the two static libraries and found that the 2.1 version had 1 definition (great) while the 2.0 version had two definitions. See below for the comparison (If you are unfamiliar with nm, consult your man page for your platform)
The latter output indicated the two object files within libparamgl.a that caused the duplicate symbol/ definition issue. Okie Dokie, have fun!
ray:Developer ray$ nm CUDA/lib/libparamgl.a | grep beginWinCoords
000016b0 s __GLOBAL__I__Z14beginWinCoordsv
00000000 a __GLOBAL__I__Z14beginWinCoordsv.eh
00000000 T __Z14beginWinCoordsv
000019c4 S __Z14beginWinCoordsv.eh
ray:Developer ray$ nm CUDA2.0/lib/libparamgl.a | grep beginWinCoords
000017e0 s __GLOBAL__I__Z14beginWinCoordsv
00000000 a __GLOBAL__I__Z14beginWinCoordsv.eh
00000000 T __Z14beginWinCoordsv
00001af8 S __Z14beginWinCoordsv.eh
000017e0 s __GLOBAL__I__Z14beginWinCoordsv
00000000 a __GLOBAL__I__Z14beginWinCoordsv.eh
00000000 T __Z14beginWinCoordsv
00001af8 S __Z14beginWinCoordsv.eh
000017e0 s __GLOBAL__I__Z14beginWinCoordsv
00000000 a __GLOBAL__I__Z14beginWinCoordsv.eh
00000000 T __Z14beginWinCoordsv
00001af8 S __Z14beginWinCoordsv.eh
000016b0 s __GLOBAL__I__Z14beginWinCoordsv
00000000 a __GLOBAL__I__Z14beginWinCoordsv.eh
00000000 T __Z14beginWinCoordsv
000019c4 S __Z14beginWinCoordsv.eh
000016b0 s __GLOBAL__I__Z14beginWinCoordsv
00000000 a __GLOBAL__I__Z14beginWinCoordsv.eh
00000000 T __Z14beginWinCoordsv
000019c4 S __Z14beginWinCoordsv.eh
000016b0 s __GLOBAL__I__Z14beginWinCoordsv
00000000 a __GLOBAL__I__Z14beginWinCoordsv.eh
00000000 T __Z14beginWinCoordsv
000019c4 S __Z14beginWinCoordsv.eh
ray:Developer ray$
2 comments:
Hi Raymond,
I am getting the following error after installing Toolkit 1.1, 2.0 and SDK 2.02.0807.1535:
make -C projects/nbody/
ld: duplicate symbol beginWinCoords() in ../../lib/libparamgl.a(paramgl.cpp_o) and ../../lib/libparamgl.a(paramgl.cpp.o)
collect2: ld returned 1 exit status
make[1]: *** [../../bin/darwin/release/nbody] Error 1
make: *** [projects/nbody/Makefile.ph_build] Error 2
I am unfamiliar with 'nm'. Please explain how I can get rid of this error.
Thanks in advance,
Rohan
Hi,
using 'nm' is just to validate that a duplicate def. exists in the library. so from what i see from your sample, looks like u're having the exact same problem as mine here? so i would suggest that u remove the directories under /Developer/CUDA and re-install the SDK.
let me know if that doesn't work for u
Post a Comment