错误:C编译器无法创建可执行文件 [英] error: C compiler cannot create executables

查看:119
本文介绍了错误:C编译器无法创建可执行文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试在Macbook上的 R 中安装 Rcplex ,并且正在按照此链接上的说明进行操作 http://jrzubizarreta.com/INSTALL

I am trying to install Rcplex in R on a macbook and I'm following the instruction at this link http://jrzubizarreta.com/INSTALL.

在终端上,在解压缩后的 Rcplex 目录所在的文件夹中,我键入了

On terminal, in the folder where the unzipped Rcplex directory is, I typed

cd /Library/Frameworks/R.framework/Versions/3.4/Resources/library 

R CMD INSTALL --configure-args="PKG_CFLAGS='-m64 -fPIC' PKG_CPPFLAGS=-
I/Applications/CPLEX_Studio_Community129/cplex/include PKG_LIBS='-
l/Applications/CPLEX_Studio_Community129/cplex/examples/x86-64_osx/static_pic 
-m64 -lm -lpthread -framework CoreFoundation -framework IOKit'" Rcplex

如说明。但是,出现以下错误:

as by instructions. However, I get the following error:

configure: error: Could not link CPLEX library using -
L/Applications/CPLEX_Studio_Community129/cplex/examples/x86-64_osx/static_pic 
-m64 -lm -lpthread -framework CoreFoundation -framework IOKit

如果在 R CMD安装[...] sudo 选项,错误仍然存​​在>。

The error persist if I use the sudo option before R CMD INSTALL [...].

config.log 指出:

This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.

It was created by Rcplex configure 0.3.2, which was
generated by GNU Autoconf 2.59.  Invocation command line was

  $ ./configure PKG_CFLAGS=-m64 -fPIC PKG_CPPFLAGS=-I/Applications/CPLEX_Studio_Community129/cplex/include PKG_LIBS=-L/Applications/CPLEX_Studio_Community129/cplex/examples/x86-64_osx/static_pic -m64 -lm -lpthread -framework CoreFoundation -framework IOKit

## --------- ##
## Platform. ##
## --------- ##

hostname = Michele.local
uname -m = x86_64
uname -r = 16.7.0
uname -s = Darwin
uname -v = Darwin Kernel Version 16.7.0: Thu Jun 15 17:36:27 PDT 2017; root:xnu-3789.70.16~2/RELEASE_X86_64

/usr/bin/uname -p = i386
/bin/uname -X     = unknown

/bin/arch              = unknown
/usr/bin/arch -k       = unknown
/usr/convex/getsysinfo = unknown
hostinfo               = Mach kernel version:
     Darwin Kernel Version 16.7.0: Thu Jun 15 17:36:27 PDT 2017; root:xnu-3789.70.16~2/RELEASE_X86_64
Kernel configured for up to 4 processors.
2 processors are physically available.
4 processors are logically available.
Processor type: x86_64h (Intel x86-64h Haswell)
Processors active: 0 1 2 3
Primary memory available: 16.00 gigabytes
Default processor set: 365 tasks, 1663 threads, 4 processors
Load average: 2.45, Mach factor: 1.68
/bin/machine           = unknown
/usr/bin/oslevel       = unknown
/bin/universe          = unknown

PATH: /Users/ssandrews/anaconda/bin
PATH: /Library/Frameworks/Python.framework/Versions/2.7/bin
PATH: /Users/ssandrews/anaconda/bin
PATH: /Library/Frameworks/Python.framework/Versions/3.5/bin
PATH: /usr/local/bin
PATH: /usr/bin
PATH: /bin
PATH: /usr/sbin
PATH: /sbin
PATH: /opt/X11/bin
PATH: /Library/TeX/texbin


## ----------- ##
## Core tests. ##
## ----------- ##

configure:1631: checking for gcc
configure:1657: result: clang
configure:1901: checking for C compiler version
configure:1904: clang --version </dev/null >&5
Apple LLVM version 7.0.0 (clang-700.0.72)
Target: x86_64-apple-darwin16.7.0
Thread model: posix
configure:1907: $? = 0
configure:1909: clang -v </dev/null >&5
Apple LLVM version 7.0.0 (clang-700.0.72)
Target: x86_64-apple-darwin16.7.0
Thread model: posix
configure:1912: $? = 0
configure:1914: clang -V </dev/null >&5
clang: error: argument to '-V' is missing (expected 1 value)
clang: error: no input files
configure:1917: $? = 1
configure:1940: checking for C compiler default output file name
configure:1943: clang -Wall -g -O2 -I/usr/local/include  conftest.c  >&5
configure:1946: $? = 0
configure:1992: result: a.out
configure:1997: checking whether the C compiler works
configure:2003: ./a.out
configure:2006: $? = 0
configure:2023: result: yes
configure:2030: checking whether we are cross compiling
configure:2032: result: no
configure:2035: checking for suffix of executables
configure:2037: clang -o conftest -Wall -g -O2 -I/usr/local/include  conftest.c  >&5
configure:2040: $? = 0
configure:2065: result: 
configure:2071: checking for suffix of object files
configure:2092: clang -c -Wall -g -O2 -I/usr/local/include conftest.c >&5
configure:2095: $? = 0
configure:2117: result: o
configure:2121: checking whether we are using the GNU C compiler
configure:2145: clang -c -Wall -g -O2 -I/usr/local/include conftest.c >&5
configure:2151: $? = 0
configure:2155: test -z 
             || test ! -s conftest.err
configure:2158: $? = 0
configure:2161: test -s conftest.o
configure:2164: $? = 0
configure:2177: result: yes
configure:2183: checking whether clang accepts -g
configure:2204: clang -c -g -I/usr/local/include conftest.c >&5
configure:2210: $? = 0
configure:2214: test -z 
             || test ! -s conftest.err
configure:2217: $? = 0
configure:2220: test -s conftest.o
configure:2223: $? = 0
configure:2234: result: yes
configure:2251: checking for clang option to accept ANSI C
configure:2321: clang  -c -Wall -g -O2 -I/usr/local/include conftest.c >&5
configure:2327: $? = 0
configure:2331: test -z 
             || test ! -s conftest.err
configure:2334: $? = 0
configure:2337: test -s conftest.o
configure:2340: $? = 0
configure:2358: result: none needed
configure:2376: clang -c -Wall -g -O2 -I/usr/local/include conftest.c >&5
conftest.c:2:3: error: unknown type name 'choke'
  choke me
  ^
conftest.c:2:11: error: expected ';' after top level declarator
  choke me
          ^
          ;
2 errors generated.
configure:2382: $? = 1
configure: failed program was:
| #ifndef __cplusplus
|   choke me
| #endif
configure:2520: checking how to run the C preprocessor
configure:2638: result: clang -E
configure:2662: clang -E -I/usr/local/include conftest.c
configure:2668: $? = 0
configure:2700: clang -E -I/usr/local/include conftest.c
conftest.c:9:10: fatal error: 'ac_nonexistent.h' file not found
#include <ac_nonexistent.h>
         ^
1 error generated.
configure:2706: $? = 1
configure: failed program was:
| /* confdefs.h.  */
| 
| #define PACKAGE_NAME "Rcplex"
| #define PACKAGE_TARNAME "rcplex"
| #define PACKAGE_VERSION "0.3.2"
| #define PACKAGE_STRING "Rcplex 0.3.2"
| #define PACKAGE_BUGREPORT ""
| /* end confdefs.h.  */
| #include <ac_nonexistent.h>
configure:2756: checking for egrep
configure:2766: result: grep -E
configure:2771: checking for ANSI C header files
configure:2796: clang -c -Wall -g -O2 -m64 -fPIC -I/usr/local/include -I/Applications/CPLEX_Studio_Community129/cplex/include conftest.c >&5
configure:2802: $? = 0
configure:2806: test -z 
             || test ! -s conftest.err
configure:2809: $? = 0
configure:2812: test -s conftest.o
configure:2815: $? = 0
configure:2904: clang -o conftest -Wall -g -O2 -m64 -fPIC -I/usr/local/include -I/Applications/CPLEX_Studio_Community129/cplex/include  conftest.c -L/Applications/CPLEX_Studio_Community129/cplex/examples/x86-64_osx/static_pic -m64 -lm -lpthread -framework CoreFoundation -framework IOKit >&5
conftest.c:26:7: warning: implicitly declaring library function 'exit' with type 'void (int) __attribute__((noreturn))'
      exit(2);
      ^
conftest.c:26:7: note: include the header <stdlib.h> or explicitly provide a declaration for 'exit'
1 warning generated.
configure:2907: $? = 0
configure:2909: ./conftest
configure:2912: $? = 0
configure:2927: result: yes
configure:2951: checking for sys/types.h
configure:2967: clang -c -Wall -g -O2 -m64 -fPIC -I/usr/local/include -I/Applications/CPLEX_Studio_Community129/cplex/include conftest.c >&5
configure:2973: $? = 0
configure:2977: test -z 
             || test ! -s conftest.err
