Software Archive
Read-only legacy content
17060 Discussions

Using external DLL's with Visual Fortran

Intel_C_Intel
Employee
502 Views
Hi,
I'm trying to write some code to download information from a piece of hardware. The manufacturers provided a .dll file with its associated .def and .lib files containing commands to download the data from the serial port. I can compile the code that I have written, but when I try to build the executable file I get the following error message:

Linking...
Creating library Debug/cloud.lib and object Debug/cloud.exp
cloud.exp : warning LNK4070: /OUT:VANTAGEPRO.exe directive in .EXP differs from output filename "Debug/cloud.exe"; ignoring directive
Debug/cloud.exe : warning LNK4086: entrypoint "_mainCRTStartup" is not __stdcall with 12 bytes of arguments; image may not run
cloud.obj : error LNK2001: unresolved external symbol _OPENCOMMPORT_V@0
cloud.obj : error LNK2001: unresolved external symbol _LOADCURRENTVANTAGEDATA_V@0
cloud.obj : error LNK2001: unresolved external symbol _GETOUTSIDETEMP_V@0
cloud.obj : error LNK2001: unresolved external symbol _CLOSECOMMANDPORT_V@0
Debug/cloud.exe : fatal error LNK1120: 4 unresolved externals
Error executing link.exe.

cloud.exe - 5 error(s), 2 warning(s)

I think that this may suggest that there's a line in the manufacturers files which is wrongly directing the output, but I can't find it. Can anyone help?
0 Kudos
1 Reply
Steven_L_Intel1
Employee
502 Views
It looks to me as if the linker thinks that you're trying to build your own DLL with the .DEF file. You shouldn't need both the .DEF and .LIB - just use the .LIB and remove the .DEF from the project.

Steve
0 Kudos
Reply