Code::Blocks Forums

User forums => Help => Topic started by: pcdinh on August 05, 2007, 10:31:19 am

Title: Linker settings in CodeBlock and MinGW 4.3.0
Post by: pcdinh on August 05, 2007, 10:31:19 am
Hi all,

I just setup CodeBlock (nightly build) with MinGW 4.3.0 (20-40) but when I tried to test it with a simple function:

#include <windows.h>

int WinMain(HINSTANCE,HINSTANCE,LPSTR,int)
{
  MessageBox(0,"Hello, Windows","MinGW Test Program",MB_OK);
  return 0;
}

It said:

ld: crtbegin.o: No such file: No such file or directory

Here is the build log:

Code
mingw32-g++.exe  -IC:\MinGW -IC:\MinGW\lib -IC:\MinGW\include -IC:\MinGW\bin -IC:\MinGW\libexec -IC:\MinGW\libexec\gcc\mingw32\4.3.0 -IC:\MinGW\lib\gcc\mingw32\4.3.0 -IC:\MinGW\include\c++\4.3.0\backward -IC:\MinGW\include\c++\4.3.0\bits -IC:\MinGW\include\c++\4.3.0\debug -IC:\MinGW\include\c++\4.3.0\ext -IC:\MinGW\lib\gcc\mingw32\4.3.0\include -IC:\MinGW\include\c++\4.3.0\mingw32\bits -ID:\CProjects\Test -c D:\CProjects\Test\hellowin.cpp -o D:\CProjects\Test\hellowin.o
mingw32-g++.exe -LC:\MinGW\lib -LC:\MinGW\lib\gcc\mingw32\4.3.0 -LC:\MinGW\include  -o D:\CProjects\Test\hellowin.exe D:\CProjects\Test\hellowin.o
ld: crtbegin.o: No such file: No such file or directory
Process terminated with status 1 (0 minutes, 1 seconds)
0 errors, 0 warnings
Build log saved as:
 

There are files that have been generated hellowin.o and hellowin.exe but hellowin.exe can not run. Could you kindly explain why crtbegin.o can not be found while it is located in the include path C:\MinGW\lib\gcc\mingw32\4.3.0 ?

Thanks

[attachment deleted by admin]
Title: Re: Linker settings in CodeBlock and MinGW 4.3.0
Post by: stahta01 on August 05, 2007, 05:24:34 pm
If you are using Vista then it is Vista fault. Please search on Vista to find problem.

If not using vista, please verify that you installed MinGW 4.3.0 right.

Also, in the future please do not post "MinGW 4.3.0" threads in "Help" on Code::Blocks installation/troubleshooting issues forum. Because it is a compiler issue, the "Using Code::Blocks" on "General questions regarding the usage of Code::Blocks (all platforms)" http://forums.codeblocks.org/index.php/board,3.0.html or "General" (Since this is where 20-40 posted about MinGW 4.3.0) http://forums.codeblocks.org/index.php/board,5.0.html would be better.

Tim S
Title: Re: Linker settings in CodeBlock and MinGW 4.3.0
Post by: roland on August 05, 2007, 05:45:19 pm
Try http://forums.codeblocks.org/index.php/topic,5937.msg49178.html#msg49178 (http://forums.codeblocks.org/index.php/topic,5937.msg49178.html#msg49178). In fact, read the whole thread. Worked for me.
Title: Re: Linker settings in CodeBlock and MinGW 4.3.0
Post by: stahta01 on August 05, 2007, 05:53:33 pm
Opps, overlooked know bug. You are trying to use minGW GCC on C: Drive with project on D: Drive this is a known issue for some/all users. Please try project and MinGW on same drive.

Tim S

Note: If you move minGW to D:\minGW make sure that C:\minGW does not exist; you can just rename to a new name you don't need to delete it.