Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

unresolved symbols building with MinGW-w64 make.exe #1

Closed
bonhamp opened this issue Dec 29, 2018 · 3 comments
Closed

unresolved symbols building with MinGW-w64 make.exe #1

bonhamp opened this issue Dec 29, 2018 · 3 comments

Comments

@bonhamp
Copy link

bonhamp commented Dec 29, 2018

Getting all your source tree and opening up your CMakeLists.txt file in Qt Creator v4.7.1, and specifying a kit for MinGW-w64,

  • the CMake parsing succeeds
  • the make fails with following unresolved symbols:
    16:21:33: Running steps for project Project...
    16:21:33: Starting: "C:\Program Files\CMake\bin\cmake.exe" --build . --target all
    [ 16%] Automatic MOC and UIC for target MinimalQml
    [ 16%] Built target MinimalQml_autogen
    [ 33%] Linking CXX executable MinimalQml.exe
    CMakeFiles\MinimalQml.dir/objects.a(main.cpp.obj):main.cpp:(.text$_ZN7QStringD1Ev[_ZN7QStringD1Ev]+0x26): undefined reference to __imp__ZN10QArrayData10deallocateEPS_yy' CMakeFiles\MinimalQml.dir/objects.a(main.cpp.obj):main.cpp:(.text.startup+0x39): undefined reference to __imp__ZN12QApplicationC1ERiPPci'
    CMakeFiles\MinimalQml.dir/objects.a(main.cpp.obj):main.cpp:(.text.startup+0x44): undefined reference to __imp__ZN21QQmlApplicationEngineC1EP7QObject' CMakeFiles\MinimalQml.dir/objects.a(main.cpp.obj):main.cpp:(.text.startup+0x69): undefined reference to __imp__ZN4QUrlC1ERK7QStringNS_11ParsingModeE'
    CMakeFiles\MinimalQml.dir/objects.a(main.cpp.obj):main.cpp:(.text.startup+0x75): undefined reference to __imp__ZN21QQmlApplicationEngine4loadERK4QUrl' CMakeFiles\MinimalQml.dir/objects.a(main.cpp.obj):main.cpp:(.text.startup+0x7e): undefined reference to __imp__ZN4QUrlD1Ev'
    CMakeFiles\MinimalQml.dir/objects.a(main.cpp.obj):main.cpp:(.text.startup+0x8c): undefined reference to __imp__ZN12QApplication4execEv' CMakeFiles\MinimalQml.dir/objects.a(main.cpp.obj):main.cpp:(.text.startup+0x97): undefined reference to __imp__ZN21QQmlApplicationEngineD1Ev'
    CMakeFiles\MinimalQml.dir/objects.a(main.cpp.obj):main.cpp:(.text.startup+0xa0): undefined reference to __imp__ZN12QApplicationD1Ev' CMakeFiles\MinimalQml.dir/objects.a(main.cpp.obj):main.cpp:(.text.startup+0xb9): undefined reference to __imp__ZN12QApplicationD1Ev'
    CMakeFiles\MinimalQml.dir/objects.a(main.cpp.obj):main.cpp:(.text.startup+0xcd): undefined reference to __imp__ZN21QQmlApplicationEngineD1Ev' CMakeFiles\MinimalQml.dir/objects.a(main.cpp.obj):main.cpp:(.text.startup+0xdb): undefined reference to __imp__ZN4QUrlD1Ev'
    CMakeFiles\MinimalQml.dir/objects.a(qrc_qml.cpp.obj):qrc_qml.cpp:(.text+0x3f): undefined reference to qRegisterResourceData(int, unsigned char const*, unsigned char const*, unsigned char const*)' CMakeFiles\MinimalQml.dir/objects.a(qrc_qml.cpp.obj):qrc_qml.cpp:(.text+0x6f): undefined reference to qUnregisterResourceData(int, unsigned char const*, unsigned char const*, unsigned char const*)'
    CMakeFiles\MinimalQml.dir/objects.a(qrc_qml.cpp.obj):qrc_qml.cpp:(.text+0x1b): undefined reference to qUnregisterResourceData(int, unsigned char const*, unsigned char const*, unsigned char const*)' CMakeFiles\MinimalQml.dir/objects.a(qrc_qml.cpp.obj):qrc_qml.cpp:(.text.startup+0x1f): undefined reference to qRegisterResourceData(int, unsigned char const*, unsigned char const*, unsigned char const*)'
    collect2.exe: error: ld returned 1 exit status
    mingw32-make.exe[2]: *** [src\CMakeFiles\MinimalQml.dir\build.make:129: src/MinimalQml.exe] Error 1
    mingw32-make.exe[1]: *** [CMakeFiles\Makefile2:91: src/CMakeFiles/MinimalQml.dir/all] Error 2
    mingw32-make.exe: *** [Makefile:83: all] Error 2
    16:21:34: The process "C:\Program Files\CMake\bin\cmake.exe" exited with code 2.
@Postrediori
Copy link
Collaborator

Hi!

Those messages show that CMake paths for Qt/MinGW are mis-configured. Could you specify the way you installed Qt/MinGW and the versions you are using?

I tried to compile the project with CMake 3.13.2 with Qt 5.12.0/Qt Creator 4.8.0/MinGW 7.3.0 from the official bundle and build completes fine.

1

@bonhamp
Copy link
Author

bonhamp commented Dec 31, 2018 via email

@Postrediori
Copy link
Collaborator

Hi,

Thanks for your clarification. I'm surprised that Qt Team doesn't distribute x64 libraries for MinGW, since they are shipping libraries to a number of platforms hence the 'cross-platform framework'.

I'll close this issue then. There are instructions for Windows that I plan to commit soon and I think the information about x64 MinGW is worth to be added there.

Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants