Subject: Re: DLL creation problem
From: Steve Jorgensen <[email-masked]>
To: [email-masked] (Bill Tutt)
Cc: [email-masked], [email-masked], [email-masked]
Date: Fri, 29 Oct 1999 17:48:08 -0600 (MDT)

This seems to be working.. Thanks to Bill and DJ for their help.

	So, did microsoft go into a room and brainstorm the hardest way
	to do shared libraries or is this an artifact of hacking gcc to
	do dll's? :)

					Steve
Bill Tutt wrote
>> > From: DJ Delorie [mailto:[email-masked]]
>> > > 	So how do I make the above assignment (or any global variable
>> > > 	assignemnt) work as expected?
>> > 
>> > What we do is, in the header where you prototype the variable
>> > (i.e. the "extern int foo;" line), add a directive like this:
>> > 
>> > 	extern int foo __declspec(dllimport);
>> > 
>> > Note that you should *only* do this for the application; don't do it
>> > for the dll itself.
>> > 
>> 
>> Whats typically done is something like this:
>> #ifdef BUILD_XYZ
>> #define XYZAPI __declspec(dllexport)
>> #else
>> #define XYZAPI __declspec(dllimport)
>> #endif
>> 
>> and just write a header file like so:
>> 
>> XYZ.h might contain:
>> 
>> extern int foo XYZAPI;
>> 
>> Then when you're building the DLL, just define BUILD_XYZ.
>> 
>> Bill
>> 

-- 
-----------------------------------------------------------
Steven Jorgensen      [email-masked]	    [email-masked]
------------------------------+----------------------------
Khoral Research Inc.          | PHONE: (505) 837-6500
6200 Uptown Blvd, Suite 200   | FAX:   (505) 881-3842
Albuquerque, NM 87110         | URL: http://www.khoral.com/
-----------------------------------------------------------

--
Want to unsubscribe from this list?
Send a message to [email-masked]