Author Topic: MinGW Compile Errors  (Read 18322 times)

Offline Pinyateh

  • Multiple posting newcomer
  • *
  • Posts: 12
MinGW Compile Errors
« on: December 29, 2014, 12:30:47 am »
FYI's:
  • Install directory: C:\CodeBlocks
  • OS: Windows 8.1 x64
  • Installed C::B with MinGW: Yes (So C:\CodeBlocks\MinGW is the compiler path)
  • MinGW Tree: http://pastebin.com/hTuVvyc3
  • Project is a new console application, C++, with just the basic default hello world program
  • There is a lot of information and methods already tested, so please read everything.

Let's get to it:

Fresh install, nothing changed in the compiler settings, on build&run:

Quote
mingw32-g++.exe -Wall -fexceptions -g  -c C:\CodeBlocks\Projects\CppLearning\main.cpp -o obj\Debug\main.o
mingw32-g++.exe: error: CreateProcess: No such file or directory

So I do about an hours worth of google searching and stock exchange searches and find nothing, except the wiki page on Vista and MinGW, and it looks to have my exact problem, so I follow the instructions until this step:

Quote
Still in the Compiler and Debugger dialogue go to "Search directories" -> "Compiler" and add:
Quote
C:\MinGW\include\

C:\MinGW\include\c++\MinGW-Version

C:\MinGW\include\c++\MinGW-Version\backward

C:\MinGW\include\c++\MinGW-Version\mingw32

C:\MinGW\lib\gcc\mingw32\MinGW-Version\include

So I start to delve into the path of these files but \include\c++ doesn't exits.... Stumped, I look for where ever iostream is located, which happens to be at:

Quote
C:\CodeBlocks\MinGW\lib\gcc\mingw32\4.7.1\include\c++


So I add this path to the search directory in the compiler settings, and out come more errors:

Quote
C:\CodeBlocks\MinGW\lib\gcc\mingw32\4.7.1\include\c++/iostream:39:28: fatal error: bits/c++config.h: No such file or directory

Do a quick search for c++config.h, and add this path to the search directories:

Quote
C:\CodeBlocks\MinGW\lib\gcc\mingw32\4.7.1\include\c++\mingw32

Guess what? New error!

Quote
C:\CodeBlocks\MinGW\lib\gcc\mingw32\4.7.1\include\c++/cwchar:46:19: fatal error: wchar.h: No such file or directory

So now I added the path to wchar.h to the search directories(It had two paths, so I added both):

Quote
C:\CodeBlocks\MinGW\lib\gcc\mingw32\4.7.1\include\c++\tr1
C:\CodeBlocks\MinGW\include

New missing file, so we add it's path to(stddef.h):

Quote
C:\CodeBlocks\MinGW\lib\gcc\mingw32\4.7.1\include

