没有找到用于架构x86_64的符号。

时间:2022-01-26 15:21:17

Alright so I'm making a lexer and a parser using Ocamlyacc. I've done my research and I think it's something to do with my makefile not picking the right bit version for my compiler or something like it? I don't know much about makefiles which is why I'm asking.

好的,我正在使用Ocamlyacc制作一个lexer和一个解析器。我已经完成了我的研究,我认为这与我的makefile有关,不是为我的编译器选择正确的位版本,或者类似的东西?我不太了解makefile,这就是我问的原因。

I've run my program on another computer where it works without trouble so it gotta be something to do with my machine.

我已经在另一台电脑上运行了我的程序,它可以毫无困难地工作,所以它一定和我的机器有关。

It's a MacBook Pro 64 bit. I'm using Xcode 4.2.1.

它是一台MacBook Pro 64位。我使用Xcode 4.2.1。准备

Here's the makefile:

这里有一个makefile:

SHELL        = /bin/sh

C_C          = gcc 
CPP_C        = g++ 
ifdef GPROF
C_CPP_FLAGS = -pg -O3
else
ifndef DEBUG
C_CPP_FLAGS  = -O3
else
C_CPP_FLAGS  = -g
endif
endif
C_LD         = $(C_C)
CPP_LD       = $(CPP_C)

C_YACC       = bison
C_LEX        = flex

AR           = ar
RANLIB       = ranlib

OCAML_C      = ocamlc
OCAML_OPT_C  = ocamlopt
ifdef GPROF
OCAML_C_FLAGS     = -dtypes 
OCAML_OPT_C_FLAGS = -dtypes
OCAML_LD     = $(OCAML_C) -g
OCAML_OPT_LD = $(OCAML_OPT_C) -p
else
ifndef DEBUG
OCAML_C_FLAGS     = -dtypes 
OCAML_OPT_C_FLAGS = -dtypes
OCAML_LD     = $(OCAML_C) -g
OCAML_OPT_LD = $(OCAML_OPT_C)
else
OCAML_C_FLAGS     = -dtypes
OCAML_OPT_C_FLAGS = -dtypes
OCAML_LD     = $(OCAML_C) -g
OCAML_OPT_LD = $(OCAML_OPT_C)
endif
endif
OCAML_MKTOP  = ocamlmktop
OCAML_CP     = ocamlcp
OCAML_DEP    = ocamldep
OCAML_LEX    = ocamllex
OCAML_YACC   = ocamlyacc

OCAML_C_CPP_INC = -I $(shell $(OCAML_C) -v | tail -1 | sed -e \
                         's/^Standard library directory: //')

The error that I'm getting is:

我得到的误差是:

ld: symbol(s) not found for architecture x86_64

Here's the full output:

这是完整的输出:

make
Linking OCAML (top level) program nanoml.top
ocamlmktop    -o nanoml.top -custom   nano.cmo nanoLex.cmo nanoParse.cmo main.cmo \
-cc g++  -cclib ' '
/var/folders/n3/jgblhwmj40lchgq71bmgr8sw0000gn/T/camlprimbd6a63.c:784: warning: deprecated conversion from string constant to ‘char*’
.
. //The same line ALOT of times. Removed due to limit of chars in a single post.
.
/var/folders/n3/jgblhwmj40lchgq71bmgr8sw0000gn/T/camlprimbd6a63.c:784: warning: deprecated conversion from string constant to ‘char*’
ld: warning: ignoring file /usr/local/lib/ocaml/libcamlrun.a, file was built for archive which is not the architecture being linked (x86_64)
Undefined symbols for architecture x86_64:
  "_main", referenced from:
      start in crt1.10.6.o
  "_caml_alloc_dummy", referenced from:
      _caml_builtin_cprim in ccZbZ9Mf.o
.
. //And many of these lines
.
  "_caml_get_exception_backtrace", referenced from:
      _caml_builtin_cprim in ccZbZ9Mf.o
ld: symbol(s) not found for architecture x86_64
collect2: ld returned 1 exit status
File "_none_", line 1, characters 0-1:
Error: Error while building custom runtime system
make: *** [nanoml.top] Error 2

Thank you in advance!

提前谢谢你!

EDIT: I'm only using Ocaml. No C++ or C that needs to be linked with it. I've never tried running my ocaml code with a makefile before but I can run other ocaml code on this computer. This is the first time it fails but it is the first time I use a makefile.

