Re: [PDCurses] Static linking?

2011-07-21 Thread Daniel Goldman

I got some encouraging comments offline. I know
there must be some way the static link works,
because it works somehow for others. And it
used to work for me!

In response to one of the emails I got, I'm pretty
sure I'm NOT using the SDL version. I was using the
".a" file under win32 directory. I don't even
know what SDL is...

Using the instructions in win32\README, I tried
compiling to the ".a" static library myself.

1) The library compiled (after changing copy to cp),
but I got some error messages. Any suggestions?

**

C:\pdcurses\win32>make -f mingwin32.mak
gcc -c -O2 -Wall -I.. ../pdcurses/addch.c
. Omitted other .c files
gcc -c -O2 -Wall -I.. ../win32/pdcutil.c
ar rcv pdcurses.a addch.o addchstr.o addstr.o attr
r.o color.o delch.o deleteln.o deprec.o getch.o ge
o initscr.o inopts.o insch.o insstr.o instr.o kern
outopts.o overlay.o pad.o panel.o printw.o refresh
 slk.o termattr.o terminfo.o touch.o util.o window
 pdcgetsc.o pdckbd.o pdcscrn.o pdcsetsc.o pdcutil.
a - addch.o
... Omitted other .o files
a - pdcutil.o

cp pdcurses.a panel.a
gcc -O2 -Wall -I.. -otestcurs.exe ../demos/testcurs.c pdcurses.a
pdcurses.a(kernel.o):kernel.c:(.text+0x17c): multiple definition of `resetty'
pdcurses.a(d000233.o):(.text+0x0): first defined here
pdcurses.a(kernel.o):kernel.c:(.text+0x190): multiple definition of `savetty'
pdcurses.a(d000239.o):(.text+0x0): first defined here
pdcurses.a(kernel.o):kernel.c:(.text+0x1a4): multiple definition of `curs_set'
pdcurses.a(d55.o):(.text+0x0): first defined here
pdcurses.a(kernel.o):kernel.c:(.text+0x1f0): multiple definition of `napms'
pdcurses.a(d000194.o):(.text+0x0): first defined here
pdcurses.a(pdcsetsc.o):pdcsetsc.c:(.text+0xb0): multiple definition of `PDC_set_
blink'
pdcurses.a(d14.o):(.text+0x0): first defined here
collect2: ld returned 1 exit status
make: *** [testcurs.exe] Error 1

*

2) Anyway, the library did compile. So I used the resulting
pdcurses.a file (after renaming to libpdcurses.a). But when
I try to compile my program, there are some more "multiple
definition" errors at the link step. Any suggestions here?



c:/sw/mingw/bin/gcc.exe -funsigned-char -Wall -Wextra -Werror -o c:/ehdp/vn/vn.exe cgm1.o 
cur1.o event1.o externs.o file1.o lib1.o main1.o out1.o plot1.o pop1.o rate1.o share1.o 
var1.o win1.o -Lc:/pdcurses/win32 -Lc:/ehdp/vn/lib -lvn -lpdcurses -lm
c:/pdcurses/win32\libpdcurses.a(color.o):color.c:(.text+0x50): multiple definition of 
`init_pair'