Boom! This is the dead end, here is a pastebin to the current error (It's large so it gets a pastebin):

http://pastebin.com/frEXi5SB

Update 1: After doing a cross-check between my search directories and the wiki's list, I noticed I was missing a \backward path, so I searched for the folder and added it to my search directories:

Quote
C:\CodeBlocks\MinGW\lib\gcc\mingw32\4.7.1\include\c++\backward

Same error as the pastebin.

Disclaimer: Sorry if I'm throwing a lot of useless information at you guys, I'm just trying to give you as much information as I know/have done. Please don't redirect me to other forum posts or stack exchanges, because I've probably read them. And sorry if this is on the wrong fourm/sub-forum.
« Last Edit: December 29, 2014, 12:39:29 am by Pinyateh »

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: MinGW Compile Errors
« Reply #1 on: December 29, 2014, 01:12:11 am »
I don't know where have you read that about these paths, but that place is totally wrong.
What is the full build log if you remove them?
What is the setting for the root of the compiler in the toolchain executable's tab in the compiler settings?
Does your compiler work if you try to compile something from the command line?
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline Pinyateh

  • Multiple posting newcomer
  • *
  • Posts: 12
Re: MinGW Compile Errors
« Reply #2 on: December 29, 2014, 01:16:01 am »
Removing all of the search directories, this is the error:

Quote
C:\CodeBlocks\Projects\CppLearning\main.cpp:1:20: error: no include path in which to search for iostream
C:\CodeBlocks\Projects\CppLearning\main.cpp: In function 'int main()':
C:\CodeBlocks\Projects\CppLearning\main.cpp:7:5: error: 'cout' was not declared in this scope
C:\CodeBlocks\Projects\CppLearning\main.cpp:7:31: error: 'endl' was not declared in this scope

Keep in mind that the additional path is still there, if I remove it, we go back to the default error.

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: MinGW Compile Errors
« Reply #3 on: December 29, 2014, 01:17:15 am »
Remove any paths you've entered and post the full log from a full rebuild, please!
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline Pinyateh

  • Multiple posting newcomer
  • *
  • Posts: 12
Re: MinGW Compile Errors
« Reply #4 on: December 29, 2014, 01:32:50 am »
Removed all search directories, removed the additional paths in toolchain exe's.
On rebuild, this is the build log:

Quote
-------------- Clean: Debug in CppLearning (compiler: GNU GCC Compiler)---------------

Cleaned "CppLearning - Debug"

-------------- Build: Debug in CppLearning (compiler: GNU GCC Compiler)---------------

mingw32-g++.exe -Wall -fexceptions -g  -c C:\CodeBlocks\Projects\CppLearning\main.cpp -o obj\Debug\main.o
mingw32-g++.exe: error: CreateProcess: No such file or directory
Process terminated with status 1 (0 minute(s), 0 second(s))
1 error(s), 0 warning(s) (0 minute(s), 0 second(s))

(Side question I've read about enabling full build log, but when I go to look for said setting, its not there? Is what I posted indeed a full build log?)

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7591
    • My Best Post
Re: MinGW Compile Errors
« Reply #5 on: December 29, 2014, 02:13:19 am »
Please rename the C:\MinGW folder on your harddrive to something like C:\MinGW.old.

Please post the toolchain path you have set in Code::Blocks. I am guessing it is C:\CodeBlocks\MinGW please confirm that is what it is currently for the CB "GNU GCC Compiler".

Tim S.


C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7591
    • My Best Post
Re: MinGW Compile Errors
« Reply #6 on: December 29, 2014, 02:31:14 am »
I am attaching a simple CB Project that display the toolchain location and checks for the C and C++ compilers.

The output I get when I run it with my very modified CB gcc settings.

Code
Running project pre-build steps
CMD /C where where
C:\Windows\System32\where.exe
CMD /C REM TARGET_COMPILER_DIR
CMD /C echo C:\Apps\TDM-GCC-64\
C:\Apps\TDM-GCC-64\
CMD /C REM TARGET_CC
CMD /C where x86_64-w64-mingw32-gcc.exe
C:\Apps\TDM-GCC-64\bin\x86_64-w64-mingw32-gcc.exe
CMD /C REM TARGET_CPP
CMD /C where x86_64-w64-mingw32-g++.exe
C:\Apps\TDM-GCC-64\bin\x86_64-w64-mingw32-g++.exe

I am now going to set my CB gcc compiler to the normal settings and see what is displayed.

Code
Running project pre-build steps
CMD /C where where
C:\Windows\System32\where.exe
CMD /C REM TARGET_COMPILER_DIR
CMD /C echo C:\Program Files\CodeBlocks\MinGW\
C:\Program Files\CodeBlocks\MinGW\
CMD /C REM TARGET_CC
CMD /C where mingw32-gcc.exe
C:\Program Files\CodeBlocks\MinGW\bin\mingw32-gcc.exe
CMD /C REM TARGET_CPP
CMD /C where mingw32-g++.exe
C:\Program Files\CodeBlocks\MinGW\bin\mingw32-g++.exe

Tim S.
« Last Edit: December 29, 2014, 02:34:36 am by stahta01 »
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline Pinyateh

  • Multiple posting newcomer
  • *
  • Posts: 12
Re: MinGW Compile Errors
« Reply #7 on: December 29, 2014, 03:24:46 am »
Thanks for joining the help, the path in my Tool Exe's is in fact C:\CodeBlocks\MinGW and it is for GNU GCC Compiler. I deleted the C:\MinGW long before this day, so it doesn't exist. As another side note, I do have MinGW pathed properly in Window's environmental variables.

Offline Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7255
Re: MinGW Compile Errors
« Reply #8 on: December 29, 2014, 06:42:53 am »
The first thing I would do is placing the project in another directory (somewhere below one of your user-folders),
Win8 sometimes behaves very strange if you try to use other folders for writing as normal user, even if you run a program "as administrator",

Offline Pinyateh

  • Multiple posting newcomer
  • *
  • Posts: 12
Re: MinGW Compile Errors
« Reply #9 on: December 29, 2014, 06:37:08 pm »
So I have multiple projects in 3 different locations now, the first is at C:\CodeBlocks\Projects\, the second is at C:\Users\myuserid*\CBPRojects\ and the third is where my actual data partition is, G:\Users\myuserid*\Documents\CodeBlocks\. All of these projects produce the same error as before.

* My user ID does have a space in it, but when I get the compiler log, the path has quotes around it.

EDIT: My responses will be more sparse today but I am still here, thank you all for the help.
« Last Edit: December 29, 2014, 06:42:29 pm by Pinyateh »

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: MinGW Compile Errors
« Reply #10 on: December 29, 2014, 08:35:23 pm »
Obviously the 'Compiler's installation directory' setting in Settings -> Compiler -> your compilers -> Toolchains executables is wrong. It points to the default setting.

Have you tried to set it to the proper value (C:\codeblocks\mingw)?
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline Pinyateh

  • Multiple posting newcomer
  • *
  • Posts: 12
Re: MinGW Compile Errors
« Reply #11 on: December 30, 2014, 04:26:19 am »
I have confirmed multiple times that the toolchain exe's is set to C:\CodeBlocks\MinGW. Thank you for the suggestion, but I've already checked that.

Edit: Here is a link to a picture of my toolchain exe's: http://surrr.net:8080/toolchain.png
« Last Edit: December 30, 2014, 04:29:07 am by Pinyateh »

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: MinGW Compile Errors
« Reply #12 on: December 30, 2014, 10:47:52 am »
Can you share your default.conf file? It can be found in %APPDATA%/Codeblocks.
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline Pinyateh

  • Multiple posting newcomer
  • *
  • Posts: 12
Re: MinGW Compile Errors
« Reply #13 on: December 30, 2014, 05:59:32 pm »
Sure here's the file, http://surrr.net:8080/default.conf

If you want to open it in something like notepad, just do ctrl+s and download it.

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: MinGW Compile Errors
« Reply #14 on: December 30, 2014, 07:42:39 pm »
Looks fine, unfortunately.

As another side note, I do have MinGW pathed properly in Window's environmental variables.
Can you remove it from the env vars?

Can you try what the output of Tim's project will be?
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]