Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

problem with dev cpp

Good morning

i'm trying to compile a code example to drive a PCI-6541 card under devcpp compiler (with gcc+ MingW).

But the compiler answers:

C:/Program Files/IVI Foundation/IVI/Lib/bc/niHSDIO.lib: file not recognized: File format not recognized

 

Do i have to convert .lib files into .a files to fix the problem? Does NI can provide right libraries? 

Is anybody has already met this problem?

Many thanks

 

 Bonjour

j'essaie de compiler un exemple de code pour piloter une carte PCI-6541 sous dev cpp mais j'ai le message suivant:

C:/Program Files/IVI Foundation/IVI/Lib/bc/niHSDIO.lib: file not recognized: File format not recognized

Que dois je faire pour résoudre ce probleme?

 

Merci d'avance

 

0 Kudos
Message 1 of 18
(3,553 Views)

i put in the project option : -L"C:/Program Files/IVI Foundation/IVI/Lib/bc/niHSDIO.lib"

And now i get this kind of messages:

DynamicAcqAndGen-SourceSynchronous.o(.text+0x17e):DynamicAcqAndGen-SourceSynchronous.c: undefined reference to `niHSDIO_CommitDynamic@4'

 

i guess i didn't really fix, did i?

 

Do you have aby suggestions?

 

Many thanks in advance

0 Kudos
Message 2 of 18
(3,549 Views)

Hello,

 

And thank you for posting here.

 

What is the version of your NI-HSDIO driver? Did you try to fix the driver? Did you try to update the NI-HSDIO driver or the PCI-6541's driver?

 

Can you see your PCI-6541 in Measurement & Automation (MAX)? What version of dev C++ do you have?

 

Do you have Measurement Studio?

 

Regards,

Jérémy C.
NI France

0 Kudos
Message 3 of 18
(3,538 Views)

Bonjour Jeremy

Je n'ai pas encore testé la carte. J'essaie tout d'abord de compiler un exemple.

La version du driver  niHSDIO.dll :1.7.0.49153

Comme la carte est toute recente, je n'ai pas cherché à corriger le driver ni quoi que ce soit d'autre.

La version de dev c++ est 4.9.9.2

Je crois comprendre que si les fichiers .lib fournis avec la carte sont issus de MVC++, alors ils ne sont pas compatibles avec gcc+ Mingw32. Est ce vrai?

Je vais essayer en parallele Microsoft visual c++ express 2010.

 

Merci de me tenir informé si je peux continuer avec devcpp ou si je dois passer sur MVC.

 

Merci d'avance

0 Kudos
Message 4 of 18
(3,533 Views)

I'm sorry but this is an English forum so please write in English.

 

Did you see if your PCI-6541 is detected in Measurement & Automation (MAX)? Which support did you install with the NI-HSDIO drivers (LabVIEW, MeasurementStudio, ...)?

 

It's seems that you are trying to use oriented objects in C++ instead of the basic functions within dll. Unfortunately for you, it needs Measurement Studio to accomplish that.

 

I invite you to test one oh theses examples : C:\Documents and Settings\All Users\Documents\National Instruments\NI-HSDIO\examples\c which are supported in C.

 

Could you send me one of the function that you would like to use?

 

In this help file : C:\Program Files\IVI Foundation\IVI\Drivers\niHSDIO\Documentation\readme.html, you should find several useful information.

 

Please keep me apprised.

 

Regards,

Jérémy C.
NI France

0 Kudos
Message 5 of 18
(3,528 Views)

ok sorry i will write in english.

I'm trying to compile an example provided with the PCI board: DiodeDetection.c

I only use C style and DEV CPP is here configured for C code (ANSI standard enabled).

here is the code:

 

#include <stdio.h>
#include "niHSDIO.h"

int main(void)
{
   /* Execution parameters */
   ViRsrc deviceID = "PXI1Slot2";
   ViConstString channelList = "0-15";
  
   ViUInt32 channelMask = 0xFFFFF; /* all channels */
   ViReal64 genVoltageHigh = 5.0;
   ViReal64 genVoltageLow = -2.0;
   ViReal64 acqVoltageHigh = 4.0;
   ViReal64 acqVoltageLow = -1.25;


   ViUInt32 diodeResultsVcc = 0;
   ViUInt32 diodeResultsGnd = 0;
  
   /* Context parameters */
   ViSession oSes = VI_NULL;
   ViSession iSes = VI_NULL;
   ViStatus error = VI_SUCCESS;
   ViChar oErrDesc[1024];
   ViChar iErrDesc[1024];
  
  
   /* Initialize both sessions */
   niHSDIO_InitGenerationSession(deviceID, VI_FALSE, VI_FALSE, VI_NULL, &oSes);
           
   return;
}

 

 

i guess there is no problem with the compilation but rather with the linker:

 

C:/Program Files/IVI Foundation/IVI/Lib/bc\niHSDIO.lib: file not recognized: File format not recognized

 

Do you confirm?

 

Thanks

 

raphael

 

0 Kudos
Message 6 of 18
(3,526 Views)

Just to clarify... Do you use Linux or Windows? If Windows, 32 or 64bits?

 

Is it you who choose that you linker use niHSDIO.lib in C:/Program Files/IVI Foundation/IVI/Lib/bc\niHSDIO.lib?

Jérémy C.
NI France

0 Kudos
Message 7 of 18
(3,521 Views)

i'm working under windows 32 bits

 

Is it you who choose that you linker use niHSDIO.lib in C:/Program Files/IVI Foundation/IVI/Lib/bc\niHSDIO.lib?

-> i found it in the makefile given in the diode detection example DiodeDetection.mak

 

i made some other trials and now i have this message form the compiler:

....undefined reference to `niHSDIO_InitGenerationSession@20'

 

i guess the problem is still the same as beofre even if the message has changed isn't it?

 

MAny thanks

0 Kudos
Message 8 of 18
(3,512 Views)

Could you try with the .lib in the msc folder? (C:\Program Files\IVI Foundation\IVI\Lib\msc)

 

Do you have the same error?

Jérémy C.
NI France

0 Kudos
Message 9 of 18
(3,506 Views)

i have the same error

  [Linker error] undefined reference to `niHSDIO_InitGenerationSession@20'

0 Kudos
Message 10 of 18
(3,503 Views)