Author Topic: Cygwin, Build simple project  (Read 5774 times)

Offline dnewhous

  • Single posting newcomer
  • *
  • Posts: 8
Cygwin, Build simple project
« 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. 

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7785
    • My Best Post
Re: Cygwin, Build simple project
« Reply #1 on: July 18, 2012, 01:03:19 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.
« Last Edit: July 18, 2012, 01:05:47 am by stahta01 »
C Programmer working to learn more about C++ and Git.
On Windows 10 64 bit and Windows 11 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline dnewhous

  • Single posting newcomer
  • *
  • Posts: 8
Re: Cygwin, Build simple project
« Reply #2 on: July 18, 2012, 04:10:23 pm »

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. 

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7785
    • My Best Post
Re: Cygwin, Build simple project
« Reply #3 on: July 18, 2012, 05:15:25 pm »
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.
« Last Edit: July 18, 2012, 07:12:15 pm by stahta01 »
C Programmer working to learn more about C++ and Git.
On Windows 10 64 bit and Windows 11 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline dnewhous

  • Single posting newcomer
  • *
  • Posts: 8
Re: Cygwin, Build simple project
« Reply #4 on: July 18, 2012, 07:54:46 pm »
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."

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7785
    • My Best Post
Re: Cygwin, Build simple project
« Reply #5 on: July 18, 2012, 08:01:10 pm »

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++ and Git.
On Windows 10 64 bit and Windows 11 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline dnewhous

  • Single posting newcomer
  • *
  • Posts: 8
Re: Cygwin, Build simple project
« Reply #6 on: July 23, 2012, 10:16:09 pm »
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.
« Last Edit: July 23, 2012, 10:34:03 pm by dnewhous »