LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

spectracom linker undefined symbols

Hi.

I am running CVI 2015 with a simple app that reads data from a spectracom GPS device. Spectracom publish a set of libraries to access the device but when I build the app, I see the following linker errors.

 Link GeoMagCalc.exe
  error: Undefined symbol '__imp___iob_func' referenced in "c:\Program Files (x86)\Spectracom\TSYNC PCI\Dev64\TPro.lib". 
  error: Undefined symbol '__imp__snwprintf_s' referenced in "c:\Program Files (x86)\Spectracom\TSYNC PCI\Dev64\TPro.lib". 
  error: Undefined symbol '__imp_strcat_s' referenced in "c:\Program Files (x86)\Spectracom\TSYNC PCI\Dev64\TPro.lib". 
  error: Undefined symbol '__imp_wprintf' referenced in "c:\Program Files (x86)\Spectracom\TSYNC PCI\Dev64\TPro.lib".

I guess that these are Windows SDK calls and I need to link to another library. I have done some googling around and this seems to be a common problem in Microsoft Visual C++ 2015 but I have not found a solution.

Can anybody please offer any help.

0 Kudos
Message 1 of 4
(3,155 Views)

Hi Stephen,

 

I'm wondering if it is related to this problem i.e. changes in Visual Studio 2015 so the printf and scanf family of functions are defined inline:

http://stackoverflow.com/questions/30412951/unresolved-external-symbol-imp-fprintf-and-imp-iob-func-...

 

There are a number of fix suggestions on that page. Let us know if any of them help you.

 

Best regards,

 

Leah

0 Kudos
Message 2 of 4
(3,112 Views)

Hi Leah

Thanks for the reply. I think that you are correct with regarsds to the changes in VC++ 2015. I understand that CVI uses the CLANG compiler, is this based upon the Microsoft compiler and hence these changes of depricating some of stdlib have come from?

I have also found a copy of legacy_stdio_definitions.lib from VS 2015 and linked against these, but this has created further linker errors as below.

It looks like I still have to find further libs to link to.

 

Link GeoMagCalc.exe
  error: Undefined symbol '__acrt_iob_func' referenced in "c:\svn_mirror\projects\CalSS\GeoMagCalculator\branches\dev1\source\legacy_stdio_definitions.lib". 
  error: Undefined symbol '__imp___iob_func' referenced in "c:\Program Files (x86)\Spectracom\TSYNC PCI\Dev64\TPro.lib". 
  error: Undefined symbol '__imp_strcat_s' referenced in "c:\Program Files (x86)\Spectracom\TSYNC PCI\Dev64\TPro.lib". 
  error: Undefined symbol '__stdio_common_vfprintf' referenced in "c:\svn_mirror\projects\CalSS\GeoMagCalculator\branches\dev1\source\legacy_stdio_definitions.lib". 
  error: Undefined symbol '__stdio_common_vfprintf_p' referenced in "c:\svn_mirror\projects\CalSS\GeoMagCalculator\branches\dev1\source\legacy_stdio_definitions.lib". 
  error: Undefined symbol '__stdio_common_vfprintf_s' referenced in "c:\svn_mirror\projects\CalSS\GeoMagCalculator\branches\dev1\source\legacy_stdio_definitions.lib". 
  error:  

0 Kudos
Message 3 of 4
(3,106 Views)

 

Hi Stephen,

 

Awwh no, I hate it when fixing one problem creates 2 more! I'm afraid I don't know much about the CLANG compiler, hopefully someone else here might be able to answer that question.

 

I take it that you cannot recompile the Spectracom libraries to work in 2015, but perhaps you could get in contact with them and explain the situation?

 

 

Also, the Stack Overflow page suggests defining __iob_func() etc. yourself e.g.

extern "C" { FILE __iob_func[3] = { *stdin,*stdout,*stderr }; }

 

Would that be an option?

 

Best regards,

 

Leah

0 Kudos
Message 4 of 4
(3,098 Views)