configure:2980: $? = 0
configure:2983: test -s conftest.o
configure:2986: $? = 0
configure:2997: result: yes
configure:2951: checking for sys/stat.h
configure:2967: clang -c -Wall -g -O2 -m64 -fPIC -I/usr/local/include -I/Applications/CPLEX_Studio_Community129/cplex/include conftest.c >&5
configure:2973: $? = 0
configure:2977: test -z 
             || test ! -s conftest.err
configure:2980: $? = 0
configure:2983: test -s conftest.o
configure:2986: $? = 0
configure:2997: result: yes
configure:2951: checking for stdlib.h
configure:2967: clang -c -Wall -g -O2 -m64 -fPIC -I/usr/local/include -I/Applications/CPLEX_Studio_Community129/cplex/include conftest.c >&5
configure:2973: $? = 0
configure:2977: test -z 
             || test ! -s conftest.err
configure:2980: $? = 0
configure:2983: test -s conftest.o
configure:2986: $? = 0
configure:2997: result: yes
configure:2951: checking for string.h
configure:2967: clang -c -Wall -g -O2 -m64 -fPIC -I/usr/local/include -I/Applications/CPLEX_Studio_Community129/cplex/include conftest.c >&5
configure:2973: $? = 0
configure:2977: test -z 
             || test ! -s conftest.err
configure:2980: $? = 0
configure:2983: test -s conftest.o
configure:2986: $? = 0
configure:2997: result: yes
configure:2951: checking for memory.h
configure:2967: clang -c -Wall -g -O2 -m64 -fPIC -I/usr/local/include -I/Applications/CPLEX_Studio_Community129/cplex/include conftest.c >&5
configure:2973: $? = 0
configure:2977: test -z 
             || test ! -s conftest.err
configure:2980: $? = 0
configure:2983: test -s conftest.o
configure:2986: $? = 0
configure:2997: result: yes
configure:2951: checking for strings.h
configure:2967: clang -c -Wall -g -O2 -m64 -fPIC -I/usr/local/include -I/Applications/CPLEX_Studio_Community129/cplex/include conftest.c >&5
configure:2973: $? = 0
configure:2977: test -z 
             || test ! -s conftest.err
configure:2980: $? = 0
configure:2983: test -s conftest.o
configure:2986: $? = 0
configure:2997: result: yes
configure:2951: checking for inttypes.h
configure:2967: clang -c -Wall -g -O2 -m64 -fPIC -I/usr/local/include -I/Applications/CPLEX_Studio_Community129/cplex/include conftest.c >&5
configure:2973: $? = 0
configure:2977: test -z 
             || test ! -s conftest.err
configure:2980: $? = 0
configure:2983: test -s conftest.o
configure:2986: $? = 0
configure:2997: result: yes
configure:2951: checking for stdint.h
configure:2967: clang -c -Wall -g -O2 -m64 -fPIC -I/usr/local/include -I/Applications/CPLEX_Studio_Community129/cplex/include conftest.c >&5
configure:2973: $? = 0
configure:2977: test -z 
             || test ! -s conftest.err
configure:2980: $? = 0
configure:2983: test -s conftest.o
configure:2986: $? = 0
configure:2997: result: yes
configure:2951: checking for unistd.h
configure:2967: clang -c -Wall -g -O2 -m64 -fPIC -I/usr/local/include -I/Applications/CPLEX_Studio_Community129/cplex/include conftest.c >&5
configure:2973: $? = 0
configure:2977: test -z 
             || test ! -s conftest.err
configure:2980: $? = 0
configure:2983: test -s conftest.o
configure:2986: $? = 0
configure:2997: result: yes
configure:3019: checking ilcplex/cplex.h usability
configure:3031: clang -c -Wall -g -O2 -m64 -fPIC -I/usr/local/include -I/Applications/CPLEX_Studio_Community129/cplex/include conftest.c >&5
configure:3037: $? = 0
configure:3041: test -z 
             || test ! -s conftest.err
