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

Dynamic library cannot be used #103

Open
aszswaz opened this issue Sep 1, 2021 · 3 comments
Open

Dynamic library cannot be used #103

aszswaz opened this issue Sep 1, 2021 · 3 comments

Comments

@aszswaz
Copy link

aszswaz commented Sep 1, 2021

This is my CMakeList.

cmake_minimum_required(VERSION 3.20)
project(easyexcel C)

set(CMAKE_C_STANDARD 99)

find_package(PkgConfig)
set(ENV{PKG_CONFIG_PATH} /usr/local/lib/pkgconfig)
pkg_check_modules(XLSXIO_READ REQUIRED libxlsxio_read)
message(XLSXIO_READ_INCLUDE_DIRS: ${XLSXIO_READ_INCLUDE_DIRS})
message(XLSXIO_READ_LIBRARIES: ${XLSXIO_READ_LIBRARIES})

include_directories(${XLSXIO_READ_INCLUDE_DIRS})
link_directories(${XLSXIO_READ_LIBRARIES})

add_executable(${PROJECT_NAME} main.c)
target_link_libraries(${PROJECT_NAME} xlsxio_read xlsxio_write)

This is cmake build information.

XLSXIO_READ_INCLUDE_DIRS:/usr/local/include
XLSXIO_READ_LIBRARIES:xlsxio_readminizipzexpat
-- Configuring done
-- Generating done
-- Build files have been written to: /home/aszswaz/project/CLionProjects/easyexcel/cmake-build-debug

This is the program error log.

/home/aszswaz/project/CLionProjects/easyexcel/cmake-build-debug/easyexcel: error while loading shared libraries: libxlsxio_read.so: cannot open shared object file: No such file or directory

xlsxio按照默认的配置安装在 /usr/local/lib,How do I solve this problem?

@brechtsanders
Copy link
Owner

Have you tried with the latest changes made to master for #101 ?

@aszswaz
Copy link
Author

aszswaz commented Sep 2, 2021

Have you tried with the latest changes made to master for #101 ?

I tried it, but it is still the same. Compilation can be completed. Once the program is run, the dynamic library cannot be used.

@brechtsanders
Copy link
Owner

If it compiles that's already good.
Is everything in place for dependency shared libraries to be found?
Can you give more information about: operating system, exact output / errors?

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