NetBeans launches app with weird search path

Get answers to all your basic programming questions. No Ogre questions, please!
FedorIsHere
Kobold
Posts: 25
Joined: Wed Sep 20, 2023 6:05 am
x 8

NetBeans launches app with weird search path

Post by FedorIsHere »

I am trying to get Ogre running with different IDE's, to see which one is the most usable to me. I got pretty far with NetBeans and its C/C++ plugin. It is quite easy to set the right include and library paths for the project. It builds nicely, but when I run it from NetBeans it gives the following error:

Code: Select all

Error occurred during execution: InternalErrorException: 
Could not load dynamic library /snap/netbeans/84/usr/local/lib/OGRE/RenderSystem_GL.  
System Error: /snap/netbeans/84/usr/local/lib/OGRE/RenderSystem_GL.so.14.1: cannot open shared object file: No such file or directory in DynLib::load at /home/fedor/projecten/c++/ogre-14.1.0/OgreMain/src/OgreDynLib.cpp (line 136)

When I run the app outside of NetBeans, just clicking on the binary, it works without a problem.

It looks like the NetBeans-launch has the NetBeans install directory as its working dir and appends the library path to it. Where did it pick up this silly idea?

paroj
OGRE Team Member
OGRE Team Member
Posts: 2087
Joined: Sun Mar 30, 2014 2:51 pm
x 1127

Re: NetBeans launches app with weird search path

Post by paroj »

this is a peculiarity with Ogre snap handling. Because netbeans is a snap, Ogre thinks it is also part of the snap.

The solution is to set the environment variable SNAP="", when launching Ogre

FedorIsHere
Kobold
Posts: 25
Joined: Wed Sep 20, 2023 6:05 am
x 8

Re: NetBeans launches app with weird search path

Post by FedorIsHere »

Tnx again!

I took another route due to another problem I encountered but Snap did indeed mess up things here. I ended up downloading the binary-zip, unpacking it and firing it up from the prompt. I opened my project, hit Run + Debug and it launched a working app. Me happy!

I now have a working Netbeans-installation that does C++ and Ogre. I will do an installation on my laptop somewhere in the next few days and post a short howto here.