MacOSXCompilationGuide

 

環境 Mac OS X 10.8.5 + Xcode 4.6.1

個人做到 install libaacplus 這步驟時卡住, make 失敗

/bin/sh ../libtool  --tag=CC   --mode=link gcc  -g -O2   -o aacplusenc main.o ../src/libaacplus.la -lm
libtool: link: gcc -g -O2 -o .libs/aacplusenc main.o  ../src/.libs/libaacplus.dylib -lm
Undefined symbols for architecture x86_64:
  "_AuChannelOpen", referenced from:
      _main in main.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[2]: *** [aacplusenc] Error 1
make[1]: *** [all-recursive] Error 1
make: *** [all] Error 2

 google 錯誤訊息也沒有找到什麼, 後來把 Makefile 裡的 gcc 全換成 llvm-gcc 試試

沒想到就成功了!

#CC = gcc
CC = llvm-gcc

#CPP = gcc -E
CPP = llvm-gcc -E

#ac_ct_CC = gcc
ac_ct_CC = llvm-gcc

 

 

ps. 另外 Xcode -> Perferences -> Locations 可以選擇 Command Line Tools 的版本

configure 時可先定義 CC variable


CC=gcc-4.2 ./configure

or

export CC=gcc-4.2

arrow
arrow
    全站熱搜
    創作者介紹
    創作者 JohnDX 的頭像
    JohnDX

    我要回家想一想~

    JohnDX 發表在 痞客邦 留言(0) 人氣()