编辑:我只使用Ocaml。没有需要链接的c++或C。我从来没有尝试过用makefile运行我的ocaml代码,但是我可以在这台计算机上运行其他ocaml代码。这是第一次失败,但这是我第一次使用makefile。

And the same makefile and code works on other machines(older machines though) so I think it has something to do with this one using 64 bits.

同样的makefile和代码可以在其他机器上运行(不过旧机器),所以我认为它与这个使用64位的机器有关系。

I found I've been given another makefile which looks like this:

我发现我得到了另一个makefile,它看起来是这样的:

# Generic compilation rules

%.o : %.c
    @echo Compiling C file $<
    $(C_C) $(C_CPP_FLAGS) $(C_CPP_INCLUDES) -c $< -o $@

%.o : %.cc
    @echo Compiling C++ file $<
    $(CPP_C) $(C_CPP_FLAGS) $(C_CPP_INCLUDES) -c $< -o $@

%.o : %.cpp
    @echo Compiling C++ file $<
    $(CPP_C) $(C_CPP_FLAGS) $(C_CPP_INCLUDES) -c $< -o $@

%.cmi: %.mli
    @echo Compiling OCAML interface $<
    $(OCAML_C) $(OCAML_C_FLAGS) $(OCAML_INCLUDES) -c $< -o $@

%.cmo: %.ml
    @echo Compiling \(to byte code\) OCAML module $<
    $(OCAML_C) $(OCAML_C_FLAGS) $(OCAML_INCLUDES) -c $< -o $@

%.cmx: %.ml
    @echo Compiling \(to native code\) OCAML module $<
    $(OCAML_OPT_C) $(OCAML_OPT_C_FLAGS) $(OCAML_INCLUDES) -c $< -o $@

%.ml: %.mll
    @echo Lexing OCAML file $<
    $(OCAML_LEX) $<

%.ml %.mli: %.mly
    @echo Yaccing OCAML file $<
    $(OCAML_YACC) $<



# Generic cleaning rules

default-clean:
    rm -f *~ *.o *.cmo *.cmx .*.depend *.cmi

.PHONY: default-clean



# Generic link rules and library creation rules
#
# These rules assume that the following variables are set (when necessary):
#
# - C_EXE          : name of the C executable
# - CPP_EXE        : name of the C++ executable
# - OCAML_EXE      : name of the OCaml executable (without suffix)
# - OCAML_TPL_EXE  : name of the OCaml custom toplevel (without suffix)
# - C_CPP_LIB      : name of the C/C++ library
# - OCAML_LIB      : name of the OCaml library (without suffix)
# - C_CPP_EXE_OBJ  : list of C/C++ objects (without suffix) to build exe
# - OCAML_EXE_OBJ  : list of OCaml modules (without suffix) to build exe
# - C_CPP_LIB_OBJ  : list of C/C++ objects (without suffix) to build lib
# - OCAML_LIB_OBJ  : list of OCaml modules (without suffix) to build lib
# - C_CPP_LD_FLAGS : C and C++ linker flags
# - OCAML_LD_FLAGS : OCaml linker (both native and bytecode) flags
# - C_CPP_LD_LIBS  : C and C++ linker libraries
# - OCAML_LD_LIBS  : OCaml linker (both native and bytecode) libraries

ifdef C_EXE
$(C_EXE): $(C_CPP_EXE_OBJ:%=%.o)
    @echo Linking C program $@
    $(C_LD) $(C_CPP_LD_FLAGS) -o $@ $(C_CPP_EXE_OBJ:%=%.o) $(C_CPP_LD_LIBS)
endif

ifdef CPP_EXE
$(CPP_EXE): $(C_CPP_EXE_OBJ:%=%.o)
    @echo Linking C++ program $@
    $(CPP_LD) $(C_CPP_LD_FLAGS) -o $@ $(C_CPP_EXE_OBJ:%=%.o) $(C_CPP_LD_LIBS)
endif

ifdef C_CPP_LIB
$(C_CPP_LIB).a: $(C_CPP_LIB_OBJ:%=%.o)
    @echo Creating C/C++ library $@
    $(AR) r $@ $?
    $(RANLIB) $@
endif

ifdef OCAML_EXE
$(OCAML_EXE).byte: $(C_CPP_EXE_OBJ:%=%.o) $(OCAML_EXE_OBJ:%=%.cmo)
    @echo Linking OCAML \(byte code\) program $@
    $(OCAML_LD) $(OCAML_LD_FLAGS) -o $@ -custom $(OCAML_LD_LIBS:%=%.cma) $(C_CPP_EXE_OBJ:%=%.o) $(OCAML_EXE_OBJ:%=%.cmo) \
    -cc $(CPP_C) -cclib '$(C_CPP_LD_FLAGS) $(C_CPP_LD_LIBS)'