c:/pdcurses/win32\libpdcurses.a(d000109.o):(.text+0x0): first defined here
c:/pdcurses/win32\libpdcurses.a(color.o):color.c:(.text+0x420): multiple definition of 
`start_color'

c:/pdcurses/win32\libpdcurses.a(d000273.o):(.text+0x0): first defined here
collect2: ld returned 1 exit status



Do I need to compile pdcurses.a? Or should I be able to use
pdcurses.a that came with the distribution?

Thanks

Daniel Goldman wrote:

Hi again,

I got a private response by email:

 >> When linking statically, -lXCurses must come before the list of
 >> objects to include:

 >> ${TARGET}: $O
 >>${CC} -o $@ ${LDFLAGS} $O

I assume -lXCurses means -lpdcurses. Anyway, I thought libraries
always came after objects when compiling. But, for the sake of
completeness, here's what I tried:

A) gcc -o vn.exe $(OBJS) -Lc:/pdc/win32 -Lc:/vn -lpdcurses -lvn -lm
B) gcc -o vn.exe $(OBJS) -Lc:/pdc/win32 -Lc:/vn -lvn -lpdcurses -lm
C) gcc -o vn.exe -Lc:/pdc/win32 -Lc:/vn -lvn -lpdcurses -lm  $(OBJS)
D) gcc -o vn.exe -Lc:/pdc/win32 -lpdcurses $(OBJS) -Lc:/vn -lvn -lm

A) results in undefined reference to curses functions (eg, waddstr)
B) compiles, but then requires the pdcurses.dll to run
C) results in undefined references to functions in libvn.a
D) results in undefined reference to curses functions (eg, waddstr)

In my continuing floundering, I also tried using "-static" gcc
flag, but that did not help. Could someone please advise what
I'm doing wrong or need to do different?

Thanks,
Daniel Goldman

Daniel Goldman wrote:

Hi,

I swear I used to statically link pdcurses into an
application. I few months back (for some reason) I
reinstalled pdcurses. Now I can't static link.

I use pdcurses 3.4 / mingw gcc. I'm very familiar with
makefiles and gcc. I'm sure it's something I'm doing
wrong. I've tried different ways. But I'm kind of
floundering. It compiles OK. But when it runs, it
gives an error message unless the DLL is in the path.

So I'm using pdcurses.dll for now. But I don't want
to be limited. I'd like to have static linking too.

I looked through the docs and mailing list, and came
up empty. Am I supposed to be able to statically link
libpdcurses.a file? Any example? Do I need to recompile
.a library archive? Could someone please advise?

Thanks,
Daniel Goldman





Re: [PDCurses] Static linking?

2011-07-20 Thread Daniel Goldman

Hi again,

I got a private response by email:

>> When linking statically, -lXCurses must come before the list of
>> objects to include:

>> ${TARGET}: $O
>>${CC} -o $@ ${LDFLAGS} $O

I assume -lXCurses means -lpdcurses. Anyway, I thought libraries
always came after objects when compiling. But, for the sake of
completeness, here's what I tried:

A) gcc -o vn.exe $(OBJS) -Lc:/pdc/win32 -Lc:/vn -lpdcurses -lvn -lm
B) gcc -o vn.exe $(OBJS) -Lc:/pdc/win32 -Lc:/vn -lvn -lpdcurses -lm
C) gcc -o vn.exe -Lc:/pdc/win32 -Lc:/vn -lvn -lpdcurses -lm  $(OBJS)
D) gcc -o vn.exe -Lc:/pdc/win32 -lpdcurses $(OBJS) -Lc:/vn -lvn -lm

A) results in undefined reference to curses functions (eg, waddstr)
B) compiles, but then requires the pdcurses.dll to run
C) results in undefined references to functions in libvn.a
D) results in undefined reference to curses functions (eg, waddstr)

In my continuing floundering, I also tried using "-static" gcc
flag, but that did not help. Could someone please advise what
I'm doing wrong or need to do different?

Thanks,
Daniel Goldman

Daniel Goldman wrote:

Hi,

I swear I used to statically link pdcurses into an
application. I few months back (for some reason) I
reinstalled pdcurses. Now I can't static link.

I use pdcurses 3.4 / mingw gcc. I'm very familiar with
makefiles and gcc. I'm sure it's something I'm doing
wrong. I've tried different ways. But I'm kind of
floundering. It compiles OK. But when it runs, it
gives an error message unless the DLL is in the path.

So I'm using pdcurses.dll for now. But I don't want
to be limited. I'd like to have static linking too.

I looked through the docs and mailing list, and came
up empty. Am I supposed to be able to statically link
libpdcurses.a file? Any example? Do I need to recompile
.a library archive? Could someone please advise?

Thanks,
Daniel Goldman



[PDCurses] Static linking?

2011-07-18 Thread Daniel Goldman

Hi,

I swear I used to statically link pdcurses into an
application. I few months back (for some reason) I
reinstalled pdcurses. Now I can't static link.

I use pdcurses 3.4 / mingw gcc. I'm very familiar with
makefiles and gcc. I'm sure it's something I'm doing
wrong. I've tried different ways. But I'm kind of
floundering. It compiles OK. But when it runs, it
gives an error message unless the DLL is in the path.

So I'm using pdcurses.dll for now. But I don't want
to be limited. I'd like to have static linking too.

I looked through the docs and mailing list, and came
up empty. Am I supposed to be able to statically link
libpdcurses.a file? Any example? Do I need to recompile
.a library archive? Could someone please advise?

Thanks,
Daniel Goldman


Re: [PDCurses] Static Linking

2007-09-19 Thread William McBrine

On Wed, 19 Sep 2007, [EMAIL PROTECTED] wrote:


Is there a pre-compiled library for Windows that will allow me to
statically link to pdcurses


Why not compile it yourself? The default is to build a static library.

--
William McBrine <[EMAIL PROTECTED]>


[PDCurses] Static Linking

2007-09-19 Thread knoobschoolbus
Is there a pre-compiled library for Windows that will allow me to
statically link to pdcurses (I assume I would do this using gcc
-static). I'm compiling using minGW for Windows XP and it works
brilliantly, but I would like to be able to use my executables on
computers where I do not have pdcurses.dll in C:\Windows\system
(whether it be a friends computer or one I do not have access to put
files there). If I'm going about static linking completely the wrong
way, information about how to do it would be much appreciated.