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

undefined reference to `__imp__ZN12QSqlDatabaseC1Ev' #2

Open
xiongmingzhi opened this issue Mar 5, 2022 · 0 comments
Open

undefined reference to `__imp__ZN12QSqlDatabaseC1Ev' #2

xiongmingzhi opened this issue Mar 5, 2022 · 0 comments

Comments

@xiongmingzhi
Copy link

xiongmingzhi commented Mar 5, 2022

CMakelist:
**CMAKE_MINIMUM_REQUIRED(VERSION 3.16)
set(CMAKE_CXX_STANDARD )
project(SQLite)

set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTOUIC ON)
include_directories(${PROJECT_SOURCE_DIR})
set(CMAKE_PREFIX_PATH D:/Qt/Qt5.9.9/5.9.9/msvc2015/lib/cmake)
set(Qt5Sql_DIR D:/Qt/Qt5.9.9/5.9.9/msvc2015/lib/cmake/Qt5Sql)
set(Qt5Widgets_DIR D:/Qt/Qt5.9.9/5.9.9/msvc2015/lib/cmake/Qt5Widgets)
set(Qt5Multimedia_DIR /D:/Qt/Qt5.9.9/5.9.9/msvc2015/lib/cmake/Qt5Multimedia)
set(Qt5MultimediaWidgets_DIR D:/Qt/Qt5.9.9/5.9.9/msvc2015/lib/cmake/Qt5MultimediaWidgets)
find_package(Qt5 COMPONENTS Multimedia MultimediaWidgets Widgets Sql REQUIRED)
aux_source_directory(. SQLite_DIR)
add_executable(${PROJECT_NAME} ${SQLite_DIR})
target_include_directories(${PROJECT_NAME} PUBLIC ${PROJECT_SOURCE_DIR})
target_link_libraries(${PROJECT_NAME} Qt5::Widgets Qt5::Multimedia Qt5::Sql)

I have add Sql in CMakeList, Code compilation can be passed, and error is reported during operation,it have a error that * undefined reference to `__imp__ZN12QSqlDatabaseC1Ev'*,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

1 participant