$(OCAML_EXE).opt: $(C_CPP_EXE_OBJ:%=%.o) $(OCAML_EXE_OBJ:%=%.cmx)
    @echo Linking OCAML \(native code\) program $@
    $(OCAML_OPT_LD) $(OCAML_LD_FLAGS) -o $@ $(OCAML_LD_LIBS:%=%.cmxa) $(C_CPP_EXE_OBJ:%=%.o) $(OCAML_EXE_OBJ:%=%.cmx) \
    -cc $(CPP_C) -cclib '$(C_CPP_LD_FLAGS) $(C_CPP_LD_LIBS)'

$(OCAML_EXE).top: $(C_CPP_EXE_OBJ:%=%.o) $(OCAML_EXE_OBJ:%=%.cmo)
    @echo Linking OCAML \(top level\) program $@
    $(OCAML_MKTOP)   $(OCAML_LD_FLAGS) -o $@ -custom $(OCAML_LD_LIBS:%=%.cma) $(C_CPP_EXE_OBJ:%=%.o) $(OCAML_EXE_OBJ:%=%.cmo) \
    -cc $(CPP_C) -cclib '$(C_CPP_LD_FLAGS) $(C_CPP_LD_LIBS)'


endif

ifdef OCAML_TPL_EXE
$(OCAML_TPL_EXE).byte: $(C_CPP_EXE_OBJ:%=%.o) $(OCAML_EXE_OBJ:%=%.cmo)
    @echo Linking OCAML \(byte code\) toplevel $@
    $(OCAML_MKTOP) $(OCAML_LD_FLAGS) -o $@ -custom $(OCAML_LD_LIBS:%=%.cma) $(C_CPP_EXE_OBJ:%=%.o) $(OCAML_EXE_OBJ:%=%.cmo) \
    -cc $(CPP_C) -cclib '$(C_CPP_LD_FLAGS) $(C_CPP_LD_LIBS)'
endif

ifdef OCAML_LIB
$(OCAML_LIB).cma: $(OCAML_LIB_OBJ:%=%.cmo)
    @echo Creating OCAML \(byte code\) library $@
    $(OCAML_LD) $(OCAML_LD_FLAGS) -a -o $@ $(OCAML_LIB_OBJ:%=%.cmo)

$(OCAML_LIB).cmxa $(OCAML_LIB).a: $(OCAML_LIB_OBJ:%=%.cmx)
    @echo Creating OCAML \(native code\) library $@
    $(OCAML_OPT_LD) $(OCAML_LD_FLAGS) -a -o $@ $(OCAML_LIB_OBJ:%=%.cmx)
endif

ifdef OCAML_CINTF
ifdef OCAML_BYTECODE_CINTF
$(OCAML_CINTF).o: $(OCAML_CINTF_OBJ:%=%.cmo)
    @echo Creating OCAML \(native code\) C interface library $@
    $(OCAML_LD) $(OCAML_LD_FLAGS) -output-obj -o $@ $(OCAML_LD_LIBS:%=%.cma) $(OCAML_CINTF_OBJ:%=%.cmo)

$(OCAML_CINTF_LIB).a: $(OCAML_CINTF).o $(C_CPP_CINTF_OBJ:%=%.o)
    @echo Creating C/C++ interface library $@
    $(AR) r $@ $?
    $(RANLIB) $@
else
$(OCAML_CINTF).o: $(OCAML_CINTF_OBJ:%=%.cmx)
    @echo Creating OCAML \(native code\) C interface library $@
    $(OCAML_OPT_LD) $(OCAML_LD_FLAGS) -output-obj -o $@ $(OCAML_LD_LIBS:%=%.cmxa) $(OCAML_CINTF_OBJ:%=%.cmx)

$(OCAML_CINTF_LIB).a: $(OCAML_CINTF).o $(C_CPP_CINTF_OBJ:%=%.o)
    @echo Creating C/C++ interface library $@
    $(AR) r $@ $?
    $(RANLIB) $@
endif
endif



# Generic dependencies creation rules

.%.mli.depend: %.mli
    @echo Generating dependencies for OCAML interface $<
    $(OCAML_DEP) $< > $@

