User forums > Help

Linker settings in CodeBlock and MinGW 4.3.0

(1/1)

pcdinh:
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:
--- End code ---
 

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]

stahta01:
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

roland:
Try http://forums.codeblocks.org/index.php/topic,5937.msg49178.html#msg49178. In fact, read the whole thread. Worked for me.

stahta01:
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.

Navigation

[0] Message Index

Go to full version