News:

The new Release 25.03 is out! You can download binaries for Windows and many major Linux distros here .

Main Menu

CodeBlocks not building

Started by Andreu83, July 03, 2019, 12:19:42 PM

Previous topic - Next topic

Andreu83

codeblocks not building anything programm, even "hello world"
main.cpp
mingw32-g++.exe /NOLOGO obj\Debug\main.obj, bin\Debug\14.exe, ,
mingw32-g++.exe: error: unrecognized command line option '-mn'
mingw32-g++.exe: error: unrecognized command line option '-w-'
Reinstalling doesn't help.  Settings -> Compiler -> Toolchain Executables evrything good.
Please help who can, it is desirable in Russian


Andreu83

I am running Code::Blocks version 17.12 on Windows 10
. The compiler I use is Digital Mars Compiler
version

When I ...
try build and run

Description of problem.
the window appears "It seems that this progect has not been build yet. Do you want to build it now?" I choose "yes" and nothing to do.

Build log:

mingw32-g++.exe -mn -c -w- -Ae  -g     -oobj\Debug\main.obj main.cpp
mingw32-g++.exe /NOLOGO obj\Debug\main.obj, bin\Debug\1.exe, , 
mingw32-g++.exe: error: unrecognized command line option '-mn'
mingw32-g++.exe: error: unrecognized command line option '-w-'
Process terminated with status 1 (0 minute(s), 0 second(s))
0 error(s), 0 warning(s) (0 minute(s), 0 second(s))


Crash report:

#include <iostream>

using namespace std;

int main()
{
    cout << "Hello world!" << endl;
    return 0;
}



    (Although the following is not necessary, showing that you
     have tried increases the probability of a response.)
I have already tried reinstall codeblocks, and changed settings Settings -> Compiler -> Toolchain Executables

... but none of them worked.

Miguel Gimenez

QuoteThe compiler I use is Digital Mars Compiler

If you are using Digital Mars why C::B is calling Mingw? Check the Digital Mars configuration in Settings -> Compiler -> Toolchain Executables and check that your project is configured to use Digital Mars (Project -> Build options -> Selected compiler)

The crash report you attached is not a crash report but your source code. Here there is no crash, so there is nothing to attach.

Andreu83

Digital Mars configuration in Settings -> Compiler -> Toolchain Executables, I checked and all the files exhibited what is necessary. Project -> Build options -> Selected compiler, compile is Digital Mars  After installing the program C::B I have not changed anything in the settings. She worked for a while, then she stopped.

sodev

The executable name of Digital Mars Compiler is dmc.exe and not mingw32-g++.exe so something is wrong!

So either your compiler is wrong configured or your project is wrong configured and uses another compiler, sadly your build log is stripped and doesn't contain the interesting line that says which compiler is selected.

So you should make sure that a) the Digital Mars Compiler is correctly configured, b) you use a project and c) the target of your project actually uses the Digital Mars Compiler and not something else.

pradnya


pradnya

#include <iostream>

using namespace std;

int main()
{
    int tuna = 10, x = 8;

    x = x + tuna;
    cout << "value of x = " ; cout <<  x ;
    return 0;
}



Debugger

Active debugger config: GDB/CDB debugger:Default
Building to ensure sources are up-to-date
Selecting target:
Debug
ERROR: You need to specify a debugger program in the debuggers's settings.
(For MinGW compilers, it's 'gdb.exe' (without the quotes))
(For MSVC compilers, it's 'cdb.exe' (without the quotes))


build log

Nothing to be done (all items are up-to-date).


-------------- Run: Debug in Text (compiler: GNU GCC Compiler)---------------

Checking for existence: C:\Users\Pradnya\Desktop\Text\bin\Debug\Text.exe
Executing: "C:\Program Files (x86)\CodeBlocks1/cb_console_runner.exe" "C:\Users\Pradnya\Desktop\Text\bin\Debug\Text.exe"  (in C:\Users\Pradnya\Desktop\Text\.)

Terminal output

value of x = 18
Process returned 0 (0x0)   execution time : 0.049 s
Press any key to continue.

old program run output

I am on windows 10

Andreu83

I remember. It happened when I clicked "create new project" and instead of "console application" I clicked "C::B plugin", I chose there I don't remember that and everything broke. Also, if I build my project on other computer, then I copy it to my computer and just run it, then everything works until I click build.

BlueHazzard

QuoteI remember. It happened when I clicked "create new project" and instead of "console application" I clicked "C::B plugin",
Unlikely....

So you want to compile with Digital Mars?
What is in your Settings->Compiler->Select "Digital Mars" from the dropdown->executables ?
Is this set to the right compiler? If not point the executable to the right place..

Is your porject set to the right compiler?
Project->Build settings->Select your project on the left->Drop down on the top: is it set to digital mats?

QuoteAlso, if I build my project on other computer, then I copy it to my computer and just run it, then everything works until I click build.
This is because you copy the whole project folder with the build executable. As soon as you build it you delete the executable and because you have the wrong compiler settings somewhere it wont make e new executable...


BlueHazzard


Andreu83

BlueHazzard
Thank you!!! And everyone who responded to my problem. I still figured out and understood what the problem was when I chose the GNU GCC compiler, in Project->Build settings-> remained Digital mars, now when I changed both there and there to the correct one, everything worked!!! Thank you all! ;D ;D ;D