.%.ml.depend: %.ml
    @echo Generating dependencies for OCAML module $<
    $(OCAML_DEP) $< > $@

3 个解决方案

#1


10  

The interesting line is

有趣的是

ld: warning: ignoring file /usr/local/lib/ocaml/libcamlrun.a, file was built for archive which is not the architecture being linked (x86_64)

警告:忽略文件/usr/local/lib/ocaml/libcamlrun。文件是为存档而构建的,而不是被链接的体系结构(x86_64)

It tells you that your ocaml runtime is a probably a 32 bit library, instead of the 64 bits you need.

它告诉您,您的ocaml运行时可能是一个32位的库,而不是您需要的64位。

You might want to try the "-m32" flag of g++ to compile everything in 32 bits, or to install a 64 bit version of ocaml.

您可能想尝试使用“-m32”标记来编译32位的所有内容,或者安装一个64位的ocaml版本。

#2


4  

It looks like maybe your OCaml compiler is producing 32-bit executables. One way to tell is to say:

看起来您的OCaml编译器正在生成32位的可执行文件。一种方法是说:

$ ocamlopt -config

If you see architecture i386, it's a 32-bit compiler. If you see architecture amd64, it's a 64-bit compiler. At any rate, these are the two different values I see on my Macbook Pro.

如果您看到架构i386,它是一个32位的编译器。如果您看到架构amd64,它是一个64位的编译器。无论如何,这是我在Macbook Pro上看到的两个不同的值。

Edit

编辑

The Makefile you give doesn't really describe what you're trying to do. It just defines names for some language processors. The real Makefile is possibly elsewhere.

你给出的Makefile并不能真正描述你想要做什么。它只是定义了一些语言处理器的名称。真正的Makefile可能在其他地方。

Since the Makefile doesn't actually say anything about what you're doing, I realized that I don't see any evidence that you're linking OCaml and C++ (or C) together. The first line of output doesn't show anything except what looks like OCaml files. Furthermore, they're named xyz.cmo, which are bytecode OCaml files. That is, they're not 32-bit or 64-bit (native) files.

由于Makefile实际上并没有说明您正在做什么,所以我意识到我没有看到任何证据表明您将OCaml和c++(或C)连接在一起。第一行输出没有显示任何东西,除了看起来像OCaml文件。此外,他们名为xyz。cmo,它是字节码OCaml文件。也就是说,它们不是32位或64位(本机)文件。

Do you have some C++ and some OCaml components that need to be linked together, or is your project pure OCaml? If it's pure OCaml, I'd say the problem is all in the Makefile. You shouldn't have to worry about the architecture if you just want to run OCaml code.

您是否有一些需要连接在一起的c++和OCaml组件,或者您的项目是纯OCaml吗?如果是纯OCaml,我认为问题都在Makefile中。如果只想运行OCaml代码,就不必担心体系结构。

If there's some C++ or C, then you need to compile it with -arch i386 (to get 32-bit objects) and then link everything together with a linker (ld) that knows it's producing a 32-bit target. (Or, as Fabrice Le Fessant says, you could install a 64-bit OCaml compler.)

如果有一些c++或C,那么您需要用-arch i386(得到32位对象)编译它,然后将所有内容与一个链接器(ld)链接起来,该链接器知道它正在生成一个32位的目标。(或者,正如Fabrice Le Fessant所说,你可以安装一个64位的OCaml补充器。)

A possible suggestion is to create a tiny OCaml file and just see if you can compile and run it.

一个可能的建议是创建一个小的OCaml文件,看看是否可以编译并运行它。

Using the bytecode compiler, it looks like this:

使用字节码编译器,它看起来是这样的:

$ uname -rs
Darwin 10.8.0
$ cat tiny.ml
Printf.printf "hello world\n"
$ ocamlc -o tiny tiny.ml
$ file tiny.cmo
tiny.cmo: Objective caml object file (.cmo) (Version 006).
$ file tiny
tiny: a /sw/bin/ocamlrun script text executable
$ tiny
hello world

Using a native 32-bit compiler, it looks like this:

使用本机32位编译器,它看起来是这样的:

$ ocamlopt -o tiny tiny.ml
$ file tiny.cmx
tiny.cmx: Objective caml native object file (.cmx) (Version 011).
$ file tiny.o
tiny.o: Mach-O object i386
$ file tiny
tiny: Mach-O executable i386
$ tiny
hello world

Edit 2

编辑2

