Subject: Re: How do I avoid buying MSVC++?
From: [email-masked] (Max Hadley)

2 Jan 1999 18:54:16 -0800
Message-ID: <[email-masked]>
Mime-Version: 1.0
Content-Type: text/plain;
	charset="iso-8859-1"
Content-Transfer-Encoding: 7bit
To: "Cygwin mailing list" <[email-masked]>

Dear list,

Thanks to 'bowman' I have now got one more step nearer a solution to
this problem.
Using the -k switch to dlltool gets round the problem of "The procedure
entry point ibclr@4 could not be located in the dynamic link library
ntgpib.dll". Apparently this switch knows when to decorate names and
when not to. Also on his/her advice:

    #define _declspec(A) extern

gets round the 'Microsoft extensions to the C/C++ language' causing gcc
to fail problem.

However, although I am now getting functions and procedures from the DLL
linked correctly, there still seems to be a problem with DLL data. The
library has four globals, representing the status, error state, etc., of
the hardware. These are processed in the same way as function calls by
nm, generating a .def file which has undecorated variable names in the
EXPORTS section. The application finds something to link to, and all
seemed to be going well, BUT...

The values in these globals seem to be rubbish! The application fails
with a segmentation fault when it attempts to write to them, and they
don't seem to change  as they should when DLL functions are called. Gdb
shows that the run-time addresses of these variables are suspiciously
close to addresses of various functions within the application. I
suspect what is happening is that these symbols are being interpreted as
references to the text segment of the program, not the idata segment.
However I can't figure out how to make gdb tell me the address at which
the various segments are loaded, so I can't be sure.

Can anyone offer any further help & advice? Also, is there any
documentation to dlltool? I couldn't find any.

Max Hadley

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