08-08-2008 05:58 PM
08-11-2008 07:02 AM
08-11-2008 05:12 PM
Hi Dorna,
If you include the file as #include "ni488.h", you need to make sure the ni488.h file is included in the project. If it is not please include the file as #include <ni488.h>.
Thank you,
08-18-2008 05:44 PM
Thanks a lot! I was missing that line actually, I had the gpib-32.obj added to my project but I hadn't added that command ..\gpib-32.obj, this is what worked for me (in Dev C++), in addition to what I had above:
The project has to be win32 console.
In project tab --> project options --> parameters --> under the "linker" text box add: "..\gpib-32.obj"
12-16-2012 08:16 AM
Hi, I got the same problem with Qt.
When I'm tring to call the "ibdev" function I got "undefined reference to `ibdev@24' "
My pro file:
QT += core gui
TARGET = dx2
TEMPLATE = app
# configuracin National Instruments NI4882
# Windows Qt LGPL (compilador mingw)
INCLUDEPATH += "C:/Program Files/National Instruments/Shared/ExternalCompilerSupport/C/include"
win32-msvc:LIBS += "C:/Program Files/National Instruments/Shared/ExternalCompilerSupport/C/lib32/msvc" gpib-32.obj
SOURCES += main.cpp\
dx2.cpp
HEADERS += dx2.h
FORMS += dx2.ui
And my Qt C++ code is
#include "dx2.h"
#include "ui_dx2.h"
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
#include <windows.h>
#include <conio.h>
#include <QFile>
#include "ni4882.h"
#define _CRT_SECURE_NO_DEPRECATE
#define ARRAYSIZE_IN 100 // Size of read buffer
#define GPIB0 0 // Board handle
#define BDINDEX 0 // Board Index
#define PRIMARY_ADDR_OF_DMM 1 // Primary address of device
#define NO_SECONDARY_ADDR 0 // Secondary address of device
#define TIMEOUT 11 // Timeout value = 1 seconds
#define EOTMODE 1 // Enable the END message
#define EOSMODE 0 // Disable the EOS mode
#define DEFAULT_BUFFER 2048
#define MAX_ACL_BYTES 768
#define BUFFERSIZE 256
char ErrorMnemonic[29][5] = { "EDVR", "ECIC", "ENOL", "EADR", "EARG",
"ESAC", "EABO", "ENEB", "EDMA", "",
"EOIP", "ECAP", "EFSO", "", "EBUS",
"ESTB", "ESRQ", "", "", "",
"ETAB", "ELCK", "EARM", "EHDL", "",
"", "EWIP", "ERST", "EPWR" };
int Dev;
dx2::dx2(QWidget *parent) :
QMainWindow(parent),
ui(new Ui::dx2)
{
ui->setupUi(this);
// read configuration
PGM_CONFIG pgmConfig;
pgmConfig.gpibAddress = ui->addressNum->value();
pgmConfig.devHandle = ibdev(BDINDEX, pgmConfig.gpibAddress, NO_SECONDARY_ADDR, TIMEOUT, EOTMODE, EOSMODE);
qDebug("GPIB address is = %d\n",pgmConfig.gpibAddress);
}
My setup:
Win XP SP3
Qt 4.7.3
NI4882
12-16-2012 09:14 AM
Solve this issue by this link
Thanks