无法为 i386 构建 PortAudio 以使其与 NI 的 DAQmxBase 配合良好



我正在尝试编写一个小的C 程序,该程序都从Ni USB DAQ获取数据,并使用Portaudio播放音频。问题是,似乎必须在i386下构建Mac/linux的Ni Daq库,而我只是无法为i386构建Portaudio。

我已经在运行./configure --disable-mac-universal && make && make install之前尝试将CFLAG和LDFLAG设置为-arch=i386,但是当我向Portaudio添加电话时,NI DAQMXBASE示例代码仍然不会构建:

gcc -I../../includes -g -O2 -arch i386 acAnalogTest.c -framework nidaqmxbase -framework nidaqmxbaselv -o acAnalogTest  
Undefined symbols for architecture i386:
      "_Pa_Initialize", referenced from:
          _main in ccf1t0bz.o
    ld: symbol(s) not found for architecture i386
    collect2: ld returned 1 exit status
    make: *** [acAnalogTest] Error 1

ni daqmxbase makefile看起来像这样:

nilibs=-framework nidaqmxbase -framework nidaqmxbaselv                                                              
includes=-I../../includes
flags= -g -O2 -arch i386
cc=gcc
ao_examples = acAnalogTest acquireNScans
......
all : $(ao_examples)
% : %.c 
>---$(cc) $(includes) $(flags) $< $(nilibs) -o $@
clean :
>---rm -f $(ao_examples)

更改daqmxbase makefile中的-arch标志不起作用:

gcc -I../../includes -g -O2 -arch x86_64 acAnalogTest.c -framework nidaqmxbase -framework nidaqmxbaselv -o acAnalogTest
In file included from acAnalogTest.c:1:
../../includes/NIDAQmxBase.h:104: warning: division by zero
../../includes/NIDAQmxBase.h:104: error: enumerator value for ‘assert_line_104’ is not an integer constant
../../includes/NIDAQmxBase.h:105: warning: division by zero
../../includes/NIDAQmxBase.h:105: error: enumerator value for ‘assert_line_105’ is not an integer constant
make: *** [acAnalogTest] Error 1

我认为这是因为DAQMXBase用i386数据类型编写。线上来自NIDAQMXBASE.H的上述错误引用为:

NIStaticAssert(sizeof(long) == 4, "Error: This platform is unsupported because long is not 4 bytes.");              
NIStaticAssert(sizeof(int) == sizeof(long), "Error: This platform is unsupported because int is not the same size as long.");

我可以自己构建一些普通的Portaudio示例,但是我想将Portaudio和daqmxbase放在同一程序中,并让它们相处。必须有一种构建Portaudio的方法,以便与DaqMxBase一起使用,否?

谢谢!

daqmx基础版本14.0和15.0支持64位应用程序,因此您现在应该能够升级驱动程序并重试。

DAQMX基础15.0用于Mac

最新更新