delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/1999/11/01/19:18:06

Mailing-List: contact cygwin-help AT sourceware DOT cygnus DOT com; run by ezmlm
List-Unsubscribe: <mailto:cygwin-unsubscribe-archive-cygwin=delorie DOT com AT sourceware DOT cygnus DOT com>
List-Subscribe: <mailto:cygwin-subscribe AT sourceware DOT cygnus DOT com>
List-Archive: <http://sourceware.cygnus.com/ml/cygwin/>
List-Post: <mailto:cygwin AT sourceware DOT cygnus DOT com>
List-Help: <mailto:cygwin-help AT sourceware DOT cygnus DOT com>, <http://sourceware.cygnus.com/ml/#faqs>
Sender: cygwin-owner AT sourceware DOT cygnus DOT com
Delivered-To: mailing list cygwin AT sourceware DOT cygnus DOT com
From: Steve Jorgensen <steve AT khoral DOT com>
Message-Id: <199911020017.RAA23148@benson>
Subject: More DLL and global var problems
To: cygwin AT sourceware DOT cygnus DOT com
Date: Mon, 1 Nov 1999 17:17:04 -0700 (MST)
X-Mailer: ELM [version 2.4 PL25]

	I managed to get DLL's working on our non-X based
	libraries, but I'm having a problem with our X libraries.
	Khoros has a large number of it's own widgets, defined in
	several different libraries, and though it's in C, 
	it's possible to do support basic inheritance via
	Xt.

	Each widget has a class initializer which is a global
	variable.  This initializer is used by subclasses to initialize
	the "superclass" part of the variable.  Anyway, the problem
	I'm seeing is this.  If the superclass initializer variable
	is in a different DLL than the current DLL I'm compiling, I
	get the following while compiling:

Browser.c:174: Internal compiler error, output_operand_lossage `invalid expression on as operand'
{standard input}: Assembler messages:
{standard input}:1150: Warning: Partial line at end of file ignored

	and then it just hangs.

	The relevant part of the code is as follows:

171:XvwBrowserWidgetClassRec xvwBrowserWidgetClassRec =
172:{
173:  {
174:    (WidgetClass) &xvwManagerWidgetClassRec,
	....

	The xvwManagerWidgetClassRec is the global variable from the
	other DLL, and it is declared with __declspec(dllexport) when
	I compile the library containing it, and __declspec(dllimport) when
	it is being used by other libraries/applications.  

	If the above example isn't clear enough, you can go look at
	Core.c in the X11R6 distribution and search for where the
	widgetClassRec variable is defined and initialized.

	So, any idea what I'm doing wrong?  I have a feeling these
	variables have to be treated differently, because I can't
	find any of this __declspec(dllexport) or __declspec(dllimport)
	in the X include files, and yet it does subclassing the
	same way, and is distributed in DLL form.

	Should I not do the special gcc declaration for these variables?
	If that's the case, how do you tell which global vars need
	the special externing and which don't?

						Steve

-- 
-----------------------------------------------------------
Steven Jorgensen      steve AT khoral DOT com	    steve AT haunt DOT com
------------------------------+----------------------------
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 cygwin-unsubscribe AT sourceware DOT cygnus DOT com

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019