Author Topic: Linker settings in CodeBlock and MinGW 4.3.0  (Read 4452 times)

pcdinh

  • Guest
Linker settings in CodeBlock and MinGW 4.3.0
« 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]

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7591
    • My Best Post
Re: Linker settings in CodeBlock and MinGW 4.3.0
« Reply #1 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
« Last Edit: August 05, 2007, 05:31:31 pm by stahta01 »
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

roland

  • Guest
Re: Linker settings in CodeBlock and MinGW 4.3.0
« Reply #2 on: August 05, 2007, 05:45:19 pm »
Try http://forums.codeblocks.org/index.php/topic,5937.msg49178.html#msg49178. In fact, read the whole thread. Worked for me.

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7591
    • My Best Post
Re: Linker settings in CodeBlock and MinGW 4.3.0
« Reply #3 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.
« Last Edit: August 05, 2007, 05:55:36 pm by stahta01 »
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org