Showing posts with label MinGW. Show all posts
Showing posts with label MinGW. Show all posts

Oct 31, 2014

Eclipse C/C++: Cannot open output file *.exe: Permission denied

Problem: you want to build/compile your project and you get the error:

cannot open output file FOO.exe: Permission denied


Solution: It's most likely that your EXE is running and can't be overwritten by the compile process. You have to stop all running processes of your EXE. The ones started within Eclipse can be stopped in the debug perspective: Choose all running processes and press the stop button...


If the problem is still not solved, you may have started the EXE outside Eclipse. Go to the task manager (in Windows) > Processes and stop your EXEs.


Eclipse C/C++: for loop initial declarations are only allowed in C99 mode

Problem: you declare a variable in the for loop in Eclipse and you get the error message:

'for' loop initial declarations are only allowed in C99 mode

Solution: use the option -std=c99 for your compiler! Go to: Project > Properties > C/C++ Buils > Settings > Tool Settings > GCC C Compiler > Dialect > Language Standard: choose "ISO C99"

Project > Properties

C/C++ Buils > Settings > Tool Settings > GCC C Compiler > Dialect > Language Standard: choose "ISO C99"


Mar 20, 2014

Tutorial: Installing portable MinGW C-Compiler gcc on USB Flash Drive / Stick

If you work on different computers, but always want to have a C compiler with you, just create a portable version on an USB flash drive:
  1. Install MinGW to your computer, e.g. "C:\MinGW\"
  2. Copy "C:\MinGW\" to the USB drive "X:\MinGW\"
  3. Create a text file "X:\MinGW\bin\setpath.bat" with content set path=%path%;%CD%
  4. Run the batch file "X:\MinGW\bin\setpath.bat"
Now the bin directory of MinGW is in the search path. Now you can use the compiler gcc or other MinGW tools...