User forums > Help

Can't build in Code::Blocks, but can build from command line.

(1/2) > >>

rich_sposato:
I get this error message when I try to build a C++ project on Code::Blocks.

Execution of 'g++-4.exe  -W -g  -Weffc++   -I. -I./include -c E:/Projects/BlueSpot/src/BlueSpot.cpp -o obj/Debug/src/BlueSpot.o'  in 'E:\Projects\BlueSpot' failed.

Code::Blocks version 10.5
Operating System: Windows XP

When I try the identical command line on cygwin, the file compiles without error.  There are no unusual characters or spaces in the paths or filenames.

If I try the same command from a DOS prompt, I get this error message: "/usr/lib/gcc/i686-pc-cygwin/4.3.4/cc1plus.exe: error while loading shared libraries: ?: cannot open shared object file: No such file or directory".

Can anybody solve this one for me?

Thanks!

ptDev:
cygwin emulates a unix-like system under windows, so a command that runs in cygwin should not run in a DOS prompt most of the time.

I don't think cygwin is even correctly supported by Code::Blocks. I do know that MinGW (a port of GCC to native Windows binaries) should work properly.

MortenMacFly:

--- Quote from: ptDev on September 07, 2010, 09:48:52 am ---I don't think cygwin is even correctly supported by Code::Blocks.

--- End quote ---
Cygwin is supported just fine. However, you should choose this as compiler for your project and not use a MinGW based one.

stahta01:
Have you verified the existence of "cc1plus.exe" in folder CygWin\lib\gcc\i686-pc-cygwin\4.3.4?

Not sure the above applies after rereading your post.

Things that must be done to really test/use multiple GCC installations under windows.
Verify that NO gcc installations are in your system path.
Verify that x:\mingw does not exist for any value of "X"

Open an cmd prompt window.
change directory to folder holding CB project file.
set path to have the Compiler Bin folder first in the list

Try to execution the command used by CB under full compiler logging here.

I did it below and did not get error.

--- Code: ---Microsoft Windows [Version 6.1.7600]
Copyright (c) 2009 Microsoft Corporation.  All rights reserved.

D:\Users\stahta01>cd /d H:\SourceCode\CBProjects\TestProjects\testcyg

H:\SourceCode\CBProjects\TestProjects\testcyg>set PATH=D:\GreenApps\CygWin\bin;%PATH%

H:\SourceCode\CBProjects\TestProjects\testcyg>g++-4.exe -Weffc++ -Wall  -g -W -I../testcyg -IH:/SourceCode/CBProjects/TestProjects/testcyg -IH:/SourceCode/CBProjects/TestProjects/testcyg -c H:/SourceCode/CBProjects/TestProjects/testcyg/main.cpp -o obj/Debug/main.o

--- End code ---

Tim S.

rich_sposato:

--- Quote from: MortenMacFly on September 07, 2010, 10:03:20 am ---Cygwin is supported just fine. However, you should choose this as compiler for your project and not use a MinGW based one.

--- End quote ---

Yes, I much prefer the gcc version that comes with cygwin over the one provided with MinGW.

Navigation

[0] Message Index

[#] Next page

Go to full version