bupticybee / TexasSolver

🚀 A very efficient Texas Holdem GTO solver :spades::hearts::clubs::diamonds:
https://bupticybee.github.io/texassolver_page
GNU Affero General Public License v3.0
1.69k stars 301 forks source link

cc1plus.exe: error: output filename specified twice #87

Open warm-dawn opened 2 years ago

warm-dawn commented 2 years ago

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"

bupticybee commented 2 years ago

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.

maosatgithub commented 2 years ago

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?

bupticybee commented 2 years ago

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.

maosatgithub commented 2 years ago

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 commented 2 years ago

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 commented 2 years ago

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 }

bupticybee commented 2 years ago

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.

Endle commented 2 years ago

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

keyor commented 1 year ago

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

bupticybee commented 1 year ago

keyor

try @Endle code

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