Subject: Using MS C libs with cygnus
From: [email-masked] ("Grant Leslie")

17 Jan 1997 22:04:06 -0800
Approved: [email-masked]
Distribution: cygnus
Message-ID: <[email-masked]>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
Original-To: "GNU-WIN32" <[email-masked]>
X-MSMail-Priority: Normal
X-Priority: 3
X-Mailer: Microsoft Internet Mail 4.70.1160
Original-Sender: [email-masked]

Here in lies my problem..... Using the X11r6 header files from the Win32
port of X11r6 ( found at ftp.cdrom.com ) and *.a files I created from
X11.dll Xext.dll, etc..  I attempted to compile the xpm library as one of
the first libraries one would need to compile X programs under cygwin32. 
As I mentioned in a previous letter xmahjongg compiled and ran without much
trouble using these libraries.

Problem was some the X libraries where static, existing only as *.lib
files, no cooresponding dll files. And I don't know how to find the X11r6
source for Win32. These would link in just fine for the most part, after I
made a libcrtdll.a file to fill in functions which these all referenced. So
now I'm down to just ONE function!!! Linker output below

making all in ./sxpm...
cc -O -I..    -o sxpm sxpm.o -L../lib -lxpm -lXext -lXi -lXt -lX11 -lXtst
-lICE
-lSM -luser32 -lwsock32 -lcrtdll
/usr/lib/X11/libXt.a(Resources.obj)(.text+0xa40):Resources.c:
       undefined reference to `_chkstk'
/usr/lib/X11/libXt.a(TMaction.obj)(.text+0x17e):TMaction.c:
       undefined reference to `_chkstk'
make: *** [sxpm] Error 1
make: *** [all] Error 2
grantl:/usr/src/xpm-3.4g#

I used nm to see if I could find this in any of the stock cygwin32 library
files, only to find __chkstk in libgcc.a one too many _'s!!!!! ACK

Not being a programmer by trade I have no idea what this function is, let
alone how to call it. If someone could tell me how I think it would be
possible to make small c file which "wrapped" this function. something like

whatevertype _chkstk ( args var,......) {
	return __chkstk ( args var,......);
}

create a chkstk.o file and link this in

 (forgive if this is the wrong approach just winging it here)

That is assuming both ?_chkstk 's are called the same way even....
of course I can't even guess what args it might take, or what type it might
return, or even if it might require a certain header to define those types.

Maybe the exe will just blow up when it does compile but I'd just like to
see if it would work or not, so anyone knows how I might get around this I
would LOVE to hear from you!!!!!! :-) After getting xmajongg to work I hate
to be stopped by one little function call.
	
( The idea is create a Unix like enviroment right? X is part of that....
*shrug* be easier this way than mapping X functions to Win32 wouldn't it?
especially considering the way X works.... ) 

-
For help on using this list, send a message to
"[email-masked]" with one line of text: "help".