LinuxQuestions.org
Latest LQ Deal: Linux Power User Bundle
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 07-13-2006, 12:50 AM   #1
crammer
LQ Newbie
 
Registered: Jul 2006
Posts: 4

Rep: Reputation: 0
One question on compiling gcc


Dear All,

If I am not an administrator, can I compile and install a new version of gcc on a workstation? I just tried to compile and install it on my work directory, but it failed. I did it on my own notepad successfully. So I guess I am not authorized to do so on the workstation. Is it right?

Thanks a lot for your guidance
Crammer
 
Old 07-13-2006, 05:41 AM   #2
b0uncer
LQ Guru
 
Registered: Aug 2003
Distribution: CentOS, OS X
Posts: 5,131

Rep: Reputation: Disabled
Hmm..since gcc is after all a program, I would say you can configure and compile it, but the actual installation step won't succeed as you don't have permissions. Everything that happens inside the compile dir you have permissions to should work..

But I might be wrong since I've never compiled gcc as a normal user.
 
Old 07-13-2006, 06:30 AM   #3
majalee
Member
 
Registered: Jul 2004
Location: India
Distribution: Ubuntu / OpenSuse
Posts: 54

Rep: Reputation: 15
after u have compiled the 'gcc' don't try to 'make install' bcoz this will try to copy the executables to the root directory. use the 'gcc' that has been created after compilation from ur work directory. i am sure, you can use it as a 'user'.

aaditya
 
Old 07-19-2006, 02:02 AM   #4
crammer
LQ Newbie
 
Registered: Jul 2006
Posts: 4

Original Poster
Rep: Reputation: 0
Thanks a lot for your guidance. However, I can not compile gcc successfully as a user. In fact, I did it fluently on my own notepad. Is the compiling procedure involved in operating under the root directory?

By the way, I have another question. Generally, the exe file compiled using c++ under one Windows system can run very well under another Windows system. Namely the exe file is not related to the kernel of OS. Unfortunately, the rule can not be applied to Linux system. I compiled an executable file using gcc under FC 5(a linux version). When I tried to use it under another linux system, it says: too old kernel. It seems that the Windows is more convenient than Linux system. How do you feel?

Last edited by crammer; 07-19-2006 at 02:13 AM.
 
Old 07-19-2006, 03:06 AM   #5
majalee
Member
 
Registered: Jul 2004
Location: India
Distribution: Ubuntu / OpenSuse
Posts: 54

Rep: Reputation: 15
why u won't be able to execute the objects in different linux OS would be bcoz of the fact that when the executable is created, it links to the libraries present in the system directories. and it won't run in the older versions of linux, as the libraries would be old. so this means that the linux libraries are really updated from one kernel to another.

whereas, it might also mean that the libraries in windows are the old libraries. and hence it might be working. ;=)

anyways. if u want stuff like multimedia, stay with windows. for everything else, use linux.

aaditya
 
Old 07-19-2006, 03:20 AM   #6
btmiller
Senior Member
 
Registered: May 2004
Location: In the DC 'burbs
Distribution: Arch, Scientific Linux, Debian, Ubuntu
Posts: 4,284

Rep: Reputation: 371Reputation: 371Reputation: 371Reputation: 371
You can always statically link executables when you build them to make them more or less independent of library versions (at the expense of the exe itself being much larger). As for gcc, where did your build fail? Note that you need gcc already installed to build gcc from source (it seems weird, but gcc is itself largely written in C).

As for the Windows vs. Linux convenience, that's an argument I wouldn't want to get into, but note that a lot of older Win9x executables don't work correctly on NT based systems...
 
Old 07-19-2006, 03:22 AM   #7
crammer
LQ Newbie
 
Registered: Jul 2006
Posts: 4

Original Poster
Rep: Reputation: 0
Very interesting Well, I will try to compile the simplest c++ program to do a test. I think the "Hello, World!" program should not need any library of OS. So the executable file should be able to run under any linux. How do you think? Thanks a lot for your guidance.
 
Old 07-19-2006, 03:35 AM   #8
crammer
LQ Newbie
 
Registered: Jul 2006
Posts: 4

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by btmiller
As for gcc, where did your build fail? Note that you need gcc already installed to build gcc from source (it seems weird, but gcc is itself largely written in C).
Hi, I just compiled gcc according the general precedure. Configure it firstly, then make it. There was no error message when I compiled it on my own notepad, but it showed error messages under our workstation. I don't understand the error messages. They are too long.

By the way, I noticed that you said the minimum number of keystrokes achieve the maximum effort under Unix. I guess it is same for linux. Would you please tell me how to learn about it you mentioned above. Thanks a lot!
 
  


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
Error compiling gcc 3.3.6 with 64bit gcc 4.0.3 cs-cam Linux - Software 0 04-22-2006 06:20 AM
Compiling gcc without any gcc installed my_kappa Linux - Software 5 01-30-2006 01:15 AM
Kernel compiling: gcc-3.3 is 586, should be gcc-3.3 386 Erik Plaggenmar Linux - Software 0 10-01-2004 12:38 PM
Various Compiling Errors (GCC compiling Openal, GUIlib, xmms-wma) gregorya Linux - Software 2 08-27-2004 06:03 AM
Compiling C++ GCC poeta_boy Linux - Newbie 14 10-14-2003 05:23 PM

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

All times are GMT -5. The time now is 04:27 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