User forums > Help
CRT2.O problem
net:
hi guys
im a c++ programmer, recently i ve installed windows vista then
codeblocks and i can't link even a hello world program!
on windows xp i ve compiled this succesfully but on vista it gives me the crt2.o error
ld says:
-------------- Build: Release in test ---------------
mingw32-gcc.exe -Wall -fexceptions -O2 -IC:\CB\include -IC:\CB\lib\gcc\mingw32\3.4.5\include -IC:\CB\include -c C:\CB\TEST\test\main.c -o C:\CB\TEST\test\.objs\main.o
mingw32-g++.exe -LC:\CB\lib -LC:\CB\lib -o test.exe C:\CB\TEST\test\.objs\main.o -s
ld: crt2.o: No such file: No such file or directory
Process terminated with status 1 (0 minutes, 0 seconds)
0 errors, 0 warnings
i ve searched all over the internet about this bug but i cant find the solution to this problem
anyone knows how to link this?
thanks in advance
net:
the crt2.o is installed and i am linking to it
its very strange this
the program was:
#include <stdio.h>
#include <stdlib.h>
int main()
{
printf("Hello world!\n");
return 0;
}
TDragon:
If I recall correctly, you need to add a Windows environment variable named "GCC_EXEC_DIR" "GCC_EXEC_PREFIX" which points to the "lib" subdirectory (which contains crt2.o).
net:
i ve done that but it doesnt work
the crt2.o is still missing
net:
i ve copied the crt2.o and the crtbegin.o to the base project folder AND IT WORKED UNDER WINDOWS VISTA
but nows ld give me this error
-------------- Build: Release in test ---------------
mingw32-gcc.exe -Wall -fexceptions -O2 -IC:\CB\include -IC:\CB\lib\gcc\mingw32\3.4.5\include -IC:\CB\include -c C:\CB\TEST\test\main.c -o C:\CB\TEST\test\.objs\main.o
mingw32-g++.exe -LC:\CB\lib -LC:\CB\lib -o test.exe C:\CB\TEST\test\.objs\main.o -s -v
Using built-in specs.
Configured with: ../gcc-3.4.5/configure --with-gcc --with-gnu-ld --with-gnu-as --host=mingw32 --target=mingw32 --prefix=/mingw --enable-threads --disable-nls --enable-languages=c,c++,f77,ada,objc,java --disable-win32-registry --disable-shared --enable-sjlj-exceptions --enable-libgcj --disable-java-awt --without-x --enable-java-gc=boehm --disable-libgcj-debug --enable-interpreter --enable-hash-synchronization --enable-libstdcxx-debug
Thread model: win32
gcc version 3.4.5 (mingw special)
ld -Bdynamic -o test.exe -s crt2.o crtbegin.o -LC:\CB\lib -LC:\CB\lib C:\CB\TEST\test\.objs\main.o -lstdc++ -lmingw32 -lgcc -lmoldname -lmingwex -lmsvcrt -luser32 -lkernel32 -ladvapi32 -lshell32 -lmingw32 -lgcc -lmoldname -lmingwex -lmsvcrt crtend.o
ld: cannot find -lgcc
Process terminated with status 1 (0 minutes, 0 seconds)
1 errors, 0 warnings
the crt2.o and crtbegin.o is a bug in mingw
Navigation
[0] Message Index
[#] Next page
Go to full version