I have a c++ method on .so lib that receive a number and return "hello world". Then how can i import it on other c++ project on cMakeList and call on main.cpp. but i have a doubt how can i inform a compiler that .hpp methods declarated was implemented on .so lib. tried to include .so lib on cMakeList and created .h file that declared a function that receive a number and return a string. I having this issue undefined reference to
Asked
Active
Viewed 29 times
0
-
1"I having this issue undefined reference to" - That is, something wrong with your `.so` file or with the header file. You need to add your **code** into the question post. Otherwise we simply cannot help you. – Tsyvarev Jul 11 '23 at 16:27
-
Could also be something wrong with your CMakeLists.txt however since we can't see it we can't fix the issue. – drescherjm Jul 11 '23 at 16:32
1 Answers
0
You can create a library with CMake, then you install it somewhere or make it available on an artifact repository / server, then you can use it with CMake by providing its location and using find_package
in the consuming project.

David
- 93
- 2
- 7