1

Trying to compile old WATCOM FORTRAN project with an updated set of third-party OBJ files.

Linker sees the third-party functions, but complains about a number (all?) of Windows API functions.

I was adding different LIB and OBJ files found under WATCOM installation directory, that seemed to have appropriate names - nothing is changing in the errors from linker. It starts by saying that referenced GetVersionExA cannot be found, and proceeds with a number of similar messages for other Windows API functions to ReadFile/WriteFile, where it says - too many errors.

I am getting a feeling, that it has something to do with function decorations - "_", "@" etc symbols added to function names, but I may, of course, be wrong.

Any suggestion of where to look or what to try?

Igor
  • 15,833
  • 1
  • 27
  • 32
  • Since this is old code, you may need an old version of the SDK. What version are you linking against? – theB Jun 18 '16 at 10:06

2 Answers2

1

you must link with Kernel32.lib (GetVersionExA,ReadFile,WriteFile - here), also may be need be include some another LIBs

RbMm
  • 31,280
  • 3
  • 35
  • 56
  • Thank you, I tried that. I am getting a feeling, that it has something to do with function decorations - "_", "@" etc symbols added to function names. – Igor Jun 17 '16 at 21:35
  • if you build on x86 - yes, functions is decorated. say GetVersionExA -> __imp__GetVersionExA@4, __imp__ReadFile@20. need view exactly error messages. also which libraries you add ? or link with /verbose option - need viwe which libraries use linker in build and in which form he search for imported functions – RbMm Jun 17 '16 at 21:52
0

Thanks to everybody who has read my question.

It turned out that I was using an OBJ file (out of available three) meant for Borland/Embarcadero products. The other two were COFF and OMF files suitable for different compilers - the OMF file had decorations of Windows API functions matching the ones in the old kernel32.lib from WATCOM.

Igor
  • 15,833
  • 1
  • 27
  • 32