04-13-2011 08:03 AM
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
04-13-2011 08:26 AM
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
04-14-2011 07:26 AM
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
04-14-2011 08:23 AM
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
04-14-2011 09:14 AM
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
04-14-2011 09:25 AM
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
04-14-2011 09:40 AM
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
04-14-2011 10:14 AM
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
04-14-2011 10:29 AM
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
04-14-2011 10:35 AM
i have the same error
[Linker error] undefined reference to `niHSDIO_InitGenerationSession@20'