Include additional libraries in KDevelop

Hello!

I’m using KDevelop version 6.5.260403 (26.04.3) from Flaphub on Debian 13.

Now I’d like to include another library.
It’s the WT library, and I installed it following the instructions.

I downloaded the package to /usr/lib/ and the newly created wt folder.

git clone <https://github.com/emweb/wt.git> wt

  1. Create a build directory

$ cd wt
$ mkdir build
$ cd build

  1. Configure the library

    $ cmake ../

  2. Build the library

    $ make

  3. Install the library (as user with sufficient permissions):

    $ make install

  4. Build the examples

    $ make -C examples

After that, I restarted the computer.

However, KDevelop does not recognize the WT library.

At the same time, I installed the Boost libraries from the package repositories, and they are recognized—as confirmed by the color change when typing.

I suspect I made a mistake during installation.
Can anyone tell me what I’m doing wrong?

What do you mean “does not recoginse the library”? Are you trying to use it in a project, or develop the library itself? Where did you install wt to?

Kdevelop mainly tries to get include paths from the project’s build system. So if you have a working build system set up, it should work.

Sorry for not explaining myself clearly.

I’m talking about syntax highlighting.
When a library, function, or something like that is used, you can tell by the color.

That’s why I noticed that this one isn’t being recognized.
For comparison, when I want to use the Boost library, it’s immediately highlighted in color.

So I must have made a mistake during installation, or I need to manually add the library to KDevelop. I just don’t know how to fix it right now, which is why I’m asking.

I hope I’ve made myself clear.

Regarding development: No, I just want to use the library for programming. I’m not developing it myself.

That means that Wt isn’t in the search path.

Incidentally I also have an experiment using Wt. So I’ll share how I set up my dev env:

in ~/projects/install I create a complete separate hierarchy (let make install create it).
IOW: the installation path is set to ~/projects/install. This is achieved in the configure stage of Wt :
$ cmake ../ -DCMAKE_INSTALL_PREFIX=~/projects/install
Then make install installs it into that directory. This has the advantage of never polluting the system, every single file outside of /home being managed by the package manager.
Most linux distros install into /usr, so you’d have to pass -DCMAKE_INSTALL_PREFIX=/usr for it to be picked up automatically.

I set up my project using cmake, searching for Wt using find_package(wt REQUIRED)

Then in KDevelop’s project configuration I set the CMAKE_PREFIX_PATH environment variable to ~/projects/install, that way CMake will also search my hierarchy for dependencies. Attached screenshot to hopefully help you out.

Thank you very much for your help.

So that was a mistake after all. I was in the wrong folder.

I tried again and had it placed directly under /usr.

It hasn’t been included in KDevelop yet, but I think your tip has put me on the right track.

I’ll tinker with it some more and let you know if it doesn’t work.

From what I can see and have read, I can just delete the folders, so nothing can go wrong.

Anyway, thanks for the reply—it really helped me.

Have a great day!

working find_package(wt REQUIRED) is the crucial part in this kind of setup.

The alternative is to manually add include paths in project configuration → language support → includes/imports.

But I use that as a last resort, as the IDE should pick up the same things the build system does.

I see.

I wanted it in the default folder too, so I rebuilt it, and now it works perfectly.

The only thing I noticed is that new libraries aren’t recognized in an existing project.

Newly created projects use them without any problems.

I need to write a quick note. Something isn’t working yet.

After building, I could see that the syntax highlighting was working.

Then I closed KDevelop.

Now that I’ve reopened it, it explicitly says it can’t find Wt.

Boost, for example, is found.

I can see the Wt folder under /usr/include/.

To be precise, the Wt folder is located in the same folder as boost, which I downloaded from the package repositories.

The permissions are also the same.

I’ve already checked the permissions using Flatseal and even entered them manually as a test. But it didn’t work.

Does this sound familiar to you, and do you or anyone else have any tips?

Doesn’t sound familiar, but first that comes to mind is reloading the project (right click, → reload), also possibly force a reconfigure.

Thanks for the tip.

I’ve both reloaded the project and re-imported it completely.

But to no avail.

This is starting to get really strange.
As I said, I got the Boost libraries from the package repositories, and they work.

I just installed curlpp (a C++ wrapper—curl is also installed) from the package repositories as well.
That doesn’t work either.

I really don’t understand this right now.
The only thing I can think of is a permission issue with the Flathub version of KDevelop or a problem directly within KDevelop.

Hi @bednar,

I’ve run some more tests and can confirm that it doesn’t work with the version installed via snap or the older one directly from the Debian package repositories either.

I also added a profile to the environment variables in the options and set CMAKE_PREFIX_PATH to

/usr/

But that didn’t work either.

Do you see any errors bvy me?

Or should I open a bug ticket? If so, do you have a link?

Hi,

I see you filed https://bugs.kde.org/show_bug.cgi?id=523680

When I try to compile, KDevelop reports that the directories or files could not be found.

If your project doesn’t build, KDevelop usually can’t see the imported libraries. You need to fix your build system first.

If your build system isn’t integrated like this, adding new paths using “additional includes” should work.