February 18, 2011

rootshell rootshell
Lab Rat
35 posts

Build QtCreator with Mingw - undefined references

 

Hello,

I was hoping that someone would be kind enough to give me guidance as searching the forums and google did not seem to produce any real results…

Downloaded QtCreator for windows and was doing great until I tried to make my own plugin, then I got the dreaded:

Expected build key “Windows msvc release full-config” got “Windows mingw release full-config”

A search told me that the cause is QtCreator was compiled with Visual Studio, and I would need to build QtCreator with Mingw. So I downloaded the source and followed the directions, the Mingw32-Make command spit out : undefined references

Below is the command and the last few lines of the output.

  1. C:\Qt\2010.05\qt\bin\qmake.exe C:\QtCreator\Source\qtcreator.pro
  2. C:\Qt\2010.05\mingw\bin\mingw32-make.exe
  3.  
  4. ...serveral hundred lines of output later...
  5.  
  6. g++ -c -g -frtti -fexceptions -mthreads -Wall -DUNICODE -DQT_LARGEFILE_SUPPORT -
  7. DQMLJS_BUILD_DIR -DQT_CREATOR -DIDE_LIBRARY_BASENAME=\"lib\" -DWITH_TESTS -DQT_N
  8. O_CAST_TO_ASCII -DQT_USE_FAST_OPERATOR_PLUS -DQT_USE_FAST_CONCATENATION -DQMLJS_
  9. BUILD_DIR -DQT_DLL -DQT_TESTLIB_LIB -DQT_GUI_LIB -DQT_CORE_LIB -DQT_THREAD_SUPPO
  10. RT -I"c:\Qt\2010.05\qt\include\QtCore" -I"c:\Qt\2010.05\qt\include\QtGui" -I"c:\
  11. Qt\2010.05\qt\include\QtTest" -I"c:\Qt\2010.05\qt\include" -I"..\..\..\..\Source
  12. \src\libs" -I"c:\QtCreator\Source\tools" -I"..\..\..\..\Source\src\libs\qmljs\pa
  13. rser" -I"..\..\..\..\Source\src\libs" -I"c:\Qt\2010.05\qt\include\ActiveQt" -I"d
  14. ebug" -I"..\..\..\..\Source\src\libs\qmljs" -I"." -I"c:\Qt\2010.05\qt\mkspecs\de
  15. fault" -o debug\moc_qmljsicontextpane.o debug\moc_qmljsicontextpane.cpp
  16. g++ -enable-stdcall-fixup -Wl,-enable-auto-import -Wl,-enable-runtime-pseudo-rel
  17. oc -shared -mthreads -Wl -Wl,--out-implib,c:\QtCreator\Build\lib\qtcreator\libQm
  18. lJSd.a -o ..\..\..\lib\qtcreator\QmlJSd.dll object_script.QmlJSd.Debug  -L"c:\Qt
  19. \2010.05\qt\lib" -LC:/QtCreator/Build/lib/qtcreator -lUtilsd -lQtTestd4 -lQtGuid
  20. 4 -lQtCored4
  21. Creating library file: c:\QtCreator\Build\lib\qtcreator\libQmlJSd.a
  22. ./debug\qmljsrewriter.o:C:\QtCreator\Build\src\libs\qmljs/../../../../Source/src
  23. /libs/qmljs/qmljsrewriter.cpp:131: undefined reference to `_imp___ZN5Utils9Chang
  24. eSet7replaceEiiRK7QString'
  25. ./debug\qmljsrewriter.o:C:\QtCreator\Build\src\libs\qmljs/../../../../Source/src
  26. /libs/qmljs/qmljsrewriter.cpp:305: undefined reference to `_imp___ZN5Utils9Chang
  27. eSet7replaceEiiRK7QString'
  28. ./debug\qmljsrewriter.o:C:\QtCreator\Build\src\libs\qmljs/../../../../Source/src
  29. /libs/qmljs/qmljsrewriter.cpp:346: undefined reference to `_imp___ZN5Utils9Chang
  30. eSet7replaceEiiRK7QString'
  31. ./debug\qmljsrewriter.o:C:\QtCreator\Build\src\libs\qmljs/../../../../Source/src
  32. /libs/qmljs/qmljsrewriter.cpp:409: undefined reference to `_imp___ZN5Utils9Chang
  33. eSet7replaceEiiRK7QString'
  34. ./debug\qmljsrewriter.o:C:\QtCreator\Build\src\libs\qmljs/../../../../Source/src
  35. /libs/qmljs/qmljsrewriter.cpp:561: undefined reference to `_imp___ZN5Utils9Chang
  36. eSet7replaceEiiRK7QString'
  37. ./debug\qmljsrewriter.o:C:\QtCreator\Build\src\libs\qmljs/../../../../Source/src
  38. /libs/qmljs/qmljsrewriter.cpp:578: more undefined references to `_imp___ZN5Utils
  39. 9ChangeSet7replaceEiiRK7QString' follow
  40. collect2: ld returned 1 exit status
  41. mingw32-make[4]: *** [..\..\..\lib\qtcreator\QmlJSd.dll] Error 1
  42. mingw32-make[4]: Leaving directory `C:/QtCreator/Build/src/libs/qmljs'
  43. mingw32-make[3]: *** [debug] Error 2
  44. mingw32-make[3]: Leaving directory `C:/QtCreator/Build/src/libs/qmljs'
  45. mingw32-make[2]: *** [sub-qmljs-make_default-ordered] Error 2
  46. mingw32-make[2]: Leaving directory `C:/QtCreator/Build/src/libs'
  47. mingw32-make[1]: *** [sub-libs-make_default-ordered] Error 2
  48. mingw32-make[1]: Leaving directory `C:/QtCreator/Build/src'
  49. mingw32-make: *** [sub-src-make_default-ordered] Error 2