configure:3044: $? = 0
configure:3047: test -s conftest.o
configure:3050: $? = 0
configure:3060: result: yes
configure:3064: checking ilcplex/cplex.h presence
configure:3074: clang -E -I/usr/local/include -I/Applications/CPLEX_Studio_Community129/cplex/include conftest.c
configure:3080: $? = 0
configure:3100: result: yes
configure:3135: checking for ilcplex/cplex.h
configure:3142: result: yes
configure:3154: checking for library containing CPXversion
configure:3184: clang -o conftest -Wall -g -O2 -m64 -fPIC -I/usr/local/include -I/Applications/CPLEX_Studio_Community129/cplex/include  conftest.c -L/Applications/CPLEX_Studio_Community129/cplex/examples/x86-64_osx/static_pic -m64 -lm -lpthread -framework CoreFoundation -framework IOKit >&5
Undefined symbols for architecture x86_64:
  "_CPXversion", referenced from:
      _main in conftest-074e04.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
configure:3190: $? = 1
configure: failed program was:
| /* confdefs.h.  */
| 
| #define PACKAGE_NAME "Rcplex"
| #define PACKAGE_TARNAME "rcplex"
| #define PACKAGE_VERSION "0.3.2"
| #define PACKAGE_STRING "Rcplex 0.3.2"
| #define PACKAGE_BUGREPORT ""
| #define STDC_HEADERS 1
| #define HAVE_SYS_TYPES_H 1
| #define HAVE_SYS_STAT_H 1
| #define HAVE_STDLIB_H 1
| #define HAVE_STRING_H 1
| #define HAVE_MEMORY_H 1
| #define HAVE_STRINGS_H 1
| #define HAVE_INTTYPES_H 1
| #define HAVE_STDINT_H 1
| #define HAVE_UNISTD_H 1
| /* end confdefs.h.  */
| 
| /* Override any gcc2 internal prototype to avoid an error.  */
| #ifdef __cplusplus
| extern "C"
| #endif
| /* We use char because int might match the return type of a gcc2
|    builtin and then its argument prototype would still apply.  */
| char CPXversion ();
| int
| main ()
| {
| CPXversion ();
|   ;
|   return 0;
| }
configure:3239: clang -o conftest -Wall -g -O2 -m64 -fPIC -I/usr/local/include -I/Applications/CPLEX_Studio_Community129/cplex/include  conftest.c -lcplex  -L/Applications/CPLEX_Studio_Community129/cplex/examples/x86-64_osx/static_pic -m64 -lm -lpthread -framework CoreFoundation -framework IOKit >&5
ld: library not found for -lcplex
clang: error: linker command failed with exit code 1 (use -v to see invocation)
configure:3245: $? = 1
configure: failed program was:
| /* confdefs.h.  */
| 
| #define PACKAGE_NAME "Rcplex"
| #define PACKAGE_TARNAME "rcplex"
| #define PACKAGE_VERSION "0.3.2"
| #define PACKAGE_STRING "Rcplex 0.3.2"
| #define PACKAGE_BUGREPORT ""
| #define STDC_HEADERS 1
| #define HAVE_SYS_TYPES_H 1
| #define HAVE_SYS_STAT_H 1
| #define HAVE_STDLIB_H 1
| #define HAVE_STRING_H 1
| #define HAVE_MEMORY_H 1
| #define HAVE_STRINGS_H 1
| #define HAVE_INTTYPES_H 1
| #define HAVE_STDINT_H 1
| #define HAVE_UNISTD_H 1
| /* end confdefs.h.  */
| 
| /* Override any gcc2 internal prototype to avoid an error.  */
| #ifdef __cplusplus
| extern "C"
| #endif
| /* We use char because int might match the return type of a gcc2
|    builtin and then its argument prototype would still apply.  */
| char CPXversion ();
| int
| main ()
| {
| CPXversion ();
|   ;
|   return 0;
| }
configure:3273: result: no
configure:3279: error: Could not link CPLEX library using -L/Applications/CPLEX_Studio_Community129/cplex/examples/x86-64_osx/static_pic -m64 -lm -lpthread -framework CoreFoundation -framework IOKit

## ---------------- ##
## Cache variables. ##
## ---------------- ##

