0

I have build ngspice, add move builded folder to my project and use it.

If I try to build it with CMake but have such errors:

/home/game/Downloads/untitled5/main.cpp:50: undefined reference to `dlopen'
/usr/bin/ld: /home/game/Downloads/untitled5/main.cpp:53: undefined reference to `dlsym'
/usr/bin/ld: /home/game/Downloads/untitled5/main.cpp:54: undefined reference to `dlsym'
/usr/bin/ld: /home/game/Downloads/untitled5/main.cpp:55: undefined reference to `dlsym'
/usr/bin/ld: /home/game/Downloads/untitled5/main.cpp:56: undefined reference to `dlsym'
/usr/bin/ld: /home/game/Downloads/untitled5/main.cpp:57: undefined reference to `dlsym'

but when I build from termianl g++ -o untitled5 main.cpp -ldl there is no problem. Here is PATH to ngspice .so /home/game/Downloads/untitled5/ngspice-37/src/.libs/libngspice.so

My CMake:

cmake_minimum_required(VERSION 3.21)
project(untitled5)

set(CMAKE_CXX_STANDARD 17)

link_directories(${CMAKE_BINARY_DIR}/ngspice-37/src/.libs)

add_executable(untitled5 main.cpp)
target_link_libraries(untitled5 ngspice)

Maybe anyone have idea how to link this .so to my app?

Lumar
  • 1

0 Answers0