News:

Accounts with zero posts and zero activity during the last months will be deleted periodically to fight SPAM!

Main Menu

Linker settings in CodeBlock and MinGW 4.3.0

Started by pcdinh, August 05, 2007, 10:31:19 AM

Previous topic - Next topic

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:

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]

stahta01

#1
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.next.codeblocks.org/index.php/board,3.0.html or "General" (Since this is where 20-40 posted about MinGW 4.3.0) http://forums.next.codeblocks.org/index.php/board,5.0.html would be better.

Tim S
C Programmer working to learn more about C++.
On Windows 10 64 bit and Windows 11 64 bit.
--
When in doubt, read the CB WiKi FAQ. [url="http://wiki.codeblocks.org"]http://wiki.codeblocks.org[/url]


stahta01

#3
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.
C Programmer working to learn more about C++.
On Windows 10 64 bit and Windows 11 64 bit.
--
When in doubt, read the CB WiKi FAQ. [url="http://wiki.codeblocks.org"]http://wiki.codeblocks.org[/url]