LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 11-18-2012, 01:37 PM   #16
theNbomr
LQ 5k Club
 
Registered: Aug 2005
Distribution: OpenSuse, Fedora, Redhat, Debian
Posts: 5,399
Blog Entries: 2

Rep: Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908

Compilers & linkers don't care where they find libraries. As long as you point them to a library that is of a proper format, the compiler and linker will happily link to it. The location of the library, with respect to directory names, is purely for the aid of human organizational sanity, as well as possible conformity with some software installers and package managers.
Your linker is now looking for something to resolve two more references to external symbols:
Code:
second.cpp:(.text+0xa5): undefined reference to `glewInit'
second.cpp:(.text+0xaa): undefined reference to `__GLEW_VERSION_2_0'
If I were to hazard a guess, and based on your code that includes the glew.h header file, I'd say that you need to add another library to the linker options: 'libglew'. Once again, find it, add it to the commandline, along with the location as an argument to the '-L' option. You do not need to add redundant '-L' options that point to the same place. The commandline
Code:
gcc second.cpp -L /usr/lib64 -L /usr/lib64 -lGL -lglut
can be shortened to
Code:
gcc second.cpp -L /usr/lib64 -lGL -lglut
--- rod.
 
1 members found this post helpful.
Old 11-18-2012, 03:41 PM   #17
kirba
LQ Newbie
 
Registered: Nov 2012
Location: Brighton UK
Posts: 24

Original Poster
Rep: Reputation: Disabled
Ok, as it turns out I had already installed the library and -lGLEW was to be included in my commandline.
I just want to confirm that this time compiled. It returned a file named "a.out" is that normal ?

Also, does it matter that the library is named in capitals ?
 
Old 11-19-2012, 01:37 PM   #18
theNbomr
LQ 5k Club
 
Registered: Aug 2005
Distribution: OpenSuse, Fedora, Redhat, Debian
Posts: 5,399
Blog Entries: 2

Rep: Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908
Anything to do with the Linux filesystem is case-sensitive, so yes, it matters. The a.out file is your executable object code. Without being given the '-o' option, that is the default name used by gcc.
Congratulations on having successfully built a program from source code.

--- rod.
 
1 members found this post helpful.
Old 11-20-2012, 05:33 PM   #19
kirba
LQ Newbie
 
Registered: Nov 2012
Location: Brighton UK
Posts: 24

Original Poster
Rep: Reputation: Disabled
I can't thank you enough for you patience and help. You assisted me more than my teacher!
Now i can finally start working on the code itslef! Thanks again !!!
 
Old 11-20-2012, 05:42 PM   #20
markush
Senior Member
 
Registered: Apr 2007
Location: Germany
Distribution: Slackware
Posts: 3,979

Rep: Reputation: Disabled
Quote:
Originally Posted by kirba View Post
I can't thank you enough for you patience and help. You assisted me more than my teacher!
Now i can finally start working on the code itslef! Thanks again !!!
kirba, here at LQ you can add to someones (theNbomr's) reputation if you found his/her guidance very helpful (with the button next to the penguin), or at least mark the postings of theNbomr as helpful (at the right bottom of the post).

Markus
 
1 members found this post helpful.
Old 12-06-2012, 01:10 PM   #21
kirba
LQ Newbie
 
Registered: Nov 2012
Location: Brighton UK
Posts: 24

Original Poster
Rep: Reputation: Disabled
Thanks markush for letting me know.
I didn't quite get how to add rep. I don't see any button next to the penguin (if you mean the one representing someone's OS).
 
Old 12-06-2012, 01:13 PM   #22
markush
Senior Member
 
Registered: Apr 2007
Location: Germany
Distribution: Slackware
Posts: 3,979

Rep: Reputation: Disabled
Quote:
Originally Posted by kirba View Post
Thanks markush for letting me know.
I didn't quite get how to add rep. I don't see any button next to the penguin (if you mean the one representing someone's OS).
I meant the other side of the penguin.

Markus
 
Old 12-06-2012, 01:21 PM   #23
kirba
LQ Newbie
 
Registered: Nov 2012
Location: Brighton UK
Posts: 24

Original Poster
Rep: Reputation: Disabled
What other side ? I don't see it, I'm sorry :S
 
  


Reply



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
Web Programming Environment AustinPowered Programming 9 12-25-2011 09:16 AM
Setting up environment variables in a C programming and accessing via a script mateo14 Programming 2 02-16-2010 10:54 PM
Setting up a multi-user programming environment pembo13 Linux - General 3 01-16-2006 12:21 AM
programming environment? pablowablo Linux - Newbie 12 04-27-2004 10:34 AM
Programming environment devit Programming 2 02-10-2004 12:15 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 09:45 PM.

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
Open Source Consulting | Domain Registration