ac_cv_c_compiler_gnu=yes
ac_cv_env_CC_set=
ac_cv_env_CC_value=
ac_cv_env_CFLAGS_set=
ac_cv_env_CFLAGS_value=
ac_cv_env_CPPFLAGS_set=
ac_cv_env_CPPFLAGS_value=
ac_cv_env_CPP_set=
ac_cv_env_CPP_value=
ac_cv_env_LDFLAGS_set=
ac_cv_env_LDFLAGS_value=
ac_cv_env_build_alias_set=
ac_cv_env_build_alias_value=
ac_cv_env_host_alias_set=
ac_cv_env_host_alias_value=
ac_cv_env_target_alias_set=
ac_cv_env_target_alias_value=
ac_cv_exeext=
ac_cv_header_ilcplex_cplex_h=yes
ac_cv_header_inttypes_h=yes
ac_cv_header_memory_h=yes
ac_cv_header_stdc=yes
ac_cv_header_stdint_h=yes
ac_cv_header_stdlib_h=yes
ac_cv_header_string_h=yes
ac_cv_header_strings_h=yes
ac_cv_header_sys_stat_h=yes
ac_cv_header_sys_types_h=yes
ac_cv_header_unistd_h=yes
ac_cv_objext=o
ac_cv_prog_CPP='clang -E'
ac_cv_prog_ac_ct_CC=clang
ac_cv_prog_cc_g=yes
ac_cv_prog_cc_stdc=
ac_cv_prog_egrep='grep -E'
ac_cv_search_CPXversion=no

## ----------------- ##
## Output variables. ##
## ----------------- ##

AWK=''
CC='clang'
CFLAGS='-Wall -g -O2 -m64 -fPIC'
CPLEX_BIN=''
CPP='clang -E'
CPPFLAGS='-I/usr/local/include -I/Applications/CPLEX_Studio_Community129/cplex/include'
DEFS=''
ECHO_C='ECHO_N=''
ECHO_T=''
EGREP='grep -E'
EXEEXT=''
LDFLAGS=''
LIBOBJS=''
LIBS='-L/Applications/CPLEX_Studio_Community129/cplex/examples/x86-64_osx/static_pic -m64 -lm -lpthread -framework CoreFoundation -framework IOKit'
LTLIBOBJS=''
OBJEXT='o'
PACKAGE_BUGREPORT=''
PACKAGE_NAME='Rcplex'
PACKAGE_STRING='Rcplex 0.3.2'
PACKAGE_TARNAME='rcplex'
PACKAGE_VERSION='0.3.2'
PATH_SEPARATOR=':'
PKG_CFLAGS='-m64 -fPIC'
PKG_CPPFLAGS='-I/Applications/CPLEX_Studio_Community129/cplex/include'
PKG_LIBS='-L/Applications/CPLEX_Studio_Community129/cplex/examples/x86-64_osx/static_pic -m64 -lm -lpthread -framework CoreFoundation -framework IOKit'
SHELL='/bin/sh'
ac_ct_CC='clang'
bindir='${exec_prefix}/bin'
build_alias=''
datadir='${prefix}/share'
exec_prefix='NONE'
host_alias=''
includedir='${prefix}/include'
infodir='${prefix}/info'
libdir='${exec_prefix}/lib'
libexecdir='${exec_prefix}/libexec'
localstatedir='${prefix}/var'
mandir='${prefix}/man'
oldincludedir='/usr/include'
prefix='NONE'
program_transform_name='s,x,x,'
sbindir='${exec_prefix}/sbin'
sharedstatedir='${prefix}/com'
sysconfdir='${prefix}/etc'
target_alias=''

## ----------- ##
## confdefs.h. ##
## ----------- ##

#define HAVE_INTTYPES_H 1
#define HAVE_MEMORY_H 1
#define HAVE_STDINT_H 1
#define HAVE_STDLIB_H 1
#define HAVE_STRINGS_H 1
#define HAVE_STRING_H 1
#define HAVE_SYS_STAT_H 1
#define HAVE_SYS_TYPES_H 1
#define HAVE_UNISTD_H 1
#define PACKAGE_BUGREPORT ""
#define PACKAGE_NAME "Rcplex"
#define PACKAGE_STRING "Rcplex 0.3.2"
#define PACKAGE_TARNAME "rcplex"
#define PACKAGE_VERSION "0.3.2"
#define STDC_HEADERS 1

configure: exit 1

makefile 包含以下信息:

SYSTEM = x86-64_osx
LIBFORMAT = static_pic

SYSTEM = x86-64_osx LIBFORMAT = static_pic

#------------------------------------------------------------
#
# When you adapt this makefile to compile your CPLEX programs
# please copy this makefile and set CPLEXDIR and CONCERTDIR to
# the directories where CPLEX and CONCERT are installed.
#
#------------------------------------------------------------

CPLEXDIR      = ../../..
CONCERTDIR    = ../../../../concert

# ---------------------------------------------------------------------
# Compiler selection 
# ---------------------------------------------------------------------

CCC = clang++ -O0
CC  = clang -O0
JAVAC = javac 

# ---------------------------------------------------------------------
# Compiler options 
# ---------------------------------------------------------------------

