c - "make"错误,当我想制作 libsvm(系统 : MAC OS X 10. 12.6)

标签 c macos gcc libsvm

当我在 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

只是想知道....为什么

最佳答案

看来我的 MACOS 有问题,我发现我更改了/usr/local/.. 中的一些 .cpp 或 .h 文件,所以我只是重置了整个系统 haha​​hah。多么悲伤的故事

关于c - "make"错误,当我想制作 libsvm(系统 : MAC OS X 10. 12.6),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46927793/

相关文章:

macos - 从 Mac 应用程序启动 Safari

ios - 如何以编程方式在 SceneKit 中围绕立方体包装 png 纹理

c++ - GCC -Wuninitialized/-Wmaybe-uninitialized 问题

gcc - 为什么交叉编译器有两阶段编译?

c - struct tcphdr 和 struct tcp 的区别

c - 如何从输入文件中读取并保存每行的某些部分并将其输出到命令行?

c - 用二进制值切换大小写值?

c - 在 C 中生成随机 bool 值的简单方法是什么?

macos - 不要自动切换到更高端的独立GPU

c++ - 如何为 Linux 重新分发已编译的专有软件?