On Sun, 2003-02-09 at 16:59, exits funnel wrote: > Hello, > > I'm new to Linux/Unix development and I'm having a bit > of trouble with something quite basic. I've written a > simple test library located in > ex7Stack.h/ex7Stack.cpp. I am able to build the > library as follows: > > g++ -c -o ex7Stack ex7Stack.cpp > > I then write a small test program located in ex7.cpp > which uses the stack library. I then try to build > this program as follows: > > g++ -o ex7 -L . -l ex7Stack ex7.cpp > > but the linker complains that it can't find > -lex&Stack. > > I can't figure out how to identify my library to the > linker? Can anyone point out what I'm doing wrong? > > ps - I can build everything if I do it in one fell > swoop as follows: > > g++ -o ex7 ex7Stack.cpp ex7.cpp > > __________________________________________________ > Do you Yahoo!? > Yahoo! Mail Plus - Powerful. Affordable. Sign up now. > http://mailplus.yahoo.com > >
I suspect you might be having a little too much fun with command line parameters. :) To build the object file use $ g++ -g stack.cpp This will create a linkable object file called stack.o. Then use $ g++ stack.o main.o -o program This will create an executable called program. Cheers, Ryan -- redhat-list mailing list unsubscribe mailto:[EMAIL PROTECTED]?subject=unsubscribe https://listman.redhat.com/mailman/listinfo/redhat-list