[ale] help with lib

Davis, Ringo Lester rdavis at panasonicatlanta.com
Wed Jan 26 11:15:53 EST 2005


Weirder and weirder.

I tried this

gcc sailor.c navigate.o -o sailor -L/usr/lib/curses  -L/usr/lib/termcap
-lcurses -ltermcap -lm

 

because those are the directories the files are in.

It then compiles without errors.

I run the program by going up a directory and typing ./demo.

Demo is the following file

src/sailor < test_worlds/test1

 

so it runs sailor.exe and takes test1 as its parameter.

But here is the error I get.

./demo: line 1: 8155 Segmentation Fault src/sailor < test_worlds/test1.

 

I know the program runs on Cygwin, Also if I run the example program
without recompiling it works, but compiling makes it give the above
error, so something is still wrong.

Any ideas?

Thanks

Ringo

 

 

 

-----Original Message-----
From: ale-bounces at ale.org [mailto:ale-bounces at ale.org] On Behalf Of
Jason Day
Sent: Wednesday, January 26, 2005 10:55 AM
To: Atlanta Linux Enthusiasts
Subject: Re: [ale] help with lib

 

On Wed, Jan 26, 2005 at 09:17:57AM -0500, ringo davis wrote:

> That fixes the curses err, now it complains about libtermcap (which is
also 

> installed).

[snip]

 

The ldconfig program maintains a cache of shared object files, aka DLLs.

It looks like your program is trying to link to a static library file,

however, not a shared library.  So, even though ldconfig knows how to

find libtermcap.so, that doesn't help because your program wants to link

with libtermcap.a.  Make sure the link line in your Makefile passes the

library path with the -L option.

 

For example:

 

       gcc -o foo foo.o bar.o baz.o -ltermcap -L/usr/lib

 

The -L option tells gcc to look in the /usr/lib directory for .a files.

This of course assumes that libtermcap.a is in fact in /usr/lib.

 

HTH,

Jason

-- 

Jason Day                                       jasonday at

http://jasonday.home.att.net                    worldnet dot att dot net

 

"Of course I'm paranoid, everyone is trying to kill me."

    -- Weyoun-6, Star Trek: Deep Space 9

_______________________________________________

Ale mailing list

Ale at ale.org

http://www.ale.org/mailman/listinfo/ale 
 
 --Appended by Panasonic Mobile Communications
 Development Corporation of U.S.A.-----This e-mail
 and any attachments may contain information that is
 confidential, proprietary, privileged or otherwise
 protected by law. The information is solely intended
 for the named addressee (or a person responsible for
 delivering it to the addressee). If you are not the
 intended recipient of this message, you are not
 authorized to read, print, retain, copy or
 disseminate this message or any part of it. If you
 have received this e-mail in error, please notify
 the sender immediately by return e-mail and delete
 it from your computer.
-------------- next part --------------
An HTML attachment was scrubbed...




More information about the Ale mailing list