Tag: cplex

“在架构x86_64中找不到符号”,表示在C中使用CPLEX API的MEX文件

我目前正在MATLAB中编写一个MEX文件,它使用C语言中的CPLEX API来解决线性编程问题。 不幸的是,当我尝试编译并且我不知道如何解决它时,我遇到了“找不到架构x86_64的符号”问题。 一些基本信息: 我可以编译yprime.c和其他不使用CPLEX API的MEX文件 我在Mac OSX 10.7.2上使用MATLAB 2011b 我使用的是XCode 4.2中包含的GCC 4.2软件包。 我已经应用了XCode 4.2 Patch for MATLAB 我非常感谢人们可能提出的任何建议。 我在下面列出了一份详细的错误报告。 -> mexopts.sh sourced from directory (DIR = $PREF_DIR) FILE = /Users/berk/.matlab/R2011b/mexopts.sh —————————————————————- -> MATLAB = /Applications/MATLAB_R2011b.app -> CC = llvm-gcc-4.2 -> CC flags: CFLAGS = -fno-common -no-cpp-precomp -arch x86_64 -isysroot /Developer/SDKs/MacOSX10.6.sdk -mmacosx-version-min=10.5 -fexceptions -Wall CDEBUGFLAGS […]

Cplex库gcc编译链接错误

gcc -I/opt/cplex-studio-125/cplex/include -lcplex -L/opt/cplex-studio-125/cplex/lib/x86-64_sles10_4.1/static_pic mipex1.c 我正在尝试从cplex编译一个例子。 -I选择没问题。 -L选项似乎已损坏,因为它无法找到函数名称。 错误在哪里? 在特定的链接中有一个libcplex.a 。 /tmp/ccf5sKky.o: In function `main’: mipex1.c:(.text+0x9f): undefined reference to `CPXopenCPLEX’ mipex1.c:(.text+0xee): undefined reference to `CPXgeterrorstring’ mipex1.c:(.text+0x125): undefined reference to `CPXsetintparam’ mipex1.c:(.text+0x222): undefined reference to `CPXcreateprob’ mipex1.c:(.text+0x2e1): undefined reference to `CPXcopylp’ mipex1.c:(.text+0x334): undefined reference to `CPXcopyctype’ mipex1.c:(.text+0x380): undefined reference to `CPXmipopt’ mipex1.c:(.text+0x3cc): undefined reference to `CPXgetstat’ […]