LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
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


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

Rep: Reputation: 0
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
 
Old 01-17-2005, 02:05 PM   #2
jailbait
LQ Guru
 
Registered: Feb 2003
Location: Blue Ridge Mountain
Distribution: Linux Mint 17, Linux Mint 18
Posts: 7,822

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

Rep: Reputation: 75
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, 04:58 PM   #4
ag01578
LQ Newbie
 
Registered: Jan 2005
Posts: 7

Rep: Reputation: 0
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
 
Old 01-17-2005, 06:07 PM   #5
__J
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, 07:04 PM   #6
ag01578
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:

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.
 
  


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


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