Your second makefile still doesn't show what you're trying to do, specifically. It just defines some make rules for compiling and linking different types of executables. However, since you say your project is all OCaml, then I'd say the entire problem is in this Makefile.

您的第二个makefile仍然没有显示您正在尝试做什么。它只是定义了一些规则,用于编译和链接不同类型的可执行文件。但是,既然您说您的项目都是OCaml,那么我就说整个问题都在这个Makefile中。

The problem appears to be that this Makefile specifies which C compiler and libraries the OCaml compiler should use as its back-end, using the -cc and -cclib options. On most systems, it will work OK to just specify the standard C compiler as the back-end for OCaml. On Mac OS X, there are 32-bit/64-bit architectural complications. Since you can compile OCaml successfully without this Makefile, I'd suggest that the OCaml compiler already knows how to compile and link OCaml programs. So you might try just removing the -cc and -cclib options from the Makefile.

问题似乎是,这个Makefile指定了OCaml编译器应该作为其后端使用的C编译器和库,使用-cc和-cclib选项。在大多数系统中,只要将标准C编译器指定为OCaml的后端就可以了。在Mac OS X上,有32位/64位的架构复杂性。由于您可以在没有这个Makefile的情况下成功编译OCaml,所以我建议OCaml编译器已经知道如何编译和链接OCaml程序。因此,您可以尝试从Makefile中删除-cc和-cclib选项。

To do this: In all three sections under OCAML_EXE remove the third line entirely (the line with -cc and -cclib), and remove the trailing backslash on the previous line.

要做到这一点:在OCAML_EXE下的所有三个部分中,完全删除第三行(与-cc和-cclib的行),并删除上一行的末尾反斜杠。

#3


0  

I've been having this problem for the past two days while trying to compile gphoto2. I just recently upgraded from OS X 10.8 to OS X 10.9. At first I thought it would have been issues on the new XCode version and the command line tools.

在尝试编译gphoto2时,我在过去两天一直遇到这个问题。我刚刚从OS X 10.8升级到OS X 10.9。起初,我以为它会出现在新的XCode版本和命令行工具上。

I made sure to update everything but the architecture inconsistency on ocaml was still there so, I decided to install the homebrew version of ocaml:

我确保更新了所有的东西,但是ocaml的架构不一致,所以我决定安装ocaml的自制版本:

$ brew install ocaml

et voilà

等好了

#1


10  

The interesting line is

有趣的是

ld: warning: ignoring file /usr/local/lib/ocaml/libcamlrun.a, file was built for archive which is not the architecture being linked (x86_64)

警告:忽略文件/usr/local/lib/ocaml/libcamlrun。文件是为存档而构建的,而不是被链接的体系结构(x86_64)

It tells you that your ocaml runtime is a probably a 32 bit library, instead of the 64 bits you need.

它告诉您,您的ocaml运行时可能是一个32位的库,而不是您需要的64位。

You might want to try the "-m32" flag of g++ to compile everything in 32 bits, or to install a 64 bit version of ocaml.

您可能想尝试使用“-m32”标记来编译32位的所有内容,或者安装一个64位的ocaml版本。

#2


4  

It looks like maybe your OCaml compiler is producing 32-bit executables. One way to tell is to say:

看起来您的OCaml编译器正在生成32位的可执行文件。一种方法是说:

$ ocamlopt -config

If you see architecture i386, it's a 32-bit compiler. If you see architecture amd64, it's a 64-bit compiler. At any rate, these are the two different values I see on my Macbook Pro.

如果您看到架构i386,它是一个32位的编译器。如果您看到架构amd64,它是一个64位的编译器。无论如何,这是我在Macbook Pro上看到的两个不同的值。

Edit

编辑

The Makefile you give doesn't really describe what you're trying to do. It just defines names for some language processors. The real Makefile is possibly elsewhere.

你给出的Makefile并不能真正描述你想要做什么。它只是定义了一些语言处理器的名称。真正的Makefile可能在其他地方。

Since the Makefile doesn't actually say anything about what you're doing, I realized that I don't see any evidence that you're linking OCaml and C++ (or C) together. The first line of output doesn't show anything except what looks like OCaml files. Furthermore, they're named xyz.cmo, which are bytecode OCaml files. That is, they're not 32-bit or 64-bit (native) files.

由于Makefile实际上并没有说明您正在做什么,所以我意识到我没有看到任何证据表明您将OCaml和c++(或C)连接在一起。第一行输出没有显示任何东西,除了看起来像OCaml文件。此外,他们名为xyz。cmo,它是字节码OCaml文件。也就是说,它们不是32位或64位(本机)文件。

