News:

As usual while waiting for the next release - don't forget to check the nightly builds in the forum.

Main Menu

Cygwin, Build simple project

Started by dnewhous, July 18, 2012, 12:21:52 AM

Previous topic - Next topic

dnewhous

I am trying to use the cygwin gcc compiler on the two source files I found on the web here http://www.linuxhowtos.org/C_C++/socket.htm.

The error message that I get is
"Execution of 'gcc.exe -c P:/Projects/client.c -o P:/Projects/client.o' in 'C:\Users\newhodl\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\CodeBlocks' failed."

I want to use CodeBlocks for some very serious development. 

stahta01

#1
Quote from: dnewhous on July 18, 2012, 12:21:52 AM
I am trying to use the cygwin gcc compiler on the two source files I found on the web here http://www.linuxhowtos.org/C_C++/socket.htm.

The error message that I get is
"Execution of 'gcc.exe -c P:/Projects/client.c -o P:/Projects/client.o' in 'C:\Users\newhodl\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\CodeBlocks' failed."

I want to use CodeBlocks for some very serious development.  

Most likely solution, change the Toolchain to use the real exe instead of gcc.exe (which is a symlink).

Most likely a valid name is either gcc-4.exe or gcc-3.exe

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]

dnewhous

Quote from: stahta01 on July 18, 2012, 01:03:19 AM

Most likely solution, change the Toolchain to use the real exe instead of gcc.exe (which is a symlink).

Most likely a valid name is either gcc-4.exe or gcc-3.exe

Tim S.

Changing to either gcc-3.exe or gcc-4.exe changes the error message to "'g++.exe ...'"
Changing to the i686-pc-cygwin-gcc.exe files changes the error message similarly. 

stahta01

#3
Try creating the Code::Blocks project and working directory in a spot you have permissions to create and delete files without being the administrator.

This IS NOT a good location "C:\Users\newhodl\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\CodeBlocks" to use.

Also read this link http://wiki.codeblocks.org/index.php?title=FAQ-Compiling_%28errors%29#Q:_How_do_I_troubleshoot_a_compiler_problem.3F

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]

dnewhous

I made a console project and added my files to it.  When I try to Build I get the following error

"gcc.exe -Wall  -g     -c P:/Projects/ServerClientTest/server.c -o obj/Debug/server.o
Execution of 'gcc.exe -Wall  -g     -c P:/Projects/ServerClientTest/server.c -o obj/Debug/server.o' in 'P:\Projects\ServerClientTest' failed.
Nothing to be done."

stahta01

Quote from: stahta01 on July 18, 2012, 01:03:19 AM

Most likely solution, change the Toolchain to use the real exe instead of gcc.exe (which is a symlink).

Most likely a valid name is either gcc-4.exe or gcc-3.exe

Tim S.

Once more I say, Change the name of the C Compiler.
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]

dnewhous

#6
The solution to that difficulty was to install a nightly build of CodeBlocks.  Now I am having a more mundane issue.
When I Build with CodeBlocks I get the linker errors indicated on the screenshot I am posting.  When I use the following command line in the same directory I get a successful build

"g++ -o serverMain ServerMain.cpp tcpIpSocket.cpp timer.cpp"

serverMain.exe is produced and works just fine.  I want to be able to use CodeBlocks to Build serverMain.exe.  

K, this problem is solved by creating a project with the relevant source files added to the project.