This is what I get when trying to compile a simple hello world program with gcc.
c:\\>gcc hello.c
hello.c:9:2: warning: no newline at end of file
C:\\MinG
Yes it is a permissions issue, you must not be running the command line window in Admin mode.
Don't work in C:\
Copy the file to a folder under my documents, or a subfolder of C:, or another drive.
Or, run the console in Administrator mode if you really want to work in the root of C:
To switch to D: while in C:, just type D: (you use CD only when already on the correct drive)
The g++.exe-command in the build-log in the CodeBlocks-IDE shows the command
with an additional path: C:\MinGW\lib
, which is wrong.
If you copy the command to a cmd-window (in the directory of your Project)
without the C:\MinGW\lib
the compiler works. When you copy the command as shown in CodeBlocks-Buil-log
it fails, with the same message in the cmd-window.
Have a look at the Settings > Compiler > Search Directories > Linker
. You've got to delete the
C:\MinGW\lib
there, but the bug is, that it is not deleted if you do it once.
You've got to repeat it and then it works.
The most common case is that your program may still be running in the background, possibly hanged on an endless loop. You can try searching for the process in the process list (press Alt+Ctrl+Del) and killing it.