c++ , Linking

c++ , Linking

Post by Nima Negahba » Mon, 04 May 1998 04:00:00



I am able to compile things but how do I link it so i can run it, Ive
already tried chmod 700 and that does not work.

Any Suggestions

thanks,

 
 
 

c++ , Linking

Post by Ataraxi » Mon, 04 May 1998 04:00:00



> I am able to compile things but how do I link it so i can run it, Ive
> already tried chmod 700 and that does not work.

I'm not sure what you mean, but with g++ you can do this:

% g++ -c file1.cpp (-c = complile but don't link, generate .o file)
% g++ -c file2.cpp
...
% g++ file1.o file2.o ...
% a.out

--
Ataraxia -- Official Poet of alt.books.m-lackey
http://130.203.1.10/~rkohler/
        Winter has come too late
        too close beside me.
        How can I chase away
        all these fears deep inside?
                -- Enya, "Exile"

 
 
 

c++ , Linking

Post by Paul Harri » Tue, 05 May 1998 04:00:00



> I am able to compile things but how do I link it so i can run it, Ive
> already tried chmod 700 and that does not work.

> Any Suggestions

> thanks,


generally, if I am compiling a whole pile of .c or whatever files, I
just type:

gcc firstone.c secondone.c continue.c -o nameOfExecutable

this will compile, link and spit out an executable of the specified name
:)

otherwise u could write a make file... just to automate things :)

hope that helps, Paul

 
 
 

1. Solaris 8 C++ Link

We are currently experiencing problems linking with a Solaris 8 /
Workshop 6
Update 1 set up on Sun Ultra 5s. All C++ programs seem to compile OK but
symbol referencing problems are encountered when trying to link.
There was no problem either linking or compiling with Solaris 7 /
Workshop 5.

The path set up is:

setenv PATH /bin
setenv PATH $PATH\:/usr/bin
setenv PATH $PATH\:/usr/ucb
setenv PATH $PATH\:/etc
setenv PATH $PATH\:/usr/openwin/bin
setenv PATH $PATH\:/sbin
setenv PATH $PATH\:/usr/sbin
setenv PATH $PATH\:/opt/NSCPcom
setenv PATH $PATH\:/usr/ccs/bin
setenv PATH $PATH\:/opt/SUNWspro/WS6U1/bin
setenv PATH $PATH\:/opt/SUNWspro/WS6U1/include
setenv PATH $PATH\:/opt/SUNWspro/WS6U1/lib/CC4
setenv PATH $PATH\:$ILVHOME/studio/sparc_5_5.0
setenv PATH $PATH\:$ILRHOME/bin/solaris

Are we missing something or is there a known error in WS6 Update 1 that
is
fixed in WS6 Update 2?

2. Best video card under $300

3. libjpeg with C++, linking error!

4. fghj

5. C and C++, linking object files

6. How to port curses program in UNIX?

7. C and C++ linking (GCC)

8. bootpd messages running Jetadmin

9. C++ Link problem

10. C++ linking problems

11. C++ linking

12. C++ link error

13. C++ linking problem creating a static lib from another static lib.