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 |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
 |
01-17-2005, 01:55 PM
|
#1
|
LQ Newbie
Registered: Jan 2005
Posts: 8
Rep:
|
Gcc
hey guys,
just starting out using Linux, im having trouble figuring out how the GCC C compiler works on linux, i know about the programming side as i have been using one on Windows XP, now iv moved onto Linux, i have managed to install the GCC file using YaST but cant seem to find it, is it an application???? how do i compile, write and execute the file i have written using GCC???
any information would be most appreciated
thank you very much
D
|
|
|
01-17-2005, 02:05 PM
|
#2
|
LQ Guru
Registered: Feb 2003
Location: Virginia, USA
Distribution: Debian 12
Posts: 8,381
|
"how do i compile, write and execute the file i have written using GCC???"
Here is a gcc tutorial.
http://gcc.gnu.org/onlinedocs/gcc/
"i have managed to install the GCC file using YaST but cant seem to find it,"
Look for gcc (lower case) with this command:
which gcc
-----------------------------
Steve Stites
|
|
|
01-17-2005, 02:51 PM
|
#3
|
LQ Guru
Registered: Nov 2003
Location: N. E. England
Distribution: Fedora, CentOS, Debian
Posts: 16,298
Rep:
|
in a console, you can do
$gcc -o program program.c
that basically creates a program called "program" from a source file called "program.c".
|
|
|
01-17-2005, 04:58 PM
|
#4
|
LQ Newbie
Registered: Jan 2005
Posts: 7
Rep:
|
C compiler problems
Hello,
I'm also new to Linux. I'm running a Slackware 10.0 derivative called Topologilinux that lets me experiment/run Linux without much hassle.
It came with gcc 3.3.4 already installed plus several glib's. I'm trying to install software for my Alcatel USB ADSL modem so I can use the net but it needs to compile and produce some executables.
While attempting the compilation it stops with a final message saying "C compiler cannot create executables". I've search through various forums on the issue and it looks like it has to deal with one of several different causes.
I tried upgrading to gcc 3.4.3 but the problem is still alive. The following is an extract of config.log:
## --------- ##
## Platform. ##
## --------- ##
hostname = topologilinux
uname -m = i686
uname -r = 2.4.28
uname -s = Linux
uname -v = #6 Thu Dec 23 14:38:43 CET 2004
/usr/bin/uname -p = unknown
/bin/uname -X = unknown
/bin/arch = i686
/usr/bin/arch -k = unknown
/usr/convex/getsysinfo = unknown
hostinfo = unknown
/bin/machine = unknown
/usr/bin/oslevel = unknown
/bin/universe = unknown
PATH: /usr/local/sbin
PATH: /usr/sbin
PATH: /sbin
PATH: /usr/local/bin
PATH: /usr/bin
PATH: /bin
PATH: /usr/X11R6/bin
PATH: /usr/games
PATH: /opt/kde/bin
PATH: /usr/lib/qt/bin
## ----------- ##
## Core tests. ##
## ----------- ##
configure:1352: checking build system type
configure:1370: result: i686-pc-linux-gnuoldld
configure:1378: checking host system type
configure:1392: result: i686-pc-linux-gnuoldld
configure:1447: checking for gcc
configure:1463: found /usr/bin/gcc
configure:1473: result: gcc
configure:1717: checking for C compiler version
configure:1720: gcc --version </dev/null >&5
gcc (GCC) 3.4.3
Copyright (C) 2004 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
configure:1723: $? = 0
configure:1725: gcc -v </dev/null >&5
Reading specs from /usr/lib/gcc/i486-slackware-linux/3.4.3/specs
Configured with: ../gcc-3.4.3/configure --prefix=/usr --enable-shared --enable-threads=posix --enable-__cxa_atexit --disable-checking --with-gnu-ld --verbose --target=i486-slackware-linux --host=i486-slackware-linux
Thread model: posix
gcc version 3.4.3
configure:1728: $? = 0
configure:1730: gcc -V </dev/null >&5
gcc: `-V' option must have argument
configure:1733: $? = 1
configure:1756: checking for C compiler default output file name
configure:1759: gcc conftest.c >&5
gcc: installation problem, cannot exec `as': No such file or directory
configure:1762: $? = 1
configure: failed program was:
| /* confdefs.h. */
|
| #define PACKAGE_NAME "speedtouch"
| #define PACKAGE_TARNAME "speedtouch"
| #define PACKAGE_VERSION "1.3.1"
| #define PACKAGE_STRING "speedtouch 1.3.1"
| #define PACKAGE_BUGREPORT "speedtouch@ml.free.fr"
| /* end confdefs.h. */
|
| int
| main ()
| {
|
| ;
| return 0;
| }
configure:1801: error: C compiler cannot create executables
See `config.log' for more details.
Could anybody tell me what could be the most probable cause for this?
Needless to say, ANY help is appreciated
|
|
|
01-17-2005, 06:07 PM
|
#5
|
Senior Member
Registered: Dec 2004
Distribution: Slackware, ROCK
Posts: 1,973
Rep:
|
ag, you need to install the rest of the packages in the d/ directory (specifically, your missing binutils ).
|
|
|
01-17-2005, 07:04 PM
|
#6
|
LQ Newbie
Registered: Jan 2005
Posts: 7
Rep:
|
Thank you, __J. It seems like certainly binutils is not installed. I'll install it right away and post my findings.
Before that, I guess it may not matter but, should I switch back to gcc 3.3.4?
Thanks again!
(Few days later)
I solved the problem.
Here are the packages I ended up needing:
binutils-2.15.90.0.3-i486-1.tgz
gcc-3.3.4-i486-1.tgz
gcc-g++-3.3.4-i486-1.tgz
kernel-headers-2.4.26-i386-3.tgz
make-3.80-i386-1.tgz
Thanks!
Last edited by ag01578; 01-21-2005 at 06:27 PM.
|
|
|
All times are GMT -5. The time now is 10:31 PM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|