简体   繁体   中英

How to compile QT examples with QT creator and visual studio 2012 compiler?

I used the following configure options and commands to build qt5.5:

configure -developer-build -opensource -confirm-license -platform win32-msvc2013 -opengl desktop -nomake examples -nomake tests nmake

QT is built successfully. After this, I installed QT creator 3.4.0 beta and configured qmake for qt5.5 and using Microsoft Visual studio C++ compiler 12.0 . Now when i try to build the qt3D examples using the QT creator, I am getting the following compile errors:

cpp.exe.2968.1625.jom qtmain.lib(qtmain_win.obj) : error LNK2019: unresolved external symbol __imp__CommandLineToArgvW@8 referenced in function _WinMain@16 release\\cylinder-cpp.exe : fatal error LNK1120: 1 unresolved externals jom: C:\\qt5.5\\build-qt3d-Desktop-Release\\examples\\cylinder-cpp\\Makefile.Release [release\\cylinder-cpp.exe] Error 1120 jom: C:\\qt5.5\\build-qt3d-Desktop-Release\\examples\\cylinder-cpp\\Makefile [release] Error 2 12:57:27: The process "C:\\Qt\\qtcreator-3.3.81\\bin\\jom.exe" exited with code 2. Error while building/deploying project qt3d (kit: Desktop) When executing step "Make" 12:57:27: Elapsed time: 00:03.

I understand that this error is because of winmain function missing which is required by visual studio compiler for any windows applications, However how does qt take care of it? What are the header files to be included to avoid this error for qt examples? Please help me with your suggstions and let me know if I am missing any steps also.

I had a similar problem - I fixed it by linking Shell32.lib. See this discussion compilation of qt5.5 examples with qt creator with visual studio 2012 (msvc2012) fails for details.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM