在我的项目中,我必须解决整数线性规划问题,因此我决定在我的 Windows 7 平台上将 lp_solve 求解器包与 Qt 4.8.4 mingw32 编译器集成。我正在静态编译我的独立 Qt 应用程序。
我已经遵循了关于将我的应用程序与 lp_solve (隐式链接)静态链接的建议。
- 我已经下载了提到的头文件并将它们的路径包含在我的 .pro 文件中。
- 我已经下载了 liblpsolve55.lib 文件并将该库包含在我的 .pro 文件中。
我的项目文件的补充:
win32:CONFIG(release, debug|release): LIBS += -L$$PWD/../../../../../../Users/Abhishek/Downloads/lp_solve_5.5.2.0_dev_win32/ -lliblpsolve55
else:win32:CONFIG(debug, debug|release): LIBS += -L$$PWD/../../../../../../Users/Abhishek/Downloads/lp_solve_5.5.2.0_dev_win32/ -lliblpsolve55d
INCLUDEPATH += $$PWD/../../../../../../Users/Abhishek/Downloads/lp_solve_5.5.2.0_dev_win32
DEPENDPATH += $$PWD/../../../../../../Users/Abhishek/Downloads/lp_solve_5.5.2.0_dev_win32
win32:CONFIG(release, debug|release): PRE_TARGETDEPS += $$PWD/../../../../../../Users/Abhishek/Downloads/lp_solve_5.5.2.0_dev_win32/liblpsolve55.lib
else:win32:CONFIG(debug, debug|release): PRE_TARGETDEPS += $$PWD/../../../../../../Users/Abhishek/Downloads/lp_solve_5.5.2.0_dev_win32/liblpsolve55d.lib
win32: LIBS += -L$$PWD/../../../../../../Users/Abhishek/Downloads/lp_solve_5.5.2.0_dev_win32/ -llpsolve55
INCLUDEPATH += $$PWD/../../../../../../Users/Abhishek/Downloads/lp_solve_5.5.2.0_dev_win32
DEPENDPATH += $$PWD/../../../../../../Users/Abhishek/Downloads/lp_solve_5.5.2.0_dev_win32
此外,Qt Autocomplete 正在识别这些头文件。
但是,当我在代码中包含以下行时,会收到一堆警告和错误。
int demo()
{
lprec *lp;
lp = make_lp( 0, 4); // This line gives me errors
/*...*/
return(0);
}
编译器输出:
14:07:09: Running steps for project EZDraft...
14:07:09: Configuration unchanged, skipping qmake step.
14:07:09: Starting: "C:\mingw\bin\mingw32-make.exe"
C:/mingw/bin/mingw32-make -f Makefile.Release
mingw32-make[1]: Entering directory `C:/Qt/Qt5.0.0/Tools/QtCreator/bin/EZDraft-build-Unnamed_Microsoft_Windows_SDK_for_Windows_7_7_1_7600_0_30514_x86-Default_build_Debug'
g++ -static-libgcc -static-libstdc++ -static-libgcc -Wl,-s -Wl,-subsystem,windows -o release\PanelDraw.exe object_script.PanelDraw.Release -L"c:\Users\Abhishek\Downloads\qt-everywhere-opensource-src-4.8.4\qt-everywhere-opensource-src-4.8.4\lib" -lmingw32 -lqtmain release\myicon_res.o -LC:/Qt/Qt5.0.0/Tools/QtCreator/bin/EZDraft_10_09_2013/../../../../../../Users/Abhishek/Downloads/lp_solve_5.5.2.0_dev_win32/ -lliblpsolve55 -LC:/Qt/Qt5.0.0/Tools/QtCreator/bin/EZDraft_10_09_2013/../../../../../../Users/Abhishek/Downloads/lp_solve_5.5.2.0_dev_win32/ -llpsolve55 -lQtGui -lQtNetwork -lgdi32 -lcomdlg32 -loleaut32 -limm32 -lwinmm -lwinspool -lmsimg32 -lQtCore -lole32 -luuid -lws2_32 -ladvapi32 -lshell32 -luser32 -lkernel32
Warning: .drectve `-defaultlib:uuid.lib ' unrecognized
Warning: .drectve `-defaultlib:uuid.lib ' unrecognized
Warning: .drectve `-defaultlib:LIBCMT ' unrecognized
Warning: .drectve `-defaultlib:OLDNAMES ' unrecognized
Warning: .drectve `-defaultlib:uuid.lib ' unrecognized
Warning: .drectve `-defaultlib:uuid.lib ' unrecognized
Warning: .drectve `-defaultlib:LIBCMT ' unrecognized
Warning: .drectve `-defaultlib:OLDNAMES ' unrecognized
Warning: .drectve `-defaultlib:uuid.lib ' unrecognized
Warning: .drectve `-defaultlib:uuid.lib ' unrecognized
Warning: .drectve `-defaultlib:LIBCMT ' unrecognized
Warning: .drectve `-defaultlib:OLDNAMES ' unrecognized
Warning: .drectve `-defaultlib:uuid.lib ' unrecognized
Warning: .drectve `-defaultlib:uuid.lib ' unrecognized
Warning: .drectve `-defaultlib:LIBCMT ' unrecognized
Warning: .drectve `-defaultlib:OLDNAMES ' unrecognized
Warning: .drectve `-defaultlib:uuid.lib ' unrecognized
Warning: .drectve `-defaultlib:uuid.lib ' unrecognized
Warning: .drectve `-defaultlib:LIBCMT ' unrecognized
Warning: .drectve `-defaultlib:OLDNAMES ' unrecognized
Warning: .drectve `-defaultlib:uuid.lib ' unrecognized
Warning: .drectve `-defaultlib:uuid.lib ' unrecognized
Warning: .drectve `-defaultlib:LIBCMT ' unrecognized
Warning: .drectve `-defaultlib:OLDNAMES ' unrecognized
Warning: .drectve `-defaultlib:uuid.lib ' unrecognized
Warning: .drectve `-defaultlib:uuid.lib ' unrecognized
Warning: .drectve `-defaultlib:LIBCMT ' unrecognized
Warning: .drectve `-defaultlib:OLDNAMES ' unrecognized
Warning: .drectve `-defaultlib:uuid.lib ' unrecognized
Warning: .drectve `-defaultlib:uuid.lib ' unrecognized
Warning: .drectve `-defaultlib:LIBCMT ' unrecognized
Warning: .drectve `-defaultlib:OLDNAMES ' unrecognized
Warning: .drectve `-defaultlib:uuid.lib ' unrecognized
Warning: .drectve `-defaultlib:uuid.lib ' unrecognized
Warning: .drectve `-defaultlib:LIBCMT ' unrecognized
Warning: .drectve `-defaultlib:OLDNAMES ' unrecognized
Warning: .drectve `-defaultlib:uuid.lib ' unrecognized
Warning: .drectve `-defaultlib:uuid.lib ' unrecognized
Warning: .drectve `-defaultlib:LIBCMT ' unrecognized
Warning: .drectve `-defaultlib:OLDNAMES ' unrecognized
Warning: .drectve `-defaultlib:uuid.lib ' unrecognized
Warning: .drectve `-defaultlib:uuid.lib ' unrecognized
Warning: .drectve `-defaultlib:LIBCMT ' unrecognized
Warning: .drectve `-defaultlib:OLDNAMES ' unrecognized
Warning: .drectve `-defaultlib:uuid.lib ' unrecognized
Warning: .drectve `-defaultlib:uuid.lib ' unrecognized
Warning: .drectve `-defaultlib:LIBCMT ' unrecognized
Warning: .drectve `-defaultlib:OLDNAMES ' unrecognized
Warning: .drectve `-defaultlib:uuid.lib ' unrecognized
Warning: .drectve `-defaultlib:uuid.lib ' unrecognized
Warning: .drectve `-defaultlib:LIBCMT ' unrecognized
Warning: .drectve `-defaultlib:OLDNAMES ' unrecognized
Warning: .drectve `-defaultlib:uuid.lib ' unrecognized
Warning: .drectve `-defaultlib:uuid.lib ' unrecognized
Warning: .drectve `-defaultlib:LIBCMT ' unrecognized
Warning: .drectve `-defaultlib:OLDNAMES ' unrecognized
Warning: .drectve `-defaultlib:uuid.lib ' unrecognized
Warning: .drectve `-defaultlib:uuid.lib ' unrecognized
Warning: .drectve `-defaultlib:LIBCMT ' unrecognized
Warning: .drectve `-defaultlib:OLDNAMES ' unrecognized
Warning: .drectve `-defaultlib:uuid.lib ' unrecognized
Warning: .drectve `-defaultlib:uuid.lib ' unrecognized
Warning: .drectve `-defaultlib:LIBCMT ' unrecognized
Warning: .drectve `-defaultlib:OLDNAMES ' unrecognized
Warning: .drectve `-defaultlib:uuid.lib ' unrecognized
Warning: .drectve `-defaultlib:uuid.lib ' unrecognized
Warning: .drectve `-defaultlib:LIBCMT ' unrecognized
Warning: .drectve `-defaultlib:OLDNAMES ' unrecognized
Warning: .drectve `-defaultlib:uuid.lib ' unrecognized
Warning: .drectve `-defaultlib:uuid.lib ' unrecognized
Warning: .drectve `-defaultlib:LIBCMT ' unrecognized
Warning: .drectve `-defaultlib:OLDNAMES ' unrecognized
Warning: .drectve `-defaultlib:uuid.lib ' unrecognized
Warning: .drectve `-defaultlib:uuid.lib ' unrecognized
Warning: .drectve `-defaultlib:LIBCMT ' unrecognized
Warning: .drectve `-defaultlib:OLDNAMES ' unrecognized
Warning: .drectve `-defaultlib:uuid.lib ' unrecognized
Warning: .drectve `-defaultlib:uuid.lib ' unrecognized
Warning: .drectve `-defaultlib:LIBCMT ' unrecognized
Warning: .drectve `-defaultlib:OLDNAMES ' unrecognized
Warning: .drectve `-defaultlib:LIBCMT ' unrecognized
Warning: .drectve `-defaultlib:OLDNAMES ' unrecognized
Warning: .drectve `-defaultlib:uuid.lib ' unrecognized
Warning: .drectve `-defaultlib:uuid.lib ' unrecognized
Warning: .drectve `-defaultlib:LIBCMT ' unrecognized
Warning: .drectve `-defaultlib:OLDNAMES ' unrecognized
Warning: .drectve `-defaultlib:LIBCMT ' unrecognized
Warning: .drectve `-defaultlib:OLDNAMES ' unrecognized
Warning: .drectve `-defaultlib:uuid.lib ' unrecognized
Warning: .drectve `-defaultlib:uuid.lib ' unrecognized
Warning: .drectve `-defaultlib:LIBCMT ' unrecognized
Warning: .drectve `-defaultlib:OLDNAMES ' unrecognized
Warning: .drectve `-defaultlib:uuid.lib ' unrecognized
Warning: .drectve `-defaultlib:uuid.lib ' unrecognized
Warning: .drectve `-defaultlib:LIBCMT ' unrecognized
Warning: .drectve `-defaultlib:OLDNAMES ' unrecognized
Warning: .drectve `-defaultlib:uuid.lib ' unrecognized
Warning: .drectve `-defaultlib:uuid.lib ' unrecognized
Warning: .drectve `-defaultlib:LIBCMT ' unrecognized
Warning: .drectve `-defaultlib:OLDNAMES ' unrecognized
C:/Qt/Qt5.0.0/Tools/QtCreator/bin/EZDraft_10_09_2013/../../../../../../Users/Abhishek/Downloads/lp_solve_5.5.2.0_dev_win32//liblpsolve55.lib(lp_lib.obj):../lp_lib.c:(.text[_performiteration]+0x46f): undefined reference to `_allrem'
C:/Qt/Qt5.0.0/Tools/QtCreator/bin/EZDraft_10_09_2013/../../../../../../Users/Abhishek/Downloads/lp_solve_5.5.2.0_dev_win32//liblpsolve55.lib(commonlib.obj):../shared/commonli:(.text[_gcd]+0xac): undefined reference to `_alldiv'
C:/Qt/Qt5.0.0/Tools/QtCreator/bin/EZDraft_10_09_2013/../../../../../../Users/Abhishek/Downloads/lp_solve_5.5.2.0_dev_win32//liblpsolve55.lib(commonlib.obj):../shared/commonli:(.text[_gcd]+0xb9): undefined reference to `_allmul'
C:/Qt/Qt5.0.0/Tools/QtCreator/bin/EZDraft_10_09_2013/../../../../../../Users/Abhishek/Downloads/lp_solve_5.5.2.0_dev_win32//liblpsolve55.lib(lp_MPS.obj):../lp_MPS.c:(.text[_MPS_readex@20]+0xc): undefined reference to `_chkstk'
C:/Qt/Qt5.0.0/Tools/QtCreator/bin/EZDraft_10_09_2013/../../../../../../Users/Abhishek/Downloads/lp_solve_5.5.2.0_dev_win32//liblpsolve55.lib(lp_utils.obj):../lp_utils.c:(.text[_roundToPrecision]+0xd1): undefined reference to `_allmul'
C:/Qt/Qt5.0.0/Tools/QtCreator/bin/EZDraft_10_09_2013/../../../../../../Users/Abhishek/Downloads/lp_solve_5.5.2.0_dev_win32//liblpsolve55.lib(lp_price.obj):../lp_price.c:(.text[_makePriceLoop]+0x2e): undefined reference to `_allrem'
C:/Qt/Qt5.0.0/Tools/QtCreator/bin/EZDraft_10_09_2013/../../../../../../Users/Abhishek/Downloads/lp_solve_5.5.2.0_dev_win32//liblpsolve55.lib(lp_params.obj):../lp_params.c:(.text[_write_params@12]+0x6): undefined reference to `_chkstk'
C:/Qt/Qt5.0.0/Tools/QtCreator/bin/EZDraft_10_09_2013/../../../../../../Users/Abhishek/Downloads/lp_solve_5.5.2.0_dev_win32//liblpsolve55.lib(lp_params.obj):../lp_params.c:(.text[_write_params1]+0x6): undefined reference to `_chkstk'
C:/Qt/Qt5.0.0/Tools/QtCreator/bin/EZDraft_10_09_2013/../../../../../../Users/Abhishek/Downloads/lp_solve_5.5.2.0_dev_win32//liblpsolve55.lib(lp_params.obj):../lp_params.c:(.text[_read_params@12]+0x6): undefined reference to `_chkstk'
collect2: ld returned 1 exit status
mingw32-make[1]: *** [release\PanelDraw.exe] Error 1
mingw32-make[1]: Leaving directory `C:/Qt/Qt5.0.0/Tools/QtCreator/bin/EZDraft-build-Unnamed_Microsoft_Windows_SDK_for_Windows_7_7_1_7600_0_30514_x86-Default_build_Debug'
mingw32-make: *** [release] Error 2
14:07:15: The process "C:\mingw\bin\mingw32-make.exe" exited with code 2.
Error while building/deploying project EZDraft (kit: Unnamed-Microsoft Windows SDK for Windows 7 (7.1.7600.0.30514) (x86))
When executing step 'Make'
任何关于我如何解决上述错误的指导都将非常有帮助。我已经用谷歌搜索了上述错误,但我无法得到解决方案。
谢谢