CCOPT = -m64 -O -fPIC -fexceptions -DNDEBUG -DIL_STD -stdlib=libc++
COPT  = -m64 -fPIC
JOPT  = -classpath $(CPLEXDIR)/lib/cplex.jar -O

# ---------------------------------------------------------------------
# Link options and libraries
# ---------------------------------------------------------------------

CPLEXBINDIR   = $(CPLEXDIR)/bin/$(BINDIST)
CPLEXJARDIR   = $(CPLEXDIR)/lib/cplex.jar
CPLEXLIBDIR   = $(CPLEXDIR)/lib/$(SYSTEM)/$(LIBFORMAT)
CONCERTLIBDIR = $(CONCERTDIR)/lib/$(SYSTEM)/$(LIBFORMAT)

# For dynamic linking
CPLEXBINDIR   = $(CPLEXDIR)/bin/$(SYSTEM)
CPLEXLIB      = cplex$(dynamic:yes=1290)
run           = $(dynamic:yes=DYLD_LIBRARY_PATH=$(CPLEXBINDIR))

CCLNDIRS  = -L$(CPLEXLIBDIR) -L$(CONCERTLIBDIR) $(dynamic:yes=-L$(CPLEXBINDIR))
CLNDIRS   = -L$(CPLEXLIBDIR) $(dynamic:yes=-L$(CPLEXBINDIR))
CCLNFLAGS = -lconcert -lilocplex -l$(CPLEXLIB) -m64 -lm -lpthread -framework CoreFoundation -framework IOKit -stdlib=libc++
CLNFLAGS  = -l$(CPLEXLIB) -m64 -lm -lpthread -framework CoreFoundation -framework IOKit
JAVA      = java  -d64 -Djava.library.path=$(CPLEXDIR)/bin/x86-64_osx -classpath $(CPLEXJARDIR):


all:
    make all_c
    make all_cpp
    make all_java

execute: all
    make execute_c
    make execute_cpp
    make execute_java
CONCERTINCDIR = $(CONCERTDIR)/include
CPLEXINCDIR   = $(CPLEXDIR)/include

EXDIR         = $(CPLEXDIR)/examples
EXINC         = $(EXDIR)/include
EXDATA        = $(EXDIR)/data
EXSRCC        = $(EXDIR)/src/c
EXSRCCX       = $(EXDIR)/src/c_x
EXSRCCPP      = $(EXDIR)/src/cpp
EXSRCJAVA     = $(EXDIR)/src/java

CFLAGS  = $(COPT)  -I$(CPLEXINCDIR)
CCFLAGS = $(CCOPT) -I$(CPLEXINCDIR) -I$(CONCERTINCDIR) 
JCFLAGS = $(JOPT)

关于如何解决此问题的任何想法?谢谢

Any idea on how to fix this issue? Thank you

推荐答案

它说

error: unable to open output file '/Volumes/Andrews/R working

文件/文件夹名称中的空白引起麻烦?尝试安装到名称中没有空格的路径中。并确保该路径存在并且您对此路径具有写权限。

Could it be that the blank in the file/folder name causes trouble? Try to install into a path that does not have blanks in its name. And make sure that path exists and you have write permissions for it.

更新,问题已通过新的错误消息更新:现在,错误是

Update after question was updated with new error message: Now the error is this:

error: Could not link CPLEX library using -L/Applications/CPLEX_Studio_Community129/cplex/examples/x86-64_osx/static_pic -m64 -lm -lpthread -framework CoreFoundation -framework IOKit

这是错误的路径。 CPLEX库不在 examples / x86-64_osx / static_pic 中,但不在 bin / x86-64_osx 中(动态库)或 lib / x86-64_osx / static_pic (静态库)中。我不知道这两个库中的哪个是必需的,因此只需将两个路径都放入配置参数中(当然,包括安装的绝对路径)。我不确定您是否还必须放入 -lcplex -lcplex129 (取决于静态还是动态)库是必需的)。因此,如果在没有放置这些参数的情况下遇到相同的错误,请尝试使用它们。

This is the wrong path. The CPLEX libraries are not in examples/x86-64_osx/static_pic but are either in bin/x86-64_osx (dynamic library) or in lib/x86-64_osx/static_pic (static library). I don't know which of the two libraries is required, so just put both pathes into the configuration arguments (including the absolute path to your installation, of course). I am not sure whether you also have to put -lcplex or -lcplex129 (depending on whether the static or the dynamic library is required). So if you get the same error without putting these arguments, then try with them.

这篇关于错误:C编译器无法创建可执行文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