当我想创建libsvm时出现“make”错误(系统:MAC OS X 10.12.6)

问题描述 投票:1回答:1

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

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

c macos gcc libsvm
1个回答
1
投票

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

© www.soinside.com 2019 - 2024. All rights reserved.