TexasSolver icon indicating copy to clipboard operation
TexasSolver copied to clipboard

cc1plus.exe: error: output filename specified twice

Open warm-dawn opened this issue 3 years ago β€’ 10 comments

g++ -fno-keep-inline-dllexport -openmp -g -std=gnu++11 -Wall -W -Wextra -dM -E -o debug/moc_predefs.h C:/Qt/Qt5.11.3/5.11.3/mingw53_32/mkspecs/features/data/dummy.cpp cc1plus.exe: error: output filename specified twice Makefile.Debug:400: recipe for target 'debug/moc_predefs.h' failed mingw32-make[1]: Leaving directory 'E:/temp/build-TexasSolverGui-Desktop_Qt_5_11_3_MinGW_32bit-Debug' mingw32-make[1]: *** [debug/moc_predefs.h] Error 1 Makefile:36: recipe for target 'debug' failed mingw32-make: *** [debug] Error 2 16:59:30: 进程"C:\Qt\Qt5.11.3\Tools\mingw530_32\bin\mingw32-make.exe"ι€€ε‡ΊοΌŒι€€ε‡Ίδ»£η  2 。 Error while building/deploying project TexasSolverGui (kit: Desktop Qt 5.11.3 MinGW 32bit) When executing step "Make"

warm-dawn avatar Mar 09 '22 09:03 warm-dawn

I don't think it's the problem of this project. Many have already successfully compiled in windows, please make sure you follow exactly the compile guide in readme.

bupticybee avatar Mar 09 '22 12:03 bupticybee

I had the same issue when trying to use MinGW. Thus I used MVSC2015 instead, which worked. This is with Qt 5.15.2

Note that this is on the GUI version -- the only compile guide I found was for the console version, is there another one?

maosatgithub avatar Jun 14 '22 09:06 maosatgithub

I had the same issue when trying to use MinGW. Thus I used MVSC2015 instead, which worked. This is with Qt 5.15.2

Note that this is on the GUI version -- the only compile guide I found was for the console version, is there another one?

MVSC produce slower executable, don't use it.

make sure you use Mingw64 instead of Mingw32. For Gui version I didn't actually write the compile guide, you should just set the QT C compiler to mingw64 and you should get the project running.

bupticybee avatar Jun 14 '22 10:06 bupticybee

I tried both, makes no difference. Issue is in these lines of "Makefile.Release" in the build directory: release/moc_predefs.h: C:/Qt/5.15.2/mingw81_64/mkspecs/features/data/dummy.cpp g++ -fno-keep-inline-dllexport -openmp -O2 -Wall -Wextra -Wextra -dM -E -o release\moc_predefs.h C:\Qt\5.15.2\mingw81_64\mkspecs\features\data\dummy.cpp

Error of that g++ call is "cc1plus.exe: error: output filename specified twice" But I don't see where that 2nd specification would come from...

Can you please compare what you have in the makefile, and maybe also provide the resulting release\moc_predefs.h from the subdirectory?

maosatgithub avatar Jun 15 '22 19:06 maosatgithub

I think I found the issue in teh .pro file , this fixes it quick and dirty for me: win32: { #QMAKE_CXXFLAGS+= -openmp #QMAKE_LFLAGS += -openmp QMAKE_CXXFLAGS += -fopenmp QMAKE_LFLAGS += -fopenmp RC_ICONS = imgs/texassolver_logo.ico }

Yes, seems to be faster by 25%, but was so only on the 2nd run onwards. 1st run was actually 20% slower, for whatever reason.

maosatgithub avatar Jun 15 '22 20:06 maosatgithub

I believe this would be the proper fix:

win32-msvc*: { QMAKE_CXXFLAGS+= -openmp QMAKE_LFLAGS += -openmp RC_ICONS = imgs/texassolver_logo.ico }

win32-g++: { QMAKE_CXXFLAGS += -fopenmp QMAKE_LFLAGS += -fopenmp RC_ICONS = imgs/texassolver_logo.ico }

win64-msvc*: { QMAKE_CXXFLAGS+= -openmp QMAKE_LFLAGS += -openmp RC_ICONS = imgs/texassolver_logo.ico }

win64-g++: { QMAKE_CXXFLAGS += -fopenmp QMAKE_LFLAGS += -fopenmp RC_ICONS = imgs/texassolver_logo.ico }

maosatgithub avatar Jun 15 '22 22:06 maosatgithub

I believe this would be the proper fix:

win32-msvc*: { QMAKE_CXXFLAGS+= -openmp QMAKE_LFLAGS += -openmp RC_ICONS = imgs/texassolver_logo.ico }

win32-g++: { QMAKE_CXXFLAGS += -fopenmp QMAKE_LFLAGS += -fopenmp RC_ICONS = imgs/texassolver_logo.ico }

win64-msvc*: { QMAKE_CXXFLAGS+= -openmp QMAKE_LFLAGS += -openmp RC_ICONS = imgs/texassolver_logo.ico }

win64-g++: { QMAKE_CXXFLAGS += -fopenmp QMAKE_LFLAGS += -fopenmp RC_ICONS = imgs/texassolver_logo.ico }

I see, will do some tests.

bupticybee avatar Jun 16 '22 11:06 bupticybee

I have met the same problem when compiling on Windows

The hack https://github.com/bupticybee/TexasSolver/issues/87#issuecomment-1156893766 worked fine for me. However, https://github.com/bupticybee/TexasSolver/issues/87#issuecomment-1157015922 doesn't work for me

Endle avatar Jul 25 '22 00:07 Endle

I have the same problems, (cc1.exe: error: output filename specified twice) what is the best solution to solve it?

keyor avatar Jan 30 '23 23:01 keyor

keyor

try @Endle code

https://github.com/Endle/TexasSolver/commit/39859a501afe32155fcd8a77537b2ad7d7bc93a7

bupticybee avatar Jan 31 '23 03:01 bupticybee