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

how to build it? #55

Open
xiaolong2104 opened this issue Jun 27, 2020 · 0 comments
Open

how to build it? #55

xiaolong2104 opened this issue Jun 27, 2020 · 0 comments

Comments

@xiaolong2104
Copy link

excuse me ?
how to build it on windows with cmake ?
thank you very much!!!!
I use cmake-gui to generate makfile but when i make it. It seems can not find qt *.a such as below....

[ 4%] Built target jcon_autogen
[ 8%] Linking CXX shared library libjcon.dll
CMakeFiles\jcon.dir/objects.a(mocs_compilation.obj):mocs_compilation.cpp:(.text+0x25b): undefined reference to _imp___ZNK11QObjectData17dynamicMetaObjectEv' CMakeFiles\jcon.dir/objects.a(mocs_compilation.obj):mocs_compilation.cpp:(.text+0x2a8): undefined reference to _imp___ZN7QObject11qt_metacastEPKc'
CMakeFiles\jcon.dir/objects.a(mocs_compilation.obj):mocs_compilation.cpp:(.text+0x2d9): undefined reference to _imp___ZN7QObject11qt_metacallEN11QMetaObject4CallEiPPv' CMakeFiles\jcon.dir/objects.a(mocs_compilation.obj):mocs_compilation.cpp:(.text+0x39d): undefined reference to _imp___ZN11QMetaObject8activateEP7QObjectPKS_iPPv'
CMakeFiles\jcon.dir/objects.a(mocs_compilation.obj):mocs_compilation.cpp:(.text+0x3eb): undefined reference to _imp___ZN11QMetaObject8activateEP7QObjectPKS_iPPv' CMakeFiles\jcon.dir/objects.a(mocs_compilation.obj):mocs_compilation.cpp:(.text+0x44e): undefined reference to _imp___ZN11QMetaObject8activateEP7QObjectPKS_iPPv'
CMakeFiles\jcon.dir/objects.a(mocs_compilation.obj):mocs_compilation.cpp:(.text+0x73d): undefined reference to _imp___ZNK11QObjectData17dynamicMetaObjectEv' CMakeFiles\jcon.dir/objects.a(mocs_compilation.obj):mocs_compilation.cpp:(.text+0x78a): undefined reference to _imp___ZN7QObject11qt_metacastEPKc'
CMakeFiles\jcon.dir/objects.a(mocs_compilation.obj):mocs_compilation.cpp:(.text+0x7bb): undefined reference to _imp___ZN7QObject11qt_metacallEN11QMetaObject4CallEiPPv' CMakeFiles\jcon.dir/objects.a(mocs_compilation.obj):mocs_compilation.cpp:(.text+0x894): undefined reference to _imp___ZN11QMetaObject8activateEP7QObjectPKS_iPPv'
CMakeFiles\jcon.dir/objects.a(mocs_compilation.obj):mocs_compilation.cpp:(.text+0x8e3): undefined reference to _imp___ZN11QMetaObject8activateEP7QObjectPKS_iPPv' CMakeFiles\jcon.dir/objects.a(mocs_compilation.obj):mocs_compilation.cpp:(.text+0x931): undefined reference to _imp___ZN11QMetaObject8activateEP7QObjectPKS_iPPv'
CMakeFiles\jcon.dir/objects.a(mocs_compilation.obj):mocs_compilation.cpp:(.text+0x994): undefined reference to `_imp___ZN11QMetaObject8activateEP7QObjectPKS_iPPv'
CMakeFiles\jcon.dir/objects.a(mocs_compilation.obj):mocs_compilation.cp

...............

akeFiles\jcon.dir/objects.a(string_util.obj):string_util.cpp:(.text+0xd): undefined reference to _imp___ZNK8QVariant4typeEv' CMakeFiles\jcon.dir/objects.a(string_util.obj):string_util.cpp:(.text+0x55): undefined reference to _imp___ZNK8QVariant6toListEv'
CMakeFiles\jcon.dir/objects.a(string_util.obj):string_util.cpp:(.text+0xcd): undefined reference to _imp___ZNK8QVariant4typeEv' CMakeFiles\jcon.dir/objects.a(string_util.obj):string_util.cpp:(.text+0x115): undefined reference to _imp___ZNK8QVariant5toMapEv'
CMakeFiles\jcon.dir/objects.a(string_util.obj):string_util.cpp:(.text+0x1a1): undefined reference to _imp___ZNK8QVariant8toStringEv' CMakeFiles\jcon.dir/objects.a(string_util.obj):string_util.cpp:(.text+0x399): undefined reference to _imp___ZN8QVariantD1Ev'
CMakeFiles\jcon.dir/objects.a(string_util.obj):string_util.cpp:(.text+0x3a5): undefined reference to _imp___ZN8QVariantD1Ev' CMakeFiles\jcon.dir/objects.a(string_util.obj):string_util.cpp:(.text+0x3e6): undefined reference to _imp___ZN8QVariantD1Ev'
CMakeFiles\jcon.dir/objects.a(string_util.obj):string_util.cpp:(.text+0x3f6): undefined reference to _imp___ZN8QVariantD1Ev' CMakeFiles\jcon.dir/objects.a(string_util.obj):string_util.cpp:(.text$_ZN5QListI7QStringEC1Ev[__ZN5QListI7QStringEC1Ev]+0x18): undefined reference to _imp___ZN9QListData11shared_nullE'
CMakeFiles\jcon.dir/objects.a(string_util.obj):string_util.cpp:(.text$_ZNK8QVariant10canConvertI7QStringEEbv[__ZNK8QVariant10canConvertI7QStringEEbv]+0x19): undefined reference to _imp___ZNK8QVariant10canConvertEi' CMakeFiles\jcon.dir/objects.a(string_util.obj):string_util.cpp:(.text$_ZN5QListI7QStringE7reserveEi[__ZN5QListI7QStringE7reserveEi]+0x47): undefined reference to _imp___ZN9QListData7reallocEi'
CMakeFiles\jcon.dir/objects.a(string_util.obj):string_util.cpp:(.text$_ZNK8QMapNodeI7QString8QVariantE8nextNodeEv[__ZNK8QMapNodeI7QString8QVariantE8nextNodeEv]+0xf): undefined reference to `_imp___ZNK12QMapNodeBase8nextNodeEv'
collect2.exe: 错误:ld 返回 1
jcon\CMakeFiles\jcon.dir\build.make:364: recipe for target 'jcon/libjcon.dll' failed
mingw32-make[2]: *** [jcon/libjcon.dll] Error 1
CMakeFiles\Makefile2:171: recipe for target 'jcon/CMakeFiles/jcon.dir/all' failed
mingw32-make[1]: *** [jcon/CMakeFiles/jcon.dir/all] Error 2
Makefile:148: recipe for target 'all' failed
mingw32-make: *** [all] Error 2

My cmakelists is

project(jcon)

set(CMAKE_AUTOMOC ON)
set(CMAKE_INCLUDE_CURRENT_DIR ON)

file(GLOB ${PROJECT_NAME}_headers *.h)
file(GLOB ${PROJECT_NAME}_sources *.cpp)

add_definitions(-DJCON_DLL)

add_library(${PROJECT_NAME} SHARED ${${PROJECT_NAME}_headers} ${${PROJECT_NAME}_sources})
set_target_properties(${PROJECT_NAME} PROPERTIES PUBLIC_HEADER "${${PROJECT_NAME}_headers}")

find_package(Qt5 COMPONENTS Core Network WebSockets REQUIRED)
target_link_libraries(${PROJECT_NAME} Qt5::Core Qt5::Network Qt5::WebSockets)

install(TARGETS ${PROJECT_NAME}
RUNTIME DESTINATION bin
LIBRARY DESTINATION lib
PUBLIC_HEADER DESTINATION include/jcon
ARCHIVE DESTINATION lib/static)

can anyone help me?? thank you very much!!!!!

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

1 participant