12 Replies - 4146 Views - Last Post: 11 March 2013 - 08:04 PM Rate Topic: -----

#1 hk22  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 4
  • Joined: 10-March 13

Cannot compile C with Code blocks in Windows 8; mingw error

Posted 10 March 2013 - 03:08 PM

I'm starting to learn C and I've installed Codeblocks with MinGW. When I try to build and compile the code I get:
mingw32-g++.exe  -o bin\Debug\Test.exe obj\Debug\main.o    
Execution of 'mingw32-g++.exe  -o bin\Debug\Test.exe obj\Debug\main.o' in 'E:\Program Files\CodeBlocks\Projects\Test' failed.
Nothing to be done (all items are up-to-date).



I checked Settings > Compiler > Toolchains and all the MinGW's are linked to the ones in the CodeBlocks folder.

Is This A Good Question/Topic? 0
  • +

Replies To: Cannot compile C with Code blocks in Windows 8; mingw error

#2 IngeniousHax  Icon User is offline

  • |>|20-514<|{3|2

Reputation: 78
  • View blog
  • Posts: 1,358
  • Joined: 28-March 09

Re: Cannot compile C with Code blocks in Windows 8; mingw error

Posted 10 March 2013 - 10:46 PM

Don't hold me to this, but i'm pretty sure you need to have the gcc compiler for C. Or, you can just save your C files as .cpp instead of .c and it should compile then.

G++ = C++ compiler
GCC = C compiler

This post has been edited by IngeniousHax: 10 March 2013 - 10:47 PM

Was This Post Helpful? 0
  • +
  • -

#3 Limecore  Icon User is offline

  • D.I.C Head

Reputation: 18
  • View blog
  • Posts: 91
  • Joined: 28-November 12

Re: Cannot compile C with Code blocks in Windows 8; mingw error

Posted 10 March 2013 - 10:54 PM

I may be thinking about dev c++(terrible ide) but I was having problems getting a compiler to work with my ide so I downloaded the version with the compiler build in

View PostLimecore, on 11 March 2013 - 05:51 AM, said:

I may be thinking about dev c++(terrible ide) but I was having problems getting a compiler to work with my ide so I downloaded the version with the compiler build in

I can't figure out how to edit my post, but here is the link that has mingw included with it http://sourceforge.n...mingw-setup.exe
Was This Post Helpful? 0
  • +
  • -

#4 Limecore  Icon User is offline

  • D.I.C Head

Reputation: 18
  • View blog
  • Posts: 91
  • Joined: 28-November 12

Re: Cannot compile C with Code blocks in Windows 8; mingw error

Posted 10 March 2013 - 11:13 PM

Why can I not edit the above post, but I can this one

This post has been edited by Limecore: 10 March 2013 - 11:13 PM

Was This Post Helpful? 0
  • +
  • -

#5 Salem_c  Icon User is offline

  • void main'ers are DOOMED
  • member icon

Reputation: 1621
  • View blog
  • Posts: 3,078
  • Joined: 30-May 10

Re: Cannot compile C with Code blocks in Windows 8; mingw error

Posted 11 March 2013 - 02:17 AM

View Posthk22, on 10 March 2013 - 10:08 PM, said:

I'm starting to learn C and I've installed Codeblocks with MinGW. When I try to build and compile the code I get:
mingw32-g++.exe  -o bin\Debug\Test.exe obj\Debug\main.o    
Execution of 'mingw32-g++.exe  -o bin\Debug\Test.exe obj\Debug\main.o' in 'E:\Program Files\CodeBlocks\Projects\Test' failed.
Nothing to be done (all items are up-to-date).



I checked Settings > Compiler > Toolchains and all the MinGW's are linked to the ones in the CodeBlocks folder.

Do you have any anti-virus software running (if so, which one).
Consider looking at ways of marking certain directories as "whitelist" or "do not check".

Some AV's are known to get very panicky as soon as programs start creating executable files. Whilst for the general "surf and email" population this isn't a problem, for us developers, it can be a real PITA.
Was This Post Helpful? 0
  • +
  • -

#6 Limecore  Icon User is offline

  • D.I.C Head

Reputation: 18
  • View blog
  • Posts: 91
  • Joined: 28-November 12

Re: Cannot compile C with Code blocks in Windows 8; mingw error

Posted 11 March 2013 - 02:34 AM

View PostSalem_c, on 11 March 2013 - 09:17 AM, said:

View Posthk22, on 10 March 2013 - 10:08 PM, said:

I'm starting to learn C and I've installed Codeblocks with MinGW. When I try to build and compile the code I get:
mingw32-g++.exe  -o bin\Debug\Test.exe obj\Debug\main.o    
Execution of 'mingw32-g++.exe  -o bin\Debug\Test.exe obj\Debug\main.o' in 'E:\Program Files\CodeBlocks\Projects\Test' failed.
Nothing to be done (all items are up-to-date).



I checked Settings > Compiler > Toolchains and all the MinGW's are linked to the ones in the CodeBlocks folder.

Do you have any anti-virus software running (if so, which one).
Consider looking at ways of marking certain directories as "whitelist" or "do not check".

Some AV's are known to get very panicky as soon as programs start creating executable files. Whilst for the general "surf and email" population this isn't a problem, for us developers, it can be a real PITA.

I know...

For some reason avast free will crap itself everytime it sees a debug exe, but the run exe is left alone
Was This Post Helpful? 0
  • +
  • -

#7 hk22  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 4
  • Joined: 10-March 13

Re: Cannot compile C with Code blocks in Windows 8; mingw error

Posted 11 March 2013 - 09:37 AM

Thank you for the replies but I got it working late last night.

I set Code Blocks to run as administrator and I set permissions in MinGW folder for Users to Full Control.
This seemed to have done the trick. The code will compile and run as its suppose to. It always seems to be a permissions issue in windows 8 for me.
Was This Post Helpful? 0
  • +
  • -

#8 jimblumberg  Icon User is online

  • member icon


Reputation: 3987
  • View blog
  • Posts: 12,298
  • Joined: 25-December 09

Re: Cannot compile C with Code blocks in Windows 8; mingw error

Posted 11 March 2013 - 12:27 PM

That maybe because of where you are placing the executable. What directory are you trying to use (the complete path)?

Jim
Was This Post Helpful? 0
  • +
  • -

#9 hk22  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 4
  • Joined: 10-March 13

Re: Cannot compile C with Code blocks in Windows 8; mingw error

Posted 11 March 2013 - 12:58 PM

E:\Program Files\CodeBlocks

The subfolder MinGW is in the directory above.

My laptop has a 2nd Hard drive and I created the program files directory on there to save space on my other hard drive.

Previously when I tried to code fortran, I could not get the software to compile the code and solved it by using a win 7 virtual machine where the code compiled perfectly with the exact same installation setup.

E:\Program Files\CodeBlocks

The subfolder MinGW is in the directory above.

My laptop has a 2nd Hard drive and I created the program files directory on there to save space on my other hard drive.

Previously when I tried to code fortran, I could not get the software to compile the code and solved it by using a win 7 virtual machine where the code compiled perfectly with the exact same installation setup.
Was This Post Helpful? 0
  • +
  • -

#10 jimblumberg  Icon User is online

  • member icon


Reputation: 3987
  • View blog
  • Posts: 12,298
  • Joined: 25-December 09

Re: Cannot compile C with Code blocks in Windows 8; mingw error

Posted 11 March 2013 - 01:23 PM

I think the problem is that you are trying to use the Program Files directory for your files. You should try placing your projects into directories off your user directory instead of the Program Files directory.

Jim
Was This Post Helpful? 2
  • +
  • -

#11 Skydiver  Icon User is offline

  • Code herder
  • member icon

Reputation: 3450
  • View blog
  • Posts: 10,646
  • Joined: 05-May 12

Re: Cannot compile C with Code blocks in Windows 8; mingw error

Posted 11 March 2013 - 03:14 PM

Jim's hit the nail on the head. You need admin rights to read/write into the directories below the Program Files directories. If you put your projects under the My Documents directories, you should be okay.
Was This Post Helpful? 0
  • +
  • -

#12 hk22  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 4
  • Joined: 10-March 13

Re: Cannot compile C with Code blocks in Windows 8; mingw error

Posted 11 March 2013 - 05:45 PM

View Postjimblumberg, on 11 March 2013 - 12:27 PM, said:

That maybe because of where you are placing the executable. What directory are you trying to use (the complete path)?

Jim


I see, thanks for the tip. I'll keep that in mind for the future. As for now, everything is working perfectly.
Was This Post Helpful? 0
  • +
  • -

#13 Skydiver  Icon User is offline

  • Code herder
  • member icon

Reputation: 3450
  • View blog
  • Posts: 10,646
  • Joined: 05-May 12

Re: Cannot compile C with Code blocks in Windows 8; mingw error

Posted 11 March 2013 - 08:04 PM

Actually, you are setting yourself up for failure by always running as administrator. Microsoft completely messed things up when it let people assume that they were running as administrator. Some programs both inside and outside of Microsoft now have to be run as administrator because it would be too hard to update the code to run with least privileges. Please don't be among those who will also be making that assumption that your program can only be run as administrator.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1