How do I avoid buying MSVC++?

Max Hadley max@susato.demon.co.uk
Sun Jan 31 23:52:00 GMT 1999


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
"gnu-win32-request@cygnus.com" with one line of text: "help".



More information about the Cygwin mailing list