I am trying to compile a simple "hello world" program using a complete and stable GCC 4.4.0. Every thing is OK when I try to compile a dynamic executable but when I try to compile the static executable one, I get error "undefined reference to printf". It's the same in every program I try to compile in static mode. It can not recognize libc functions. Even with "-nostdlib
" or "-lc
" it's the same! Also "-L ${LD_LIBRARY_PATH}
" does not fix it.
./ccL10382.o: In function `main':
test.c:(.text+0x4): undefined reference to `printf'
collect2: ld returned 1 exit status
What should I do?