Help on gcc command


 
Thread Tools Search this Thread
Operating Systems Solaris Help on gcc command
# 1  
Old 09-03-2009
Tools Help on gcc command

Hi All,

I have added a gcc 3.4.6 package into Solaris 10 recently and I didnot receive any error on that.

I have set the path of this gcc to /usr/local/bin

I tried executing a simple Hello World 'C' program but I get the following error "bash: /usr/local/bin/gcc: invalid argument".

I cross-checked if there is any error in adding packages but there was none. It displayed message "successfully installed"

Can someone help me in executing the 'C' programs using gcc.

Thanks in advance.
# 2  
Old 09-03-2009
Have you compiled your program? How?

Regards
# 3  
Old 09-03-2009
Hi,
Compiling the program........I tried giving

bash#]gcc first.c -o first
where first.c is C program.

I also tried
bash#]gcc first.c.

In either of the cases same error.......

I just gave
gcc and hit Enterkey...... same error

"bash: /usr/local/bin/gcc: invalid argument".
# 4  
Old 09-03-2009
gcc -o first first.c
# 5  
Old 09-03-2009
Thanks,

But that didnot work.

I get the same error.....

"bash: /usr/local/bin/gcc: Invalid argument"

i guess the above said command gcc -o first first.c must generate an elf file which can then be executed. But irrespective of the argument, the command is giving above error.
# 6  
Old 12-08-2009
Quote:
Originally Posted by EmbedUX
I have added a gcc 3.4.6 package into Solaris 10 recently and I didnot receive any error on that.
I have set the path of this gcc to /usr/local/bin
I tried executing a simple Hello World 'C' program but I get the following error "bash: /usr/local/bin/gcc: invalid argument".
I cross-checked if there is any error in adding packages but there was none. It displayed message "successfully installed"
Can someone help me in executing the 'C' programs using gcc.
Hi, I have the same problem. Did you find a solution for this Problem?
Thx Sebastian
# 7  
Old 12-08-2009
/usr/sfw/bin/gcc should just work with Solaris 10. No need to install another instance, especially if the latter doesn't work for some reason.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Programming

Can't get 'gcc' to work

On a SCO Unix system, the gcc command returns gcc: syntax error at line 1: `)' unexpected regardless of what else in on the command line. Thus far I have added "INCLUDE=" and the path to stdio.h which only had an include statement to ast_stdio.h to my start up procedure. I am trying to update... (2 Replies)
Discussion started by: wbport
2 Replies

2. UNIX for Dummies Questions & Answers

Help with gcc and g++

Hi, I have recently got a job in unix, now training is going on and we have been practicing on telnet, so to practice at home I have installed vmware(virtual machine) and planning to download ubuntu. So my doubt is that whether I can write c and cpp progs in vi editor and can I run them by default... (5 Replies)
Discussion started by: vishal.973s
5 Replies

3. Solaris

command 'cc' failed even though gcc is installed

I'm trying to build some python modules on a Solaris 10 machine. It has gcc as /usr/sfw/bin/gcc. # CC=gcc python setup.py build running build running build_py running build_ext cc -c actread.c -o actread.o unable to execute cc: No such file or directory error: command 'cc' failed with exit... (8 Replies)
Discussion started by: aussieos
8 Replies

4. AIX

Gcc for AIX

Hi, I am working with AIX5.3 and I downloaded the gcc-4.2.4.tar.bz2 from the site and when I am trying to un-tar it.It is throwing error-- Please help me to resolve it. Thanks in Advance.. (6 Replies)
Discussion started by: smartgupta
6 Replies

5. Ubuntu

./configure command Error while trying to install GCC compiler on unix machine

Hi, I need to install the GCC compiler on a my Linus machine. First step is to run the ./configure command and here we need to specify ./configure --target="target machine name (CPU type-Manufacturer-OS) or other way would be just give the command ./configure and it guesses the target name... (11 Replies)
Discussion started by: viji19812001
11 Replies

6. Solaris

gcc -3.4.6 installation help

Hi, I want to install the gcc-3.4.6 on solaris 9.5 , in order to compile perl 5.8.8 . I have the following packages . gcc-3.4.6.tar ibiconv-1.11-sol9-sparc-local.gz gcc-3.4.6-sol9-sparc-local libiconv-1.11.tar.gz Where can I find the necessary documents or... (4 Replies)
Discussion started by: sonu2die4
4 Replies

7. Solaris

Installing gcc - recieve error message gcc : cannot execute

AIM- Install Oracle 11g on Solaris using VMWare Steps 1.Logged on as root 2.Created subfolders à /usr/local/bin & /usr/local/bin/gcc 3.Downloaded gcc & libiconv & unzipped them on my harddrive & burnt them on CD 4.Copied files from CD to /usr/local/bin/gcc 5.Terminal (root) à pkgadd -d... (8 Replies)
Discussion started by: Ackers
8 Replies

8. Programming

gcc compiler

i write c++ code it run perfectely with g++ compiler but same code when i compile with GCC compiler it gives linker error , followed these linker error /tmp/ccfZtXOQ.o(.text+0x22): In function `main': conf_system.cpp: undefined reference to `operator new(unsigned int)'... (5 Replies)
Discussion started by: munnu
5 Replies

9. Programming

Gcc

Dear all, Any body please guide, i require a C which will run in Linux environment. Its urgent please. warm regards, Senthil K (1 Reply)
Discussion started by: Senthil
1 Replies

10. Programming

GCC (solaris)

I packed gcc to /usr/local/ with pkgadd and when I wan't to compile a c code file it says gcc: no file how do I configure gcc on Solaris 8 plz help (1 Reply)
Discussion started by: CreamHarry
1 Replies
Login or Register to Ask a Question