Archived

This topic is now archived and is closed to further replies.

Beginner's Linux Questions

This topic is 5888 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
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.

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
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

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
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 )

Share this post


Link to post
Share on other sites
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?).

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
quote:
Original post by stefu
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?).




You do not have nvidia drivers. If you want to use GLX you need them. HW acceleration do not work without them.

Go to www.nvidia.com and get linux drivers. Get tar files and use then. They are easier to use and install than rpm''s (in this case). Read the readmeinstallguide, and then read it again
before trying to install.

;jackz

Share this post


Link to post
Share on other sites
Well, I am glad you are not giving up on Linux,

you might want to try installing the nVidia drivers for Linux, they are at www.nVidia.com
before I did, I couldnt run OpenGl Apps eighter, make sure you can run open GL apps before trying yours (the bugs might not be in your code) I really recomend getting the Loki Demos package (http://www.lokigames.com).

Share this post


Link to post
Share on other sites
There are only one set of tar-files but many rpms for different distributions and versions. Are rpm packages distribution and version dependent, But tar.gz can be used in any ristributions?

I have to use tars because there isn''t rpms for MD8.1.Maybe I''ll print the readme & installation guide before installing. I already read it but I must have it on my hands while installing.

I have to print it in windows because I haven''t found Canon LBP-800 drivers for linux, are there any? Mandrake pages told that they are not available. Do you know if LBP-800 is compatible with other Canon printer drivers (LBP-1000,...)? I tried some drivers available but printer was quiet all the time.

Share this post


Link to post
Share on other sites
I recomend getting the source RPM's (SRPM) and rebuild them with rpm --rebuild as explained in the readme, thats what I did for my RedHat 7.2 Box, I think that since there is a package system in the Distribution, everything will work better if you install as much as you can as a package (and it will save you from manually configuring stuff), so I usually only get tars for the programs that there is absolutelly no way to get a RPM for (like OpenAL or the ALSA (sound) drivers)

the rpm's dont really have to do with the distributions, it has to do with the kernel version you are using, so installing a RPM for a distribution other than yours will not work, even if you have the same distribution version, but upgraded it's kernel, the rpm for that distribution wont work, might even break your system (at least your X Windows)

Edited by - kwizatz on November 1, 2001 5:35:44 PM

Share this post


Link to post
Share on other sites
Thanks!

What is the difference between these twoo sets?

Any RPM-based system with an upgraded / customized / non-default kernel
NVIDIA_GLX-1.0-1541.i386.rpm
NVIDIA_kernel-1.0-1541.src.rpm
Source RPMS are provided here for those interested
NVIDIA_GLX-1.0-1541.src.rpm
NVIDIA_kernel-1.0-1541.src.rpm

The NVIDIA_kernel-1.0-1541.src.rpm is same for both, the NVIDIA_GLX differs.Which one is good for MD8.1? I haven''t touched the kernel yet.

Share this post


Link to post
Share on other sites
Jahuu! It works. (I know because I saw NVIDIA logo at x-window startup)

Also Nehe Lessons work now. Thanks for alll!
Well, the only problems were that I couldn''t save XF86Config-4 using vi-editor. But I was brave and started x, modified it and rebooted. Next time nvidia was present!
Finally I can concentrate on programming!

Share this post


Link to post
Share on other sites
quote:

Any RPM-based system with an upgraded / customized / non-default kernel
NVIDIA_GLX-1.0-1541.i386.rpm
NVIDIA_kernel-1.0-1541.src.rpm
Source RPMS are provided here for those interested
NVIDIA_GLX-1.0-1541.src.rpm
NVIDIA_kernel-1.0-1541.src.rpm



Well, the GLX package, is (more) generic, and you can install it on any distribution, the "kernel" package is not as generic, this is a kernel module, sort of the core of the driver, and it needs to be compiled using the current kernel headers (and source?), and since not everyone has the same kernel version, you have to compile or "rebuild" your oun package from sources, thats why the src.rpm is the same for both, if you rebuild/recompile the GLX src.rpm package, you end up with the same i386 package they have for download.

Glad you have your System Running, Have fun!.

Share this post


Link to post
Share on other sites