Author Topic: dreaded "c++ compilation failed"  (Read 259 times)

tvmccorm

  • Newbie
  • *
  • Posts: 12
dreaded "c++ compilation failed"
« on: February 16, 2017, 05:34:23 pm »
I'm using version 1.1 on windows 10.  The recompile_win.bat file generated is:

@echo off
cd %0\..\
echo Recompiling...
cd ../c
c_compiler\bin\g++ -s -Wfatal-errors -w -Wall qbx.cpp  libqb\os\win\libqb_1_1_0001000000000.o  -D DEPENDENCY_NO_SOCKETS -D DEPENDENCY_NO_PRINTER -D DEPENDENCY_NO_ICON -D DEPENDENCY_NO_SCREENIMAGE -D DEPENDENCY_AUDIO_OUT  parts\audio\out\os\win\src.a ..\\temp\\data.o    parts\core\os\win\src.a -lopengl32 -lglu32   -mwindows -static-libgcc -static-libstdc++ -D GLEW_STATIC -D FREEGLUT_STATIC     -lwinmm -lksguid -ldxguid -lole32 -o ..\..\ >..\..\output.txt 2>&1 "..\..\mcbills.exe"
pause

output.txt says:

g++: error: ..\..\mcbills.exe: No such file or directory

mcbills being the program I'm trying to compile.  I really just need the error line number in main.txt.  Is there any other way to get it?

Thanks, Tom

FellippeHeitor

  • QB64 Partner Site Owner
  • Hero Member
  • *
  • Posts: 1708
  • LET IT = BE
    • QB64.org
Re: dreaded "c++ compilation failed"
« Reply #1 on: February 16, 2017, 05:48:08 pm »
It could be you have an antivirus getting in the way of the compilation process. Try excluding your qb64 folder from live scanning.

tvmccorm

  • Newbie
  • *
  • Posts: 12
Re: dreaded "c++ compilation failed"
« Reply #2 on: February 17, 2017, 11:04:00 am »
That didn't help.  I came up with a work around:

c_compiler\bin\g++ -s -Wfatal-errors -w -Wall qbx.cpp  libqb\os\win\libqb_1_1_0001000000000.o  -D DEPENDENCY_NO_SOCKETS -D DEPENDENCY_NO_PRINTER -D DEPENDENCY_NO_ICON -D DEPENDENCY_NO_SCREENIMAGE -D DEPENDENCY_AUDIO_OUT  parts\audio\out\os\win\src.a ..\\temp\\data.o    parts\core\os\win\src.a -lopengl32 -lglu32   -mwindows -static-libgcc -static-libstdc++ -D GLEW_STATIC -D FREEGLUT_STATIC     -lwinmm -lksguid -ldxguid -lole32 -o ..\..\ > output.txt

This doesn't give me errors, it compiles the program successfully, although it names it just ".exe"

TylerDarko

  • Newbie
  • *
  • Posts: 36
Re: dreaded "c++ compilation failed"
« Reply #3 on: February 17, 2017, 11:25:59 am »
qb64 doesn't add that  ..\..\ >..\..\output.txt 2>&1 bit to the compilation line. Are you using the ide? Did you manually edit the recompile bat file in the first place? the order of parameters seems really odd

TylerDarko

  • Newbie
  • *
  • Posts: 36
Re: dreaded "c++ compilation failed"
« Reply #4 on: February 17, 2017, 11:27:52 am »
if you added >output.txt manually just to see the output of the compialtion process (probably because it closed to fast) maybe you'd better leave qb64 create the compilation line on its own and run it from the command line to have time to see the messages

qb64 -x mcbills.bas

tvmccorm

  • Newbie
  • *
  • Posts: 12
Re: dreaded "c++ compilation failed"
« Reply #5 on: February 17, 2017, 02:36:22 pm »
That recompile_win.bat was generated by qb64 -c mcbills.bas.  Thanks for the tip of qb64 -x.  That gives a readable error.  The error was that an ELSE command was prefixed by a tab.  Loading and saving the program with the IDE changes tabs to spaces.