gerardpuducul
21st December 2011, 10:29
Hi all,
I try to control some test equipment with a gpib card. For doing that i try to use visa protocol but i don't success to compil anything. It seems that i don't success to link visa32.lib. It seems to not recognized the .lib extension :
C:\Program Files\IVI Foundation\VISA\WinNT\lib\bc\visa32.lib:-1: error: file not recognized: File format not recognized
Here is my "simple" code :
#include <QtGui>
#include <iostream>
#include <windows.h>
#include "dial_GPIB.h"
#include "C:\Program Files\IVI Foundation\VISA\WinNT\include\visa.h"
void dialogue_GPIB::send_GPIB()
{
ViSession defaultRM, vi;
char buf [256] = {0};
/* Open session to GPIB device at address 22 */
viOpenDefaultRM (&defaultRM);
viOpen (defaultRM, "GPIB0::22::INSTR", VI_NULL,VI_NULL, &vi);
/* Initialize device */
viPrintf (vi, "*RST\n");
/* Send an *IDN? string to the device */
viPrintf (vi, "*IDN?\n");
/* Read results */
viScanf (vi, "%t", &buf);
/* Print results */
printf ("Instrument identification string: %s\n", buf);
/* Close session */
viClose (vi);
viClose (defaultRM);
#endif
}
and here my .pro file
################################################## ####################
# Automatically generated by qmake (2.01a) jeu. 14. févr. 11:17:30 2008
################################################## ####################
TEMPLATE = app
TARGET =
# Input
HEADERS += dial_GPIB.h
FORMS += dial_GPIB.ui
SOURCES += dial_GPIB.cpp main.cpp
win32: LIBS += "C:\Program Files\IVI Foundation\VISA\WinNT\lib\bc/visa32.lib"
INCLUDEPATH += "C:\Program Files\IVI Foundation\VISA\WinNT\lib\bc"
DEPENDPATH += "C:\Program Files\IVI Foundation\VISA\WinNT\lib\bc"
win32: PRE_TARGETDEPS += "C:\Program Files\IVI Foundation\VISA\WinNT\lib\bc/visa32.lib"
anyone can help me?
thanks
I try to control some test equipment with a gpib card. For doing that i try to use visa protocol but i don't success to compil anything. It seems that i don't success to link visa32.lib. It seems to not recognized the .lib extension :
C:\Program Files\IVI Foundation\VISA\WinNT\lib\bc\visa32.lib:-1: error: file not recognized: File format not recognized
Here is my "simple" code :
#include <QtGui>
#include <iostream>
#include <windows.h>
#include "dial_GPIB.h"
#include "C:\Program Files\IVI Foundation\VISA\WinNT\include\visa.h"
void dialogue_GPIB::send_GPIB()
{
ViSession defaultRM, vi;
char buf [256] = {0};
/* Open session to GPIB device at address 22 */
viOpenDefaultRM (&defaultRM);
viOpen (defaultRM, "GPIB0::22::INSTR", VI_NULL,VI_NULL, &vi);
/* Initialize device */
viPrintf (vi, "*RST\n");
/* Send an *IDN? string to the device */
viPrintf (vi, "*IDN?\n");
/* Read results */
viScanf (vi, "%t", &buf);
/* Print results */
printf ("Instrument identification string: %s\n", buf);
/* Close session */
viClose (vi);
viClose (defaultRM);
#endif
}
and here my .pro file
################################################## ####################
# Automatically generated by qmake (2.01a) jeu. 14. févr. 11:17:30 2008
################################################## ####################
TEMPLATE = app
TARGET =
# Input
HEADERS += dial_GPIB.h
FORMS += dial_GPIB.ui
SOURCES += dial_GPIB.cpp main.cpp
win32: LIBS += "C:\Program Files\IVI Foundation\VISA\WinNT\lib\bc/visa32.lib"
INCLUDEPATH += "C:\Program Files\IVI Foundation\VISA\WinNT\lib\bc"
DEPENDPATH += "C:\Program Files\IVI Foundation\VISA\WinNT\lib\bc"
win32: PRE_TARGETDEPS += "C:\Program Files\IVI Foundation\VISA\WinNT\lib\bc/visa32.lib"
anyone can help me?
thanks