07-27-2010 03:12 AM - edited 07-27-2010 03:14 AM
I want to link to ..\National Instruments\Shared\ExternalCompilerSupport\C\lib32\msvc\gpib-32.obj using MinGW. I used the new GPIB header and I made a import library (lib<name>.a) using pexports ("pexports gpib-32.dll > gpib-32.dll"). But when I try to compile, I get these errors:
..: undefined reference to `ThreadIberr@0'
..: undefined reference to `ThreadIbsta@0'
..: undefined reference to `ibeos@8'
..: undefined reference to `ibeot@8'
..: undefined reference to `ibtmo@8'
..: undefined reference to `ibsad@8'
..: undefined reference to `ibpad@8'
..: undefined reference to `ibonl@8'
..: undefined reference to `ibwrt@12'
..: undefined reference to `ibrd@12'
..: undefined reference to `ThreadIbcntl@0'
..: undefined reference to `ibwrt@12'
..: undefined reference to `ibwrt@12'
..: undefined reference to `ibrd@12'
..: undefined reference to `ThreadIbcntl@0'
..: undefined reference to `ibrd@12'
..: undefined reference to `ibonl@8'
..: undefined reference to `ibdev@24'
..: undefined reference to `ibclr@4'
..: undefined reference to `ibonl@8'
..: undefined reference to `ibfindA@4'
..: undefined reference to `ibpad@8'
..: undefined reference to `ibsad@8'
..: undefined reference to `ibtmo@8'
..: undefined reference to `ibeot@8'
..: undefined reference to `ibeos@8'
collect2: ld returned 1 exit status
I think this is similar to http://forums.ni.com/t5/Multifunction-DAQ/Howto-use-NIDAQmx-with-mingw-gcc-3-4-2/m-p/294361, where the exports of nidaq32.dll (NI-DAQmx library) need to be first merged with the nicaiu.dll exports in order to create libnidaqmx.a. This can then be compiled in MinGW.
07-29-2010 09:21 PM
what language are you compiling this in?
07-30-2010 01:44 AM
It's C++ compiled with g++. The tooling & commands that I use to make the lib are:
pexports gpib-32.dll > gpib-32.defs
dlltool -k -d gpib-32.defs -l libgpib.a GPIB.DLL
The link above doesn't work. Use this link instead:
http://forums.ni.com/t5/Multifunction-DAQ/Howto-use-NIDAQmx-with-mingw-gcc-3-4-2/m-p/294361