Error "Could not load dynamic library" when running Ogre program from Visual Studio Code debug Topic is solved

Problems building or running the engine, queries about how to use features etc.
Post Reply
xmenage
Gnoblar
Posts: 2
Joined: Sat Jun 25, 2022 2:10 pm

Error "Could not load dynamic library" when running Ogre program from Visual Studio Code debug

Post by xmenage »

Ogre Version: :13.3.4:
Operating System: :Ubuntu 20.04.4 LTS:
Render System: :GL:

Code: Select all

Creating resource group General
Creating resource group OgreInternal
Creating resource group OgreAutodetect
SceneManagerFactory for type 'DefaultSceneManager' registered.
Registering ResourceManager for type Material
Registering ResourceManager for type Mesh
Registering ResourceManager for type Skeleton
MovableObjectFactory for type 'ParticleSystem' registered.
ArchiveFactory for type 'FileSystem' registered
ArchiveFactory for type 'Zip' registered
ArchiveFactory for type 'EmbeddedZip' registered
DDS codec registering
ETC codec registering
ASTC codec registering
Registering ResourceManager for type GpuProgram
Registering ResourceManager for type Compositor
MovableObjectFactory for type 'Entity' registered.
MovableObjectFactory for type 'Light' registered.
MovableObjectFactory for type 'BillboardSet' registered.
MovableObjectFactory for type 'ManualObject' registered.
MovableObjectFactory for type 'BillboardChain' registered.
MovableObjectFactory for type 'RibbonTrail' registered.
MovableObjectFactory for type 'StaticGeometry' registered.
MovableObjectFactory for type 'Rectangle2D' registered.
Loading library /snap/code/99/usr/local/lib/OGRE/RenderSystem_GL.so.13.4
Unregistering ResourceManager for type Compositor
Unregistering ResourceManager for type Skeleton
Unregistering ResourceManager for type Mesh
Unregistering ResourceManager for type GpuProgram
Unregistering ResourceManager for type Material
Error occurred during execution: InternalErrorException: Could not load dynamic library /snap/code/99/usr/local/lib/OGRE/RenderSystem_GL.  System Error: /snap/code/99/usr/local/lib/OGRE/RenderSystem_GL.so.13.4: cannot open shared object file: No such file or directory in DynLib::load at /home/xavier/ogre/ogre-13.3.4/OgreMain/src/OgreDynLib.cpp (line 136)
[1] + Done                       "/usr/bin/gdb" --interpreter=mi --tty=${DbgTerm} 0<"/tmp/Microsoft-MIEngine-In-tdeeqlbf.qs3" 1>"/tmp/Microsoft-MIEngine-Out-c5pymi4n.c5a"

Hello,

I am getting an "Could not load dynamic library" error when starting the program through Visual Studio Code debug command. It looks for /snap/code/99/usr/local/lib/OGRE/RenderSystem_GL.so.13.4 which is not located in this directory as I built Ogre from source.

I don't get this error if I run the program from a regular terminal.

I can't find whether I need to change some settings in vscode or elsewhere

Thanks,

Xavier

User avatar
paul424
Gnome
Posts: 314
Joined: Thu May 24, 2012 7:16 pm
x 13

Re: Error "Could not load dynamic library" when running Ogre program from Visual Studio Code debug

Post by paul424 »

The simplest solution looks like this : Install the Ogre also through your snap package system !
From here : https://snapcraft.io/ogre ....

paroj
OGRE Team Member
OGRE Team Member
Posts: 1994
Joined: Sun Mar 30, 2014 2:51 pm
x 1074
Contact:

Re: Error "Could not load dynamic library" when running Ogre program from Visual Studio Code debug

Post by paroj »

you must SNAP="" in the environment when launching ogre. Ogre uses this variable to check whether it is run as a snap, but the vscode snap sets it to.

Alternatively install vscode from deb.

xmenage
Gnoblar
Posts: 2
Joined: Sat Jun 25, 2022 2:10 pm

Re: Error "Could not load dynamic library" when running Ogre program from Visual Studio Code debug

Post by xmenage »

I tried both solutions but I could make it work only with installing vscode from deb (still a beginner with vscode)

Thanks

Post Reply