当我想制作 libsvm 时出现“make”错误(系统:MAC OS X 10.12.6)
Posted
技术标签:
【中文标题】当我想制作 libsvm 时出现“make”错误(系统:MAC OS X 10.12.6)【英文标题】:"make" error when I want to make libsvm (system : MAC OS X 10.12.6) 【发布时间】:2018-04-06 06:29:12 【问题描述】:当我在 libsvm/python 文件夹下制作时,终端显示:
make -C .. lib
c++ -Wall -Wconversion -O3 -fPIC -fopenmp -c svm.cpp
clang: error: unsupported option '-fopenmp'
make[1]: *** [svm.o] Error 1
make: *** [lib] Error 2
所以我试图找出错误,我认为这是我的gcc编译的问题,因为我之前更改了一些文件。
所以我开始测试它。 只需简单地写一个test.c
#include <stdio.h>
int main()
printf("Hello World");
我使用了命令:
gcc test.c -o test
和
./test
有很多错误
In file included from tset.c:1:
/usr/include/stdio.h:242:81: error: expected function body after function declarator
FILE *fopen(const char * __restrict __filename, const char * __restrict __mode) __DARWIN_ALIAS_STARTING(...
^
/usr/include/stdio.h:244:63: error: expected function body after function declarator
int fprintf(FILE * __restrict, const char * __restrict, ...) __printflike(2, 3);
^
/usr/include/stdio.h:246:56: error: expected function body after function declarator
int fputs(const char * __restrict, FILE * __restrict) __DARWIN_ALIAS(fputs);
^
/usr/include/stdio.h:249:37: error: expected function body after function declarator
FILE * __restrict) __DARWIN_ALIAS(freopen);
^
/usr/include/stdio.h:250:62: error: expected function body after function declarator
int fscanf(FILE * __restrict, const char * __restrict, ...) __scanflike(2, 3);
^
/usr/include/stdio.h:254:107: error: expected function body after function declarator
...void * __restrict __ptr, size_t __size, size_t __nitems, FILE * __restrict __stream) __DARWIN_ALIAS(fwrite);
^
/usr/include/stdio.h:259:43: error: expected function body after function declarator
int printf(const char * __restrict, ...) __printflike(1, 2);
^
/usr/include/stdio.h:266:42: error: expected function body after function declarator
int scanf(const char * __restrict, ...) __scanflike(1, 2);
^
/usr/include/stdio.h:269:63: error: expected function body after function declarator
int sprintf(char * __restrict, const char * __restrict, ...) __printflike(2, 3) __swift_unavailable("U...
^
/usr/include/stdio.h:270:68: error: expected function body after function declarator
int sscanf(const char * __restrict, const char * __restrict, ...) __scanflike(2, 3);
^
/usr/include/stdio.h:273:21: error: expected parameter declarator
__swift_unavailable("Use mkstemp(3) instead.")
^
/usr/include/stdio.h:273:21: error: expected ')'
/usr/include/stdio.h:273:20: note: to match this '('
__swift_unavailable("Use mkstemp(3) instead.")
^
/usr/include/stdio.h:275:1: error: expected function body after function declarator
__deprecated_msg("This function is provided for compatibility reasons only. Due to security concerns inher...
^
/usr/include/stdio.h:279:68: error: expected function body after function declarator
int vfprintf(FILE * __restrict, const char * __restrict, va_list) __printflike(2, 0);
^
/usr/include/stdio.h:280:48: error: expected function body after function declarator
int vprintf(const char * __restrict, va_list) __printflike(1, 0);
^
/usr/include/stdio.h:281:68: error: expected function body after function declarator
int vsprintf(char * __restrict, const char * __restrict, va_list) __printflike(2, 0) __swift_unavailab...
^
/usr/include/stdio.h:461:65: error: expected function body after function declarator
int asprintf(char ** __restrict, const char * __restrict, ...) __printflike(2, 3);
^
/usr/include/stdio.h:468:70: error: expected function body after function declarator
int vasprintf(char ** __restrict, const char * __restrict, va_list) __printflike(2, 0);
^
tset.c:4:4: warning: implicitly declaring library function 'printf' with type 'int (const char *, ...)'
[-Wimplicit-function-declaration]
printf("OK");
^
tset.c:4:4: note: include the header <stdio.h> or explicitly provide a declaration for 'printf'
1 warning and 18 errors generated.
我删除了 test.c 中的#include
int main()
printf("Hello World");
return 0;
然后再次运行终端显示:
Hello World
只是想知道....为什么
【问题讨论】:
gcc
或 clang
?
我用gcc编译,现在我发现问题了,就用brew install libsvm
没有 .. 但我仍然无法编译任何 c 代码
【参考方案1】:
我的 MACOS 好像有问题,我发现我在 /usr/local/.. 中更改了一些 .cpp 或 .h 文件,所以我只是重置了整个系统哈哈哈。多么悲伤的故事
【讨论】:
以上是关于当我想制作 libsvm 时出现“make”错误(系统:MAC OS X 10.12.6)的主要内容,如果未能解决你的问题,请参考以下文章
“CMake 错误:CMake 无法确定目标的链接器语言” 当我 catkin_make ROS 工作空间时出现错误
使用 make 命令时出现错误“make: [Makefile:2: all] Error 127”
遇到和错误:尝试使用带有 LibSVM 的预计算内核时出现“错误的输入格式:sample_serial_number 超出范围”