Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

OpenGL setup for code::blocks "cannot find -lXxf86vm"

I'm working on setting up a dev environment for school. We're going to be using GLUT to do graphics programming. I installed freeglut on Ubuntu using

sudo apt-get install freeglut3-dev

I am going to be using code::blocks to write everything (as per the instructor's specifications) but when I try to build the default GLUT project in code::blocks, I get the following

Compiling: main.cpp 
Linking console executable: bin/Debug/glut_test
/usr/bin/ld: cannot find -lXxf86vm
collect2: ld returned 1 exit status

It looks to me like I'm missing some dependency, but I can't for the life of me figure out what it is. I have no idea what -lXxf86vm is, nor does Google or any other forum I can find.

Does anyone have ideas?

Update 1) this may have something to do with the fact that I have an Nvidia Optimus card in this laptop.

I tried running the default OpenGL project as well and it's throwing the following error

main: X server has no OpenGL GLX extension

I'm going to try installing bumblebee and see if that gets me anywhere

like image 518
user1634363 Avatar asked Oct 20 '25 21:10

user1634363


2 Answers

I have no idea what -lXxf86vm is, nor does Google or any other forum I can find.

This library provides an API for the XF86VidModeSwitch extension. XF86VidMode has been superseeded by XRandR, but freeglut may need it for its game mode support.

Just install the package "libxxf86vm-dev",

Update 1) this may have something to do with the fact that I have an Nvidia Optimus card in this laptop.

No, that's not the reason for this particular library to be missing

I tried running the default OpenGL project as well and it's throwing the following error

Well, you have not installed the NVidia-Drivers correctly.

like image 97
datenwolf Avatar answered Oct 23 '25 19:10

datenwolf


CodeBlocks always adds "Xxf86vm" to new GLUT projects. I have no idea what it is, or why CodeBlocks adds it, (very annoying bug?) but you almost definitely DONT NEED IT!.

You can find it under: Project -> Build options... -> Linker settings.
Select your project name in the left pane, and it should appear under: "Link libraries".
Now, Just delete it from the list. Your code should compile and run fine without it.

like image 30
Rene Lindsay Avatar answered Oct 23 '25 18:10

Rene Lindsay



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!