Cannot compile example - basic window Ubuntu 20.04.5 LTS in Code::Blocks #2730
Replies: 4 comments 10 replies
-
try just using make from the command line (using the Makefile in the repo not making one with cmake) if it works then it narrows down the issue to the IDE. |
Beta Was this translation helpful? Give feedback.
-
|
Beta Was this translation helpful? Give feedback.
-
absolutely do NOT run an IDE as root ! if code:blocks can't access a library from your user account then its likely misconfigured (by the looks for your user account) to be honest usually bullying and IDE into behaving takes longer than the perceived time it saves... as for cmake - an automagically created makefile 1000's of lines long - what could possibly go wrong! |
Beta Was this translation helpful? Give feedback.
-
For everyone that offered assistance and others that may encounter this discussion. I installed a fresh copy of Lubuntu 20.04.5 LTS in VirtualBox 6.1 on a Windows 10 host.
With the file manager open So I am guessing somewhere somehow the permissions for the default account became messed up. :( |
Beta Was this translation helpful? Give feedback.
-
Hi raysan,
I am attempting to compile the example example - basic window (aka Hello World) from the Code::Blocks V20.03 with a consistent "/usr/bin/ld: cannot find -lGL".
I compiled the raylib source with
sudo make PLATFORM=PLATFORM_DESKTOP GRAPHICS=GRAPHICS_API_OPENGL_21
andsudo make install
. The header and archive.a files are installed correctly.Also the dependencies were correctly installed:
sudo apt install libasound2-dev mesa-common-dev libx11-dev libxrandr-dev libxi-dev xorg-dev libgl1-mesa-dev libglu1-mesa-dev
I originally set the project options and project build option manually with the additional linker options -lraylib -lGL -lm -lpthread -ldl -lrt -lX11 -lc (Without -l )+ manually setting search directories etc without luck.
I created a new CB project from the ./raylib/projects/CodeBlocks template with the same results after many experiments.
Now the odd thing is that if I compile the example using Makefile
make core/core_basic_window PLATFORM=PLATFORM_DESKTOP
the example compiles and runs without error./core_basic_window
Also if I build the entire examples directory all of the examples compile and run without error
make PLATFORM=PLATFORM_DESKTOP
So this leads me to believe that all libraries and dependencies are correctly installed ¯\_(ツ)_/¯
I am running Lubuntu as a VM on VirtualBox which is why I used the GRAPHICS=GRAPHICS_API_OPENGL_21 as this is the maximum VitrualBox can render.
So I don't know if that is the issue, but I suspect not as the examples all build with the Makefile.
So I am thinking there is something missing in Code:Blocks. I don't normally use Code::Blocks and had issues like this with it a long time ago and binned it. Unfortunately I have tied myself too it at the moment :(
Any thoughts as to what may be causing the ld libGL.so error?
With thanks
Axle
P.S. the LibGL files are in /usr/lib/x86_64-linux-gnu/libGL.so; libGL.so.1; libGL.so.1.7.0
P.S.S. the build log from Code::Blocks:
Beta Was this translation helpful? Give feedback.
All reactions