Re: [PDCurses] PDCurses compilations problems

2007-02-25 Thread William McBrine
P.S. You'll also want to specify the include directory, so that it picks 
up PDCurses' curses.h rather than the system's:

 gcc -I/usr/local/include/xcurses -oappname appname.c -lXCurses

Either that, or modify the source of appname.c to specify xcurses.h 
instead of curses.h; but I don't recommend that.

-- 
William McBrine <[EMAIL PROTECTED]>


Re: [PDCurses] PDCurses compilations problems

2007-02-25 Thread William McBrine
On Fri, 23 Feb 2007, Gareth Brown wrote:

> I've been racking my head for hours trying to compile PDCurses programs 
> on my Mac OS X installation, and Linux.  I'm in a dire need of help.  
> What I'm trying todo is compile the demos included separately using the 
> following;
> 
> $ gcc firework.c -lpdcurses -o firework
> 
> and get the following error;
> 
> /usr/bin/ld: can't locate file for: -lpdcurses
> collect2: ld returned 1 exit status

The "-l" option tells gcc, "take the following name, munge it in a system- 
specific way, and search the library path for the name". In Linux, it will 
prefix the name with "lib", and suffix it with ".so" or ".a"; in other 
words, it will look for the files "libpdcurses.so" and "libpdcurses.a". In 
Mac OS X, the suffix for shared libraries is ".dylib" instead of ".so".

So, have you got one of those files in your library path? Probably not. 
For one thing, the X11 version of PDCurses (which is what you have in 
Linux or Mac OS X), for historic reasons, is built with the name "XCurses" 
by default. The corresponding option would thus be "-lXCurses" rather than 
"-lpdcurses". You could change it to "pdcurses"; but if you had, you'd 
know it.

Secondly, you don't have it in your library path unless you've installed 
it there. That would mean you either ran "make install" (or perhaps "sudo 
make install"), with no errors, or else manually copied it to an 
appropriate place.

Now, "make install" doesn't work correctly in Mac OS X, because make sees 
the file "INSTALL" and thinks it satisfies the rule. This only happens in 
Mac OS X (and not Linux or other *nix), because of its case-preserving but 
non-case-sensistive file system. (Fixed in PDCurses CVS. You can fix it by 
adding a second colon after "install:" in the Makefile.)

You can also specify the full pathname to the library file directly. In 
that case, you don't use "-l".

Example -- if it's installed:

 gcc -ofirework firework.c -lXCurses

If it's not installed:

 gcc -ofirework firework.c ../pdcurses/libXCurses.a

> I'm completely stuck, should I put a file in /usr/bin/ld ?

/usr/bin/ld is the name of the linker executable, not a directory.

-- 
William McBrine <[EMAIL PROTECTED]>


Re: [PDCurses] PDCurses compilations problems

2007-02-23 Thread Robert Zaleski
Hey Gareth,

   To help ld find the library, assuming it's not somewhere like
/usr/lib, you need to either add a 
-L  

so it can find the library.  I believe you can also do 

-l /path/to/pdcurses/lib/libpdcurses.a 

and it will work correctly as well.

   I hope that helps.

Robert

--- Gareth Brown <[EMAIL PROTECTED]> wrote:

> Hello,
> 
> I've been racking my head for hours trying to compile PDCurses  
> programs on my Mac OS X installation, and Linux.  I'm in a dire need 
> 
> of help.  What I'm trying todo is compile the demos included  
> separately using the following;
> 
> $ gcc firework.c -lpdcurses -o firework
> 
> and get the following error;
> 
> /usr/bin/ld: can't locate file for: -lpdcurses
> collect2: ld returned 1 exit status
> 
> I'm completely stuck, should I put a file in /usr/bin/ld ?  I've got 
> 
> gcc installed and all the apple development tools.  Do I have the  
> compile syntax correct ?  I've looked in the make file in the demos  
> folder, but couldn't figure which flags to use.
> 
> Thanks for your time
> 
> 
> Gareth
> 


Robert Zaleski
[EMAIL PROTECTED]

You must realize that the computer has it in for you.  The irrefutable
proof of this is that the computer always does what you tell it to do.


 

Food fight? Enjoy some healthy debate 
in the Yahoo! Answers Food & Drink Q&A.
http://answers.yahoo.com/dir/?link=list&sid=396545367


[PDCurses] PDCurses compilations problems

2007-02-23 Thread Gareth Brown

Hello,

I've been racking my head for hours trying to compile PDCurses  
programs on my Mac OS X installation, and Linux.  I'm in a dire need  
of help.  What I'm trying todo is compile the demos included  
separately using the following;


$ gcc firework.c -lpdcurses -o firework

and get the following error;

/usr/bin/ld: can't locate file for: -lpdcurses
collect2: ld returned 1 exit status

I'm completely stuck, should I put a file in /usr/bin/ld ?  I've got  
gcc installed and all the apple development tools.  Do I have the  
compile syntax correct ?  I've looked in the make file in the demos  
folder, but couldn't figure which flags to use.


Thanks for your time


Gareth