Foobar
Foobar

Reputation: 8467

How to use .so library in C++ with Clion and Cmake?

There is a question about this already, but the asker was either doing some more complicated then me, or the posted answer assumed too much background knowledge for me to understand.

I am trying to use the following library: https://github.com/samehkamaleldin/socket.cpp .

I downloaded the library from github and built it. I then placed the resulting .so file in the same directory as main.cpp, like this:

Screenshot

However, I'm not sure what to do from here, from my research, I need to use the command target_link_libraries, but I'm not sure what to pass in for each parameter.

Upvotes: 2

Views: 2562

Answers (1)

J-Christophe
J-Christophe

Reputation: 2060

In order to use the library, there are few approaches, I suggest you read this post: Correct way to use third-party libraries in cmake project

Upvotes: 1

Related Questions