Adding a library to C++

I’m new to Replit and C++ and I want to try to execute a simple C++ script (generated by ChatGPT) which make use of OpenCL library.
I can’t find a “Package” section where I can add the OpenCL library while in “C++” mode.
How can I add the OpenCL library so that my script executes?

Hey @DiegoSala1 welcome to the forums!

You can either use the install command in the shell or under tools on the bottom left you can open the packages tab and install it through the UI there.

1 Like

In “Tools”, in a C++ project, I only see:
Docs
Chat
Threads
Git
Debugger
Shell
Console
Secrets
Database
Markdown
Settings

1 Like

Run in shell:

sed -i -e 's/}$/  env = {\n    CPLUS_INCLUDE_PATH = "${pkgs.opencl-clhpp}\/include";\n  };\n&/' -e 's/];/  pkgs.opencl-headers\n  &/' replit.nix
#include <CL/cl2.hpp>
2 Likes

I think I’ll give up because I don’t know C++ and it’s becoming more complex than I though…

Thanks anyway for your help!