dkp@hadron.UUCP (David K. Purks) (06/22/86)
I recently purchased a copy of Version 3.0 of the Microsoft compiler (which includes Version 3.4 of LINK) and have run into a very strange problem. I can't make LINK find external subroutines in modules or libraries which were not compiled with this compiler. Specifically, I have the GREENLEAF C function library and WINDOWS (public domain version). When I reference functions contained in either of these libraries, LINK is very happy to inform me that they are unresolved externals. I have concluded that it is NOT the linker's fault (I've relinked modules compiled with the old compiler with the new LINK and everything's fine). I have tried the -u and -Zl switches on the compiler to prevent it from putting default library names in the .OBJ header. I have also tried extracting the object modules from the libraries and linking these directly as well as building new libraries. I do not have the source for these routines. At this point, I've run out of ideas. Suggestions (even "give up", if appropriate) would be greatly appreciated. If it's not possible to do, I would just like to know why. Please e-mail suggestions and information directly to me and I will post a summary. Thanks in advance. Dave Purks ..!seismo!hadron!dkp
jcm@ORNL-MSR.arpa (James A. Mullens) (06/23/86)
Microsoft C expects that a "_" is prepended to an external name, so that "abs" becomes "_abs". Other C compilers may not rename their externals according to this convention. Beyond that, I would not expect to be able to combine object modules from 2 different compilers and expect the program to work. Besides the naming conventions of externals, there are other things related to segmentation -- how are segments grouped, is stack segment set to the same thing as data segment; and things like internal data representation and parameter passing on the stack; and things like large versus medium versus small memory model; and things like the compiler referencing internal routines in the C library to do things like "stack overflow checking", "large array referencing" , "8087 emulation", etc. I hope I interpreted your question correctly!