LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 10-28-2018, 12:33 PM   #1
risumies
LQ Newbie
 
Registered: Oct 2018
Posts: 1

Rep: Reputation: Disabled
gcc cannot find -lGL


Hello, i got debian 9 today I'm trying compile my OpenGL code when I type "gcc file.c -lglfw -lGL", the gcc says "cannot find -lGL".
How i can fix that?
 
Old 10-28-2018, 01:25 PM   #2
hazel
Senior Member
 
Registered: Mar 2016
Location: Harrow, UK
Distribution: LFS, AntiX, Slackware, OpenBSD
Posts: 4,039
Blog Entries: 11

Rep: Reputation: 2232Reputation: 2232Reputation: 2232Reputation: 2232Reputation: 2232Reputation: 2232Reputation: 2232Reputation: 2232Reputation: 2232Reputation: 2232Reputation: 2232
The usual way to install software on Linux is to use your package manager. In the case of Debian, that means the apt system. For a newbie, the easiest interface to apt is the graphical one, synaptic. You'll find it somewhere in your desktop menu. Package managers install precompiled packages so that you don't have to build them locally. They also install alongside them any additional libraries on which they may depend. Everything is guaranteed to be mutually compatible, so you should always use this method wherever possible.

You should only build stuff if what you need is not in the distro's software repository, an unlikely problem in the case of Debian, which has huge repos. Then you will usually find that the source code comes in a zipped archive (called a "tarball"). Unpack it, enter the resultant directory, read any instructions you can find (especially any file called README or INSTALL) and follow those instructions.

Typically this involves running a "configure" script which will find required libraries (or warn you of their absence), then "make" and "sudo make install". You almost never use gcc directly.
 
Old 10-28-2018, 07:45 PM   #3
berndbausch
Senior Member
 
Registered: Nov 2013
Location: Tokyo
Distribution: A few
Posts: 4,126

Rep: Reputation: 1155Reputation: 1155Reputation: 1155Reputation: 1155Reputation: 1155Reputation: 1155Reputation: 1155Reputation: 1155Reputation: 1155
Quote:
Originally Posted by risumies View Post
Hello, i got debian 9 today I'm trying compile my OpenGL code when I type "gcc file.c -lglfw -lGL", the gcc says "cannot find -lGL".
How i can fix that?
The error message means that your system misses a library named libGL.so, or that this library is not at the location where gcc expects it to be.

Assuming your compilation command is correct, fix the problem by installing this library. To find out which package contains the library, use apt search.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] chapter 5.5 building gcc cannot find gcc directory sfzombie13 Linux From Scratch 14 04-16-2014 08:31 PM
build errors on fedora 16 when link with -lGL djgerbavore Fedora 2 04-26-2012 09:53 AM
Ubuntu can't build, I get "cannot find -lGL" error xmrkite Linux - Software 6 05-18-2008 04:26 PM
Cannot Find -lGL ShadowMetis Linux - Software 1 02-11-2005 09:44 AM
Cant find GCC manzoor Programming 3 10-12-2001 02:46 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 04:09 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration