Menu

#422 Compile file failed. Build success.

Undefined
open
nobody
None
Bug_Report
2019-02-06
2016-10-27
Manuel MS
No

Nighty build 10912. Windows 10.TDM-GCC 5.1

Open an existing workspace. Make a small change to a .cpp file. Try "compile current file". GCC fails.
Try "Build". GCC works normally.

Discussion

  • Teodor Petrov

    Teodor Petrov - 2016-10-27

    Do you have minimal sample project or at least show us the build log.

     
  • Teodor Petrov

    Teodor Petrov - 2016-10-27

    Does it happen with the previous nightly? 16.01?

     
  • Teodor Petrov

    Teodor Petrov - 2016-10-27
    • Type: Undefined --> Bug_Report
     
  • Manuel MS

    Manuel MS - 2016-10-27

    The message is "Execution of 'mingw32-g++.exe -Wall ..... failed"

    It happens only for old workspaces created with a previous C:B version. Sorry, not small one at hand.
    I can say that if I open a "modern" workspace and hit "compile", close it, open the not-working workspace and hit "compile" then it does work. It only fails if the offending workspace is the first loaded after CB init.

    I don't remember if it happen also in 16.01. Likely not.

     
    • Teodor Petrov

      Teodor Petrov - 2016-10-27

      Why don't you just install 16.01 and try with it? Or the previous nightly? You can have them side by side.

      And please paste the log form the build log tab. Details matter!
      The format of cbp or workspace files hasn't change for quite a long time!

       
  • Manuel MS

    Manuel MS - 2016-10-27

    16.01 does not work neihter.
    When I hit "Compile current file", not "Build" (remember: building first makes this issue disappear)

    -------------- Build file: debug32 in deficar proyecto (compiler: GNU GCC Compiler TDM 32b)---------------

    mingw32-g++.exe -Wall -std=c++11 -pipe -mthreads -DGNUWIN32 -DWXMSW -D_UNICODE -pg -g -DWXDEBUG -m32 -IF:\wxSVN\include -Icodigo -IF:\wxSVN\lib\gcc_lib32\mswud -c F:\PROGS\deficar\codigo\importpoints.cpp -o debug32\objs\codigo\importpoints.cpp.o
    Execution of 'mingw32-g++.exe -Wall -std=c++11 -pipe -mthreads -DGNUWIN32 -DWXMSW -D_UNICODE -pg -g -DWXDEBUG -m32 -IF:\wxSVN\include -Icodigo -IF:\wxSVN\lib\gcc_lib32\mswud -c F:\PROGS\deficar\codigo\importpoints.cpp -o debug32\objs\codigo\importpoints.cpp.o' in 'F:\PROGS\deficar' failed.

     
  • Manuel MS

    Manuel MS - 2016-10-27

    If I change the target to release64 (my name for using TDM-GCC 64) then it works.Back again to TDM-GCC32 (without exiting CB) it doesn't.

     
  • Teodor Petrov

    Teodor Petrov - 2016-10-28

    Can you post the paths where every compiler is on your file system?
    What is the content of your PATH environement variable?

     
  • Manuel MS

    Manuel MS - 2016-10-31

    I have not installed MinGW. Only TDM-GCC 32/64 versions on different folders. Screenshots attached.
    The default 'GNU GCC Compiler' at "Selected compiler" is exactly the same as 'GNU GCC Compiler TDM 64b'

    My PATH enviroment:
    PATH=C:\ProgramData\Oracle\Java\javapath;C:\Program Files (x86)\PC Connectivity Solution\;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\Program Files (x86)\Windows Live\Shared;C:\Program Files (x86)\ATI Technologies\ATI.ACE\Core-Static;C:\Program Files (x86)\Skype\Phone\;C:\Users\MANOLO\AppData\Local\Microsoft\WindowsApps;

     
  • Teodor Petrov

    Teodor Petrov - 2016-10-31

    Can you reproduce the problem with a simple project?

     
  • Manuel MS

    Manuel MS - 2016-11-01

    I've reduced the offending project to the minimal, and changed some names. It's attached.
    The problem still is there.

     
  • Manuel MS

    Manuel MS - 2019-02-06

    The issue comes from having two compilers for the same project. In my case both 32/64 versions of TDM-GCC, installed in different folders. Fresh C::B detects the 64 bits version.

    Steps:
    1) (optional) Remove %users%\YOURUSER\AppData\Roaming\Codeblocks folder, just to simulate a fresh nighty install
    2) Open C::B 11552
    3) Press OK on compiler detection, no need to select one.
    4) Same for "file associations".
    5) Create a "Empty project" in any folder, accept rest of options.
    6) Add any .cpp with main().
    7) Build->Compile current file works fine. Build and run works fine.
    8) Settings->Compiler and use "Copy" button.
    9) Adjust Compiler's installation directory and Toolchain executables.
    i.e. C::B detected TDM-GCC-64. For second compiler (TDM-GCC-32) I changed x86_64-w64-mingw32-g++.exe to mingw32-g++.exe and so on for "C compiler", "C++ Compiler" and "Linker for dynamic libs"
    Close the dialog with OK.
    10) Project -> Build Options... change the compiler for "Debug", now to be the second created (copy of GNU GCC compiler).
    11) In the "build target" combobox select "Debug".
    12) Make a small change in the code so as to get it "invalidated" and need a new compilation.
    13) Build->Compile current file fails.
    14) If you first build this debug target, then using "Compile current file" works.

     

Log in to post a comment.