编写gpibc/C++;mingw-w64 gcc/g++;

编写gpibc/C++;mingw-w64 gcc/g++;,c,gcc,mingw,labview,gpib,C,Gcc,Mingw,Labview,Gpib,我想从编译的exe控制一些GPIB设备。我从Labview2014安装中找到了示例c文件,并尝试使用mingw-w64环境中的gcc编译示例488query。一个C++的GPIB例子可以在这里找到: 我真的不知道我在用gcc输入做什么,我只是尝试了在n4882示例自述中找到的一些。我确认%NIEXTCCOMPILERSUPP%是一个环境变量,指向decl-32.h、ni488.h和ni4882.h目录。使用以下命令: gcc -I"%NIEXTCCOMPILERSUPP%\inclu

我想从编译的exe控制一些GPIB设备。我从Labview2014安装中找到了示例c文件,并尝试使用mingw-w64环境中的gcc编译示例488query。一个C++的GPIB例子可以在这里找到:

我真的不知道我在用gcc输入做什么,我只是尝试了在n4882示例自述中找到的一些。我确认%NIEXTCCOMPILERSUPP%是一个环境变量,指向decl-32.h、ni488.h和ni4882.h目录。使用以下命令:

gcc -I"%NIEXTCCOMPILERSUPP%\include" 4882query.c -o 4882query.exe
我得到以下输出/错误:

C:\Users\KYLEJE~1\AppData\Local\Temp\ccaxpK8i.o:4882query.c:(.text+0x1e): undefined reference to `SendIFC@4'
C:\Users\KYLEJE~1\AppData\Local\Temp\ccaxpK8i.o:4882query.c:(.text+0x26): undefined reference to `Ibsta@0'
C:\Users\KYLEJE~1\AppData\Local\Temp\ccaxpK8i.o:4882query.c:(.text+0xbe): undefined reference to `FindLstn@16'
C:\Users\KYLEJE~1\AppData\Local\Temp\ccaxpK8i.o:4882query.c:(.text+0xc6): undefined reference to `Ibsta@0'
C:\Users\KYLEJE~1\AppData\Local\Temp\ccaxpK8i.o:4882query.c:(.text+0xf2): undefined reference to `Ibcnt@0'
C:\Users\KYLEJE~1\AppData\Local\Temp\ccaxpK8i.o:4882query.c:(.text+0x12f): undefined reference to `DevClearList@8'
C:\Users\KYLEJE~1\AppData\Local\Temp\ccaxpK8i.o:4882query.c:(.text+0x137): undefined reference to `Ibsta@0'
C:\Users\KYLEJE~1\AppData\Local\Temp\ccaxpK8i.o:4882query.c:(.text+0x18a): undefined reference to `SendList@20'
C:\Users\KYLEJE~1\AppData\Local\Temp\ccaxpK8i.o:4882query.c:(.text+0x192): undefined reference to `Ibsta@0'
C:\Users\KYLEJE~1\AppData\Local\Temp\ccaxpK8i.o:4882query.c:(.text+0x1fe): undefined reference to `Receive@20'
C:\Users\KYLEJE~1\AppData\Local\Temp\ccaxpK8i.o:4882query.c:(.text+0x206): undefined reference to `Ibsta@0'
C:\Users\KYLEJE~1\AppData\Local\Temp\ccaxpK8i.o:4882query.c:(.text+0x22f): undefined reference to `Ibcnt@0'
C:\Users\KYLEJE~1\AppData\Local\Temp\ccaxpK8i.o:4882query.c:(.text+0x27e): undefined reference to `ibonl@8'
C:\Users\KYLEJE~1\AppData\Local\Temp\ccaxpK8i.o:4882query.c:(.text+0x29b): undefined reference to `Iberr@0'
C:\Users\KYLEJE~1\AppData\Local\Temp\ccaxpK8i.o:4882query.c:(.text+0x2af): undefined reference to `Iberr@0'
C:\Users\KYLEJE~1\AppData\Local\Temp\ccaxpK8i.o:4882query.c:(.text+0x2b6): undefined reference to `Ibsta@0'
C:\Users\KYLEJE~1\AppData\Local\Temp\ccaxpK8i.o:4882query.c:(.text+0x2f4): undefined reference to `ibonl@8'
collect2.exe: error: ld returned 1 exit status
我还尝试按照自述文件中的指示使用编译:

gcc -I"%NIEXTCCOMPILERSUPP%\include" 4882query.c "%NIEXTCCOMPILERSUPP%\lib32\msvc\ni4882.obj"
我得到以下信息:

C:\Program Files (x86)\National Instruments\Shared\ExternalCompilerSupport\C\\lib32\msvc\ni4882.obj: In function `LoadFunction@4':
p:\gpib\software\n:(.text[_LoadFunction@4]+0x9): undefined reference to `_chkstk'
collect2.exe: error: ld returned 1 exit status
任何帮助都将不胜感激,
Brett

您是否正在尝试在Windows上使用linux gpib项目?上面清楚地说明了Linux内核的要求,所以看起来它不会在Windows上运行。原因是您编译到一个.obj文件,而不是一个没有未定义参数的.exe文件,因为它没有链接。稍后将.obj链接到.exe会产生相同的错误。