大厦Portaudio在OSX 10.7.5使用SDK10.6或10.7失败(Building Po

2019-08-02 13:12发布

I am still having trouble building the Portaudio library on my system, which is OSX 10.7.5 with Xcode 4.3.2, having Command Line Tools installed and having SDK10.6 and SDK10.7 under

    /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/

I describe shortly (also for others that run into the same problem) what I have done so far (following different solutions I have found on the web).

1) I downloaded "Portaudio" / pa_stable_v19_20111121.tgz (last stable release) from:

www.portaudio.com/download.html

2) I read the instructions on building Portaudio here:

www.portaudio.com/docs/v19-doxydocs/compile_mac_coreaudio.html

and tried to compile from a Terminal window with the suggested command:

./configure && make

This resulted (not so surprisingly) in a lot of errors ending with:

llvm-gcc-4.2: error trying to exec '/usr/bin/../llvm-gcc-4.2/bin/powerpc-apple-darwin11-llvm-gcc-4.2': execvp: No such file or directory lipo: can't open input file: /var/folders/1_/xkp08ky561jg02zjjrpsxg940000gn/T//ccPxCTrJ.out (No such file or directory) make: * [src/hostapi/coreaudio/pa_mac_core.lo] Error 1

This happens because "ppc" is not supported anymore since OSX 10.5. Moreover the "Developer" folder doesn't exist on OSX 10.7 and everything that was in the Developer folder has moved to

   /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/

3) I downloaded a patch (mac_configure_patch.txt) to fix "configure" from:

https://www.assembla.com/spaces/portaudio/tickets/216#/activity/ticket:

and copied it to the portaudio directory and applied it by typing in Terminal:

$ patch < mac_configure_patch.txt

A confirmation message said:

patching file configure.in

So everything seems fine. But still Portaudio is trying to build for "ppc".

4) Now I set the ARCHFLAGS, CFLAGS, LDFLAGS to only build for architecture i386 as follows (disabling universal build):

$ MACOSX_DEPLOYMENT_TARGET="10.7" ARCHFLAGS="-arch i386" CFLAGS="-O2 -g -Wall -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.7.sdk -arch i386 -mmacosx-version-min=10.7" LDFLAGS="-isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.7.sd -arch i386 -mmacosx-version-min=10.7" ./configure --disable-mac-universal

5) Further I found that:

A): "#include AudioToolbox.h" in ".include/pa_mac_core.h" should be UNCOMMENTED

B): that "-wError" from "Makefile" (not Makefile.in) should be removed.

accoding to: http://www.fluxforge.com/blog/building-portaudio-under-os-x-107-lion

6) Now I try to build (using: "sudo make"), compilation starts but but fails with:

ld: framework not found CoreAudio

collect2: ld returned 1 exit status

make: * [lib/libportaudio.la] Error 1

7) So I try to point to the framework using "-F/System/Library/Frameworks -framework CoreAudio"

leading to the following Terminal command:

$ MACOSX_DEPLOYMENT_TARGET="10.7" ARCHFLAGS="-arch i386" CFLAGS="-O2 -g -Wall -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.7.sdk -arch i386 -mmacosx-version-min=10.7" LDFLAGS="-isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.7.sd -arch i386 -mmacosx-version-min=10.7 -F/System/Library/Frameworks -framework CoreAudio" ./configure --disable-mac-universal

which seems to fix the CoreAudio framework issue but results in another error saying:

ld: library not found for -lSystem

collect2: ld returned 1 exit status

make: * [lib/libportaudio.la] Error 1

I am now stuck at this point. Did anyone experience the same problems when trying to build Portaudio on OSX 10.7 using SDK10.6 or SDK10.7. Did anyone find a solution to how to build Portaudio from Terminal? I am very thankful for any hints!!! Thanks in advance!

Answer 1:

试用最新的SVN。 如果没有了蝙蝠的工作权利,你可能需要一些标志的渣土。

例如,在configure.in:

  • 改变-Werror到-wall
  • 添加-Wno-弃用(你不应该需要这个,但以防万一)

然后运行

./configure --disable-mac-universal

并像往常一样。



Answer 2:

OK,最后我解决了这个问题。 希望该解决方案将帮助其他人。 我只是忘了还路径添加到CoreAudio的框架的CFLAGS。 下面是最终配置/使用SDK10.7为i386硬件架构和x86_64的上OSX 10.7.5建设portaudio打造命令:

打开在portaudio目录,键入一个终端窗口:

MACOSX_DEPLOYMENT_TARGET = “10.7” ARCHFLAGS = “ - 拱I386” CFLAGS =“ - O2 -g -Wall -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.7.sdk - 拱I386 -mmacosx版本分钟= 10.7 -F /系统/库/框架-framework CoreAudio的 “LDFLAGS =” - isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10。 7.sdk -arch I386 -mmacosx版本分钟= 10.7 -F /系统/库/框架-framework CoreAudio的”的./configure --disable-MAC-普遍

如果已经完成,你需要编辑Makefile ,改变的提-Werror-Wall

然后:

使

瞧。 有你有在portaudio / lib目录下的“libportaudio.la”。 现在,您可以键入

须藤做安装

(你会被要求使用您的密码确认)

把库中的系统目录下。

最后,你可以用Portaudio浪费时间! 玩得开心!



Answer 3:

尝试在Mac OSX山狮(10.8)您的指示,并正在取得进展了很多编译但随后被失败:

In file included from ./test/patest_sine_channelmaps.c:53:
./include/pa_mac_core.h:100:1: error: unknown type name 'AudioDeviceID'
AudioDeviceID PaMacCore_GetStreamInputDevice( PaStream* s );
^
./include/pa_mac_core.h:109:1: error: unknown type name 'AudioDeviceID'
AudioDeviceID PaMacCore_GetStreamOutputDevice( PaStream* s );
^
2 errors generated.
make: *** [bin/patest_sine_channelmaps] Error 1

不过,我想通了,你可以简单地使用自制软件 (用于OSX容易般的数据包管理器),它会做肮脏的工作就像一个魅力。 查找指定的安装目录中的二进制文件和头:)

$ brew install portaudio
Warning: It appears you have MacPorts or Fink installed.
Software installed with other package managers causes known problems for
Homebrew. If a formula fails to build, uninstall MacPorts/Fink and try again.
==> Downloading http://www.portaudio.com/archives/pa_stable_v19_20111121.tgz
######################################################################## 100.0%
==> Downloading patches
######################################################################## 100.0%
==> Patching
patching file include/pa_mac_core.h
==> ./configure --prefix=/usr/local/Cellar/portaudio/19.20111121 --enable-mac-un
==> make install
/usr/local/Cellar/portaudio/19.20111121: 8 files, 316K, built in 20 seconds


文章来源: Building Portaudio on OSX 10.7.5 using SDK10.6 or 10.7 fails