Beginner's Linux Questions

Started by
15 comments, last by stefu 22 years, 5 months ago
HI! I have few questions about programming in linux general:: 1. In what directory do I extract all libraries (for example Mesa 4, glu, SDL)? /usr/? Does it need to be done in root mode? 2. This one may sound stupid question Where to locate my projects? Is /home/username/programming good? Is there any recommendations that make programming more easy and flexible? 3. This question has been surely asked many times before but again: Any good ide's / editors. I found kdevelop not good for me (it was automatically installed). Simple IDE (or maybe just MDI text editor where can be assigned make and run commands) might be good. 4. Can I locate my projects in Windows partition so that they can be used in both Linux and windows? Or do I have to copy whole project to windows partition and work there and copy back to work in Linux? I had a problem: I tried to install glu (downloaded the .rpm from Mesa3D). I tried to make (build) a NeHe tutorial but it said that glu.h is not found. I looked at dir /usr/include/GL/ and there was glu.h. Actually there was link to glu.h, gl.h and others were normal. It was weird since the whole /GL/ seemed to be located in another dir (/X11R6/... something, can't really remember). And so the glu.h was linked to the same glu.h file itself (endless loop ). If someone could explain how thing really are? Then I tried something in root mode (removing the glu.h and some ligGLU?so too) and what happened? Then next time I started linux it switched to graphics mode but after second it switched back to console mode. Few seconds and it did it again and again... So I installed whole linux again (luckily I hadn't anything important in Linux yet, just experimenting). Is there any basic tutorials how to make basic things in Linux? Installing libraries, making makefiles, compiling and so on... Thanks! Edited by - stefu on October 31, 2001 1:21:47 PM
Advertisement
quote:Original post by stefu
HI!
I have few questions about programming in linux general::

1. In what directory do I extract all libraries (for example Mesa 4, glu, SDL)? /usr/? Does it need to be done in root mode?

2. This one may sound stupid question Where to locate my projects? Is /home/username/programming good? Is there any recommendations that make programming more easy and flexible?

3. This question has been surely asked many times before but again: Any good ide''s / editors. I found kdevelop not good for me (it was automatically installed). Simple IDE (or maybe just MDI text editor where can be assigned make and run commands) might be good.

4. Can I locate my projects in Windows partition so that they can be used in both Linux and windows? Or do I have to copy whole project to windows partition and work there and copy back to work in Linux?

I had a problem:
I tried to install glu (downloaded the .rpm from Mesa3D). I tried to make (build) a NeHe tutorial but it said that glu.h is not found. I looked at dir /usr/include/GL/ and there was glu.h. Actually there was link to glu.h, gl.h and others were normal. It was weird since the whole /GL/ seemed to be located in another dir (/X11R6/... something, can''t really remember). And so the glu.h was linked to the same glu.h file itself (endless loop ). If someone could explain how thing really are?
Then I tried something in root mode (removing the glu.h and some ligGLU?so too) and what happened? Then next time I started linux it switched to graphics mode but after second it switched back to console mode. Few seconds and it did it again and again...
So I installed whole linux again (luckily I hadn''t anything important in Linux yet, just experimenting).

Is there any basic tutorials how to make basic things in Linux? Installing libraries, making makefiles, compiling and so on...

Thanks!

Edited by - stefu on October 31, 2001 1:21:47 PM


first of all, as for where to put your libraries, it''s the makefile that decides where it puts the files, not you. As for the placement of your project, you can put it where you want, it doesn`t matter. I have a directory in my /home/ called projects where I store all of my code. It''s really up to you. As for editors, get Anjuta. It''s the best IDE there is...

"And that''s the bottom line cause I said so!"

Cyberdrek
Headhunter Soft
A division of DLC Multimedia

Resist Windows XP''s Invasive Production Activation Technology!

"gitty up" -- Kramer
[Cyberdrek | ]
quote:Original post by stefu
HI!
I have few questions about programming in linux general::

1. In what directory do I extract all libraries (for example Mesa 4, glu, SDL)? /usr/? Does it need to be done in root mode?


It depends what distro you are using. You are using rpm so it should put all libraryes in right place.
It is normally either /usr/ or /usr/local
root or su- mode is needed if you want that all users can use them.

quote:
2. This one may sound stupid question Where to locate my projects? Is /home/username/programming good? Is there any recommendations that make programming more easy and flexible?


anywere you like, put /home/username/projects/language/program_name/ is what usually use.

quote:
3. This question has been surely asked many times before but again: Any good ide''s / editors. I found kdevelop not good for me (it was automatically installed). Simple IDE (or maybe just MDI text editor where can be assigned make and run commands) might be good.


You have KDE installed so kate is good editor.
If you want to try IDE''s try anjuta.
(X)emacs is also good.

quote:
4. Can I locate my projects in Windows partition so that they can be used in both Linux and windows? Or do I have to copy whole project to windows partition and work there and copy back to work in Linux?


That should also work. but there might be problem with differend
end of line marking in linux and windows.

quote:
I had a problem:
I tried to install glu (downloaded the .rpm from Mesa3D). I tried to make (build) a NeHe tutorial but it said that glu.h is not found. I looked at dir /usr/include/GL/ and there was glu.h. Actually there was link to glu.h, gl.h and others were normal. It was weird since the whole /GL/ seemed to be located in another dir (/X11R6/... something, can''t really remember). And so the glu.h was linked to the same glu.h file itself (endless loop ). If someone could explain how thing really are?
Then I tried something in root mode (removing the glu.h and some ligGLU?so too) and what happened? Then next time I started linux it switched to graphics mode but after second it switched back to console mode. Few seconds and it did it again and again...
So I installed whole linux again (luckily I hadn''t anything important in Linux yet, just experimenting).


there are two directorys were gl*.h can be.
one is /usr/include/GL/ and other is /X11R6/...

if you use your distro''s packages all them should be in same place. If you have update do of them they then can be differend places. this should also work, but you can copy them all in one place.

check also how to use -I and -L with gcc, this help when libraryes of headers are in differend places.


quote:

Is there any basic tutorials how to make basic things in Linux? Installing libraries, making makefiles, compiling and so on...

Thanks!

Edited by - stefu on October 31, 2001 1:21:47 PM


There are lot of material in net, so are good and some are not.
If you have some money to spend get beginning linux programming 2nd edition it is a good book and help a lot.

quote:
I tried to install glu (downloaded the .rpm from Mesa3D). I tried to make (build) a NeHe tutorial but it said that glu.h is not found. I looked at
dir /usr/include/GL/ and there was glu.h. Actually there was link to glu.h, gl.h and others were normal. It was weird since the whole /GL/
seemed to be located in another dir (/X11R6/... something, can''t really remember). And so the glu.h was linked to the same glu.h file itself
(endless loop ). If someone could explain how thing really are?


look up your enviroment variables, there is a variable for library, include, and binary files, and set them correctly.
the problem when you tried to compile was that the include directory where the glu.h was located was not on your Include path, check the source file, perhaps you have an #include "glu.h" where you should have a #include "/gl/glu.h" or viceversa, also you can tell GCC to look up header files in the command like using the -I switch, so

gcc test.c -o test -I/X11R6/include

will look for header files in test.c into the /X11R6/include directory (by the way there is no such directory, change acordingly)

there is the -L switch for Library Paths, works the same.

quote:
Then I tried something in root mode (removing the glu.h and some ligGLU?so too) and what happened? Then next time I started linux it
switched to graphics mode but after second it switched back to console mode. Few seconds and it did it again and again...
So I installed whole linux again (luckily I hadn''t anything important in Linux yet, just experimenting).

Is there any basic tutorials how to make basic things in Linux? Installing libraries, making makefiles, compiling and so on...


Don''t do that, that''s why there are package managers! (I use gnorpm to handle package installing and removal), besides, you should treat all .so files as you treat .dll files (because thats what they are! .so = Shared Object), I think we all know how important are dlls for windows right? same rule applies
Thank you very much, I''m already getting in


One more thing:
It seems that there are multiple graphics environments (KDE, GNOME, ... what are they called?)
I wan''t to create simple opengl app without SDL,ClanLib and GLUT.
What are the possibilities?

I downloaded a Nehe Tutorial (Linux/GLX). Does it work for all KDE,GNOME,...? (I didn''t yet succeed to compile it yet, going to try again now )
Thanks again.
Now, this is very weird!

I installed the glu rpm (glu-1.3-1.g++-3.0.i386.rpm) (downloaded it from Mesa3D).
It installed the glu.h and some libs. But size of glu.h is 0k. It's a link and (I looked at properties) it points to /usr/X11R6/include/GL/glu.h and that's the file itself!!! what's the point here. I have Mandrake Linux 8.1.
Can I just copy the glu.h included with MesaLib to /usr/X11R6/include/GL/glu.h?

I'm trying to compile Nehe Lesson08 (Linux/GLX version).

it says error: GL/glu.h: No such a file or directory

if I remove the: include GL/glu.h

then some warnings and
/usr/bin/ld: cannot find -lGLU
collect2: ld returned 1 exit status
What is ld? linker?
Help me please with this problem. I can't do anything.


Edited by - stefu on November 1, 2001 6:31:46 AM
It is easier to use GLUT, SDL or similar for your OpenGL projects and they should should work on KDE, Gnome, Windows and others.

The GLU 1.3 you downloaded from Mesa is really from SGI and Mesa used to have another like GLU 1.1. Check that the real file is GLU 1.3 and if so copy it to /usr/include/GL/

ld is the linker. You can type "info ld" or "man ld" for documentation.
quote:Original post by stefu
Thank you very much, I''m already getting in


One more thing:
It seems that there are multiple graphics environments (KDE, GNOME, ... what are they called?)
I wan''t to create simple opengl app without SDL,ClanLib and GLUT.
What are the possibilities?

I downloaded a Nehe Tutorial (Linux/GLX). Does it work for all KDE,GNOME,...? (I didn''t yet succeed to compile it yet, going to try again now )
Thanks again.


Kde and Gnome are desktop enviroments. Then there are windows managers like sawfish, blackbox and others.
thise all are runned above X.
Opengl is using X also so you can run your opengl apps in all thise enviroment.

You can do apps without SDL or GLUT, but it''s easier to initialize apps window with them.

If your card support GLX, apps should run in every desktop enviroment.

;jackz
quote:Original post by stefu
Now, this is very weird!

I installed the glu rpm (glu-1.3-1.g++-3.0.i386.rpm) (downloaded it from Mesa3D).
It installed the glu.h and some libs. But size of glu.h is 0k. It''s a link and (I looked at properties) it points to /usr/X11R6/include/GL/glu.h and that''s the file itself!!! what''s the point here. I have Mandrake Linux 8.1.
Can I just copy the glu.h included with MesaLib to /usr/X11R6/include/GL/glu.h?



It is a soft link to right glu.h, it should work. Or you can copy glu.h if you like.

Why did you not use glu.h which comes in LM8.1 , if I remember right it is mesa-demos rpm or mesa-demos-devel.
try "urpmf glu.h" to see what is the right package.


quote:
I''m trying to compile Nehe Lesson08 (Linux/GLX version).

it says error: GL/glu.h: No such a file or directory

if I remove the: include GL/glu.h

then some warnings and
/usr/bin/ld: cannot find -lGLU
collect2: ld returned 1 exit status
What is ld? linker?
Help me please with this problem. I can''t do anything.


Edited by - stefu on November 1, 2001 6:31:46 AM


try gcc -o lesson8 lesson8.c -I/usr/X11R6/include/ to see if that error: GL/glu.h: No such a file or directory
is removed.

you may need to use -L/usr/where_is_that_libglu/ to remove that /usr/bin/ld: cannot find -lGLU
or it might be that you need to change -lGLU to -lglu .

use locate command to check if it is libGLU.* or libglu.*

also you should get some more information about linux in general.

, jackz

voit myös mailata minulle jackz14_at_hotmail.com jos tarvitset lisätietoja (sorry about language )
Thanks for all, it works NOW it works!

Actually it doesn''t work but it compiles perfect now!

Glu was not installed properly. MandrakeUpdate was not able to install, there was some conflice (maybe because I tried to install manually first :D).
But then I found Package Manager that did the job (checked overwrite).

It compiles but doesn''t run!

What does these mean?

XF86VidModeExtension-Version 2.1
Xlib: extension "GLX" missing on display ":0.0"
Xlib: extension "GLX" missing on display ":0.0"
Only Singlebuffered Visual!Xlib: extension "GLX" missing on display ":0.0"
glX-Version 3.1073833568
Xlib: extension "GLX" missing on display ":0.0"
Segmentation fault

I''m I missing some drivers? I have GeForce2 MX400.
Who prints ''Xlib: extension "GLX" missing on display ":0.0"'' and why?Other lines are in lesson08.c (not the Segmentation fault )

This is going to be harder that I thought
kiitos jackz!

"also you should get some more information about linux in general." I agree!
I''m learning all time, it''s just one day I installed Linux and now I''m learning Linux graphics programming! LOL, But I have programmed much in Win32 (good or bad?).

This topic is closed to new replies.

Advertisement