Author Topic: CodeBlocks not building  (Read 7601 times)

Offline Andreu83

  • Single posting newcomer
  • *
  • Posts: 5
CodeBlocks not building
« on: July 03, 2019, 12:19:42 pm »
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

Offline Miguel Gimenez

  • Developer
  • Lives here!
  • *****
  • Posts: 1553

Offline Andreu83

  • Single posting newcomer
  • *
  • Posts: 5
Re: CodeBlocks not building
« Reply #2 on: July 03, 2019, 02:34:04 pm »
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:
Code
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:
Code
#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.

Offline Miguel Gimenez

  • Developer
  • Lives here!
  • *****
  • Posts: 1553
Re: CodeBlocks not building
« Reply #3 on: July 03, 2019, 02:49:40 pm »
Quote
The 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.

Offline Andreu83

  • Single posting newcomer
  • *
  • Posts: 5
Re: CodeBlocks not building
« Reply #4 on: July 03, 2019, 03:14:28 pm »
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.

Offline sodev

  • Regular
  • ***
  • Posts: 497
Re: CodeBlocks not building
« Reply #5 on: July 03, 2019, 05:36:56 pm »
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.

Offline pradnya

  • Single posting newcomer
  • *
  • Posts: 2
Re: CodeBlocks not building
« Reply #6 on: July 03, 2019, 06:25:45 pm »
I have a query

Offline pradnya

  • Single posting newcomer
  • *
  • Posts: 2
Re: CodeBlocks not building
« Reply #7 on: July 03, 2019, 06:28:13 pm »
#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

Offline Andreu83

  • Single posting newcomer
  • *
  • Posts: 5
Re: CodeBlocks not building
« Reply #8 on: July 04, 2019, 07:24:04 am »
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.

Offline BlueHazzard

  • Developer
  • Lives here!
  • *****
  • Posts: 3353
Re: CodeBlocks not building
« Reply #9 on: July 04, 2019, 08:10:12 am »
Quote
I 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?

Quote
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.
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...


Offline BlueHazzard

  • Developer
  • Lives here!
  • *****
  • Posts: 3353
Re: CodeBlocks not building
« Reply #10 on: July 04, 2019, 08:11:09 am »
@pradnya
How is your issue related with this topic?
If not create a new topic and follow this guide: http://wiki.codeblocks.org/index.php/FAQ-Compiling_(general)#Q:_How_do_I_report_a_compilation_problem_on_the_forums.3F

Offline Andreu83

  • Single posting newcomer
  • *
  • Posts: 5
Re: CodeBlocks not building
« Reply #11 on: July 04, 2019, 08:33:40 am »
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