Code::Blocks Forums

User forums => Using Code::Blocks => Topic started by: Schragner on March 17, 2021, 02:32:13 pm

Title: Code Blocks does not compile
Post by: Schragner on March 17, 2021, 02:32:13 pm
Why is my Code Block not able to build anything? I am using version 16.01 and I have windows 7. Whenever I try to build something it says "1 errors" and if I go to Building Log it says "mingw32-g++.exe: error: CreateProcess: No such file or directory". What should I do? I need it to work as soon as possible. Thanks very much!
Title: Re: Code Blocks does not compile
Post by: Miguel Gimenez on March 17, 2021, 02:51:10 pm
Can you post a full rebuild log?

http://wiki.codeblocks.org/index.php?title=FAQ-Compiling_%28general%29#Q:_How_do_I_report_a_compilation_problem_on_the_forums.3F (http://wiki.codeblocks.org/index.php?title=FAQ-Compiling_%28general%29#Q:_How_do_I_report_a_compilation_problem_on_the_forums.3F)
Title: Re: Code Blocks does not compile
Post by: Schragner on March 17, 2021, 06:47:24 pm
I am running version 16.01 on windows 7. The compiler is GNU GCC Compiler.
When I write anything and hit build it says there is one error.
Build Log:
-------------- Build: Debug in 168 (compiler: GNU GCC Compiler)---------------

mingw32-g++.exe -Wall -fexceptions -g  -c "C:\Users\Administrator\Documents\New folder\168\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))
 
I have already tried reinstalling, restarting the computer, etc. but nothing works.
Thanks to anyone who helps me(including Miguel Gimenez)
Title: Re: Code Blocks does not compile
Post by: Miguel Gimenez on March 17, 2021, 07:13:32 pm
It looks like a bug in MinGW, specially with TDM. See other similar threads in this forum:

http://forums.codeblocks.org/index.php/topic,18100.0.html (http://forums.codeblocks.org/index.php/topic,18100.0.html)
http://forums.codeblocks.org/index.php/topic,21101.0.html (http://forums.codeblocks.org/index.php/topic,21101.0.html)

or outside

https://stackoverflow.com/questions/14330383/mingw-error-no-such-file-or-directory-exists?rq=1 (https://stackoverflow.com/questions/14330383/mingw-error-no-such-file-or-directory-exists?rq=1)
Title: Re: Code Blocks does not compile
Post by: Schragner on March 17, 2021, 07:21:07 pm
Thanks Miguel Gimenez for the responses, but I still can't get it to work. Anyone else please help if you can.
Title: Re: Code Blocks does not compile
Post by: Miguel Gimenez on March 17, 2021, 07:39:08 pm
Do you have two compilers installed, say one in C:\mingw and other under C::B installation folder?
Can you post the value of the path variable (open a console, write "path" without the quotes and press enter).
Can you take a snapshot of the compiler configuration in Settings -> Compiler -> Toolchain executables
Title: Re: Code Blocks does not compile
Post by: Schragner on March 18, 2021, 07:46:13 am
I only have one compiler, the standard one.
I  don't know where to put "path", because I have only used C::B for a specific reason.
Title: Re: Code Blocks does not compile
Post by: Miguel Gimenez on March 18, 2021, 09:10:42 am
Consoles are from Windows, and they can be opened using Windows key + R and writing "cmd"

You can try changing the mingw32.. file names in "Toolchain executables" (using the button with three dots) to just gcc.exe and g++.exe.

If this does not work, uninstall C::B and the compiler and install 20.03.
Title: Re: Code Blocks does not compile
Post by: Schragner on March 18, 2021, 09:31:38 am
I have tried changing the file names to both of those, yet it still doesn't work. I am hopeless that anything will work. I need specifically the 16.01 version, and I don't know what to do. I have even considered buying a new laptop.
Title: Re: Code Blocks does not compile
Post by: gd_on on March 18, 2021, 10:17:16 am
Three things to try :

Buying a new laptop? It's up to you, but I really doubt that this is the problem !
Title: Re: Code Blocks does not compile
Post by: Miguel Gimenez on March 18, 2021, 10:27:32 am
You can install a new MinGW distro:
Nuwen (64 bit only) https://nuwen.net/mingw.html (https://nuwen.net/mingw.html)
MinGW-w64 https://sourceforge.net/projects/mingw-w64/files/Toolchains%20targetting%20Win64/Personal%20Builds/mingw-builds/7.2.0/threads-posix/sjlj/ (https://sourceforge.net/projects/mingw-w64/files/Toolchains%20targetting%20Win64/Personal%20Builds/mingw-builds/7.2.0/threads-posix/sjlj/)
TDM https://jmeubank.github.io/tdm-gcc/download/ (https://jmeubank.github.io/tdm-gcc/download/)

and configure the toolchain settings so they point to the new installation.
Title: Re: Code Blocks does not compile
Post by: Schragner on March 18, 2021, 10:53:21 am
I think I might install the newest version jut to get this over with because in the meantime I reinstalled it and another error occurred and I'm pretty much done mentally :/.
Title: Re: Code Blocks does not compile
Post by: Avan on March 18, 2021, 01:03:37 pm
... the meantime I reinstalled it and another error occurred and I'm pretty much done mentally :/.

Schragner,

Yes, projects like CB can be (read: are) daunting. Try this document, unlike most other doc's it's quite recent and helped me onderstand the installation process better and allowed to iron out a lot of wrinkles.

http://www.codeblocks.org/docs/manual_codeblocks_en.pdf

Also, try to use one of the most recent CB versions as the team has had to implement High DPI Awareness and 'a lot went wrong' during that process.
Title: Re: Code Blocks does not compile
Post by: Schragner on March 18, 2021, 01:17:49 pm
Thanks to everyone who helped or tried to help me, I am grateful to you all. But I managed to solve the problem in a more "basic" way, by just changing the laptops user and downloading it again. Again, thank you so much to everyone, and for being so understanding with me, 'cause this is my first time posting something in any forum! Bye now!