Quantcast
Channel: Instrument Control (GPIB, Serial, VISA, IVI) topics
Viewing all articles
Browse latest Browse all 5625

NI 488.2 static linking

$
0
0

Hello,

 

It seems there is a problem with using the /MT (static link) option when compiling programs using NI488.2. The /MD (dynamic link) option works fine.

The issue is even present when compiling standard example scripts, such as "FindInstruments.c" 

The error messages during compilation are:

1>ni4882.obj : error LNK2019: unresolved external symbol __imp__fread referenced in function _LoadFunction@4
1>ni4882.obj : error LNK2019: unresolved external symbol __imp__fopen referenced in function _LoadFunction@4
1>ni4882.obj : error LNK2019: unresolved external symbol __imp__strncat referenced in function _LoadFunction@4
1>ni4882.obj : error LNK2019: unresolved external symbol __imp__rand referenced in function _LoadFunction@4
1>ni4882.obj : error LNK2019: unresolved external symbol __imp__srand referenced in function _LoadFunction@4
1>ni4882.obj : error LNK2019: unresolved external symbol __imp__time referenced in function _LoadFunction@4

 

There is no problem compiling with /MD.

 

Here are some old threads I found on the topic with no resolution for using static linking, the only "solution" is to use dynamic linking. But many applications (including mine) require static linking...

 

https://forums.ni.com/t5/Measurement-Studio-for-VC/NI4882-OBJ-needed-for-static-MSVC-linkage/td-p/1733378

https://forums.ni.com/t5/Instrument-Control-GPIB-Serial/Unresolved-external-symbols-when-linking-C-with-ni-4882-obj/m-p/3738920/highlight/false#M76432

https://forums.ni.com/t5/Instrument-Control-GPIB-Serial/Linker-error-VC-2008/td-p/1045477

https://social.msdn.microsoft.com/Forums/vstudio/en-US/33d20497-d7c1-4b02-bc99-3bd933d57a3e/ni4882-link-error-with-static-runtime-lib-mtd-option?forum=vcgeneral

 

Has anybody got it to work using 488.2 libraries with static linking?


Viewing all articles
Browse latest Browse all 5625

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>