Do you have some C++ and some OCaml components that need to be linked together, or is your project pure OCaml? If it's pure OCaml, I'd say the problem is all in the Makefile. You shouldn't have to worry about the architecture if you just want to run OCaml code.

您是否有一些需要连接在一起的c++和OCaml组件,或者您的项目是纯OCaml吗?如果是纯OCaml,我认为问题都在Makefile中。如果只想运行OCaml代码,就不必担心体系结构。

If there's some C++ or C, then you need to compile it with -arch i386 (to get 32-bit objects) and then link everything together with a linker (ld) that knows it's producing a 32-bit target. (Or, as Fabrice Le Fessant says, you could install a 64-bit OCaml compler.)

如果有一些c++或C,那么您需要用-arch i386(得到32位对象)编译它,然后将所有内容与一个链接器(ld)链接起来,该链接器知道它正在生成一个32位的目标。(或者,正如Fabrice Le Fessant所说,你可以安装一个64位的OCaml补充器。)

A possible suggestion is to create a tiny OCaml file and just see if you can compile and run it.

一个可能的建议是创建一个小的OCaml文件,看看是否可以编译并运行它。

Using the bytecode compiler, it looks like this:

使用字节码编译器,它看起来是这样的:

$ uname -rs
Darwin 10.8.0
$ cat tiny.ml
Printf.printf "hello world\n"
$ ocamlc -o tiny tiny.ml
$ file tiny.cmo
tiny.cmo: Objective caml object file (.cmo) (Version 006).
$ file tiny
tiny: a /sw/bin/ocamlrun script text executable
$ tiny
hello world

Using a native 32-bit compiler, it looks like this:

使用本机32位编译器,它看起来是这样的:

$ ocamlopt -o tiny tiny.ml
$ file tiny.cmx
tiny.cmx: Objective caml native object file (.cmx) (Version 011).
$ file tiny.o
tiny.o: Mach-O object i386
$ file tiny
tiny: Mach-O executable i386
$ tiny
hello world

Edit 2

编辑2

Your second makefile still doesn't show what you're trying to do, specifically. It just defines some make rules for compiling and linking different types of executables. However, since you say your project is all OCaml, then I'd say the entire problem is in this Makefile.

您的第二个makefile仍然没有显示您正在尝试做什么。它只是定义了一些规则,用于编译和链接不同类型的可执行文件。但是,既然您说您的项目都是OCaml,那么我就说整个问题都在这个Makefile中。

The problem appears to be that this Makefile specifies which C compiler and libraries the OCaml compiler should use as its back-end, using the -cc and -cclib options. On most systems, it will work OK to just specify the standard C compiler as the back-end for OCaml. On Mac OS X, there are 32-bit/64-bit architectural complications. Since you can compile OCaml successfully without this Makefile, I'd suggest that the OCaml compiler already knows how to compile and link OCaml programs. So you might try just removing the -cc and -cclib options from the Makefile.

问题似乎是,这个Makefile指定了OCaml编译器应该作为其后端使用的C编译器和库,使用-cc和-cclib选项。在大多数系统中,只要将标准C编译器指定为OCaml的后端就可以了。在Mac OS X上,有32位/64位的架构复杂性。由于您可以在没有这个Makefile的情况下成功编译OCaml,所以我建议OCaml编译器已经知道如何编译和链接OCaml程序。因此,您可以尝试从Makefile中删除-cc和-cclib选项。

To do this: In all three sections under OCAML_EXE remove the third line entirely (the line with -cc and -cclib), and remove the trailing backslash on the previous line.

要做到这一点:在OCAML_EXE下的所有三个部分中,完全删除第三行(与-cc和-cclib的行),并删除上一行的末尾反斜杠。

#3


0  

I've been having this problem for the past two days while trying to compile gphoto2. I just recently upgraded from OS X 10.8 to OS X 10.9. At first I thought it would have been issues on the new XCode version and the command line tools.

在尝试编译gphoto2时,我在过去两天一直遇到这个问题。我刚刚从OS X 10.8升级到OS X 10.9。起初,我以为它会出现在新的XCode版本和命令行工具上。

I made sure to update everything but the architecture inconsistency on ocaml was still there so, I decided to install the homebrew version of ocaml:

我确保更新了所有的东西,但是ocaml的架构不一致,所以我决定安装ocaml的自制版本:

$ brew install ocaml

et voilà

等好了