Welcome to the most active Linux Forum on the web.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
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!


  Search this Thread
Old 01-17-2005, 02:55 PM   #1
LQ Newbie
Registered: Jan 2005
Posts: 8

Rep: Reputation: 0

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

Old 01-17-2005, 03:05 PM   #2
LQ Guru
Registered: Feb 2003
Location: Virginia, USA
Distribution: Debian 12
Posts: 8,310

Rep: Reputation: 537Reputation: 537Reputation: 537Reputation: 537Reputation: 537Reputation: 537
"how do i compile, write and execute the file i have written using GCC???"
Here is a gcc tutorial.

"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
Old 01-17-2005, 03:51 PM   #3
LQ Guru
Registered: Nov 2003
Location: N. E. England
Distribution: Fedora, CentOS, Debian
Posts: 16,298

Rep: Reputation: 77
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".
Old 01-17-2005, 05:58 PM   #4
LQ Newbie
Registered: Jan 2005
Posts: 7

Rep: Reputation: 0
C compiler problems


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

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"
| /* 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
Old 01-17-2005, 07:07 PM   #5
Senior Member
Registered: Dec 2004
Distribution: Slackware, ROCK
Posts: 1,973

Rep: Reputation: 46
ag, you need to install the rest of the packages in the d/ directory (specifically, your missing binutils ).
Old 01-17-2005, 08:04 PM   #6
LQ Newbie
Registered: Jan 2005
Posts: 7

Rep: Reputation: 0
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:



Last edited by ag01578; 01-21-2005 at 07:27 PM.


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
gcc wont install, 'failed dependencies: glibc-devel is needed by gcc-3.3.3-41' TdlSnare SUSE / openSUSE 3 11-29-2004 03:13 PM
Kernel compiling: gcc-3.3 is 586, should be gcc-3.3 386 Erik Plaggenmar Linux - Software 0 10-01-2004 12:38 PM
running software built with gcc 3.0.2 on Redhat 8 - gcc 3.2 dst1989 Linux - Software 3 03-08-2004 11:23 PM
a doubt with host gcc and arm-linux-gcc renjithgopal Linux - General 1 09-11-2003 05:02 PM
export CC=/usr/bin/gcc-3.2 - switch gcc version? ferreter Linux - Software 1 08-20-2003 01:07 AM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 03:12 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration