Page 1 of 1

cannot find -lg when linking hello_world.elf

Posted: Tue Jan 11, 2011 2:20 am
by r4b00f3r
I've just installed devkitARM using the "Alternative installation script" at http://devkitpro.org/wiki/Getting_Started/devkitARM. I'm running OS X 10.6.6. I tried make-ing examples/nds/hello_world, but I get an error during linking (hello_world.elf): cannot find -lg. Here's the full output:

Code: Select all

main.cpp
arm-eabi-g++ -MMD -MP -MF /opt/devkitpro/examples/nds/hello_world/build/main.d -g -Wall -O2 -march=armv5te -mtune=arm946e-s -fomit-frame-pointer -ffast-math -mthumb -mthumb-interwork -I/opt/devkitpro/examples/nds/hello_world/include -I/opt/devkitpro/examples/nds/hello_world/build -I/opt/devkitpro/libnds/include -I/opt/devkitpro/libnds/include -I/opt/devkitpro/examples/nds/hello_world/build -DARM9 -fno-rtti -fno-exceptions -c /opt/devkitpro/examples/nds/hello_world/source/main.cpp -o main.o 
linking hello_world.elf
/opt/devkitpro/devkitARM/lib/gcc/arm-eabi/4.5.1/../../../../arm-eabi/bin/ld: cannot find -lg
collect2: ld returned 1 exit status
make[1]: *** [/opt/devkitpro/examples/nds/hello_world/hello_world.elf] Error 1
make: *** [build] Error 2
What do I need to do in order to build and link successfully? Thanks for the help.

Re: cannot find -lg when linking hello_world.elf

Posted: Tue Jan 11, 2011 10:12 am
by WinterMute
We managed to solve this on IRC after some checking of environment variables and files. It turned out to be a problem caused by extraction with "The Unarchiver" - a replacement for "Archive Utility.app", the built-in archive unpacker program on Mac OS X. Somehow it managed to create some files as symbolic links to non existent files.

Re: cannot find -lg when linking hello_world.elf

Posted: Thu Jan 13, 2011 3:13 am
by r4b00f3r
Thanks for updating this thread, WinterMute.

To clarify, I removed the entire devkitpro directory and started over. I used tar instead of The Unarchiver and all symlinks were either gone or correctly linked.