Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to access third party C++ library installed on a docker container?

Tags:

c++

docker

clion

I am using CLion as my C++ IDE on a Mac. I am running Ubuntu image on docker. I am compiling and remote debugging on the container.

Here's my problem: I have installed (say) libxyz on the image using apt-get install. I have the header files under usual /usr/include and the static library under /usr/lib. I can compile, link and debug ... all good. But when I include the header xyz.h, IDE (CLion in my case) cannot understand where that file is as it has no knowledge of the installed library on the container. So my code completion/intellisense does not work and I see the annoying red squiggly line.

Is there a way to solve this issue without building the library from source? I prefer not to have third party source under my project.

Appreciate any help. Thanks!

like image 937
user3718192 Avatar asked Jan 31 '26 17:01

user3718192


1 Answers

Found the solution, posting the answer just in case someone needs it. Click on Tools -> Resync with Remote Hosts Or Set the clion.remote.resync.system.cache key in the Registry (go to Help | Find Action or press ⇧⌘A, type Registry, and search for the key by name). This was suggested in https://www.jetbrains.com/help/clion/remote-projects-support.html

like image 167
user3718192 Avatar answered Feb 02 '26 07:02

user3718192



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!