I am somewhat new to this, seems like it is having an issue linking, any ideas?

As a side note, it would be awesome if QtCreator was built with Mingw so this process was seemless, or give us an option in the appliction to load all plugins regardless of what they were compiled with…but regardless I am very grateful to have QtCreator :)

 Signature 

Certifications: CISSP, MCITP, MCSE, MCSA, BA, AA, AG, CST, CNST, Linux+, Security+, Server+, Network+, A+, iNet+

Languages: C++, C#, VB, Python, Java

3 replies

February 19, 2011

rootshell rootshell
Lab Rat
35 posts

as a side note, I dual boot Kubuntu Linux and Windows 7 – this works great on linux (QtCreator was compiled with Mingw in linux) but for some reason it was compiled in visual studio for the windows distribution.

 Signature 

Certifications: CISSP, MCITP, MCSE, MCSA, BA, AA, AG, CST, CNST, Linux+, Security+, Server+, Network+, A+, iNet+

Languages: C++, C#, VB, Python, Java

February 20, 2011

Tobias Hunger Tobias Hunger
Mad Scientist
3383 posts

How am I supposed to understand that last comment? Did you cross-compile Qt Creator for Windows on a Linux box?

The Linux version of Qt Creator we ship is build with gcc, not mingw… that is why I am confused:-)

February 22, 2011

rootshell rootshell
Lab Rat
35 posts
Tobias Hunger wrote:
How am I supposed to understand that last comment? Did you cross-compile Qt Creator for Windows on a Linux box? The Linux version of Qt Creator we ship is build with gcc, not mingw… that is why I am confused:-)

Sorry let me clarify…

I have a dual boot machine, Kubuntu Linux and Windows 7.

In Linux downloaded from the repositories.
In windows, I downloaded from the Qt web site.

The windows version of Qt Creator was compiled with Visual Studio, but ships with Mingw. So when you attempt to create your own plugin, the plugin will not load with a message of:

Expected build key “Windows msvc release full-config” got “Windows mingw release full-config”

So I tried (on windows) to download the QtCreator source and compile with Mingw, but I am getting the errors mentioned in the original post.

All I was saying is that custom plugins work perfectly in Linux because QtCreator was compiled with the same compiler, Windows however is compiled with VS, and QTCreator uses a different compiler, so plugins will not load.

Is there a way to bypass the plugin signature checking without a compiling QtCreator? (Perhaps a argument or option I missed?)

 Signature 

Certifications: CISSP, MCITP, MCSE, MCSA, BA, AA, AG, CST, CNST, Linux+, Security+, Server+, Network+, A+, iNet+

Languages: C++, C#, VB, Python, Java

 
  ‹‹ Switching Projects Easily      QtCreator -- Making Qt Creator find other sources when using Signals/Slots, and deploying for Win.. ››

You must log in to post a reply. Not a member yet? Register here!