错误包括jpeglib.h:'*'标记之前的预期标识符

时间:2017-04-23 18:01:07

标签: c++ compiler-errors g++ libjpeg

我试图在我的Fedora 25计算机上构建bundler_sfm,但在编译LoadJPEG.cpp文件时遇到以下错误:

In file included from /usr/local/include/jpeglib.h:27:0,
                 from LoadJPEG.cpp:23:
/usr/local/include/jpeglib.h:704:3: error: expected identifier before ‘*’ token
   JMETHOD(noreturn_t, error_exit, (j_common_ptr cinfo));
   ^
/usr/local/include/jpeglib.h:704:3: error: ‘noreturn_t’ declared as function returning a function
   JMETHOD(noreturn_t, error_exit, (j_common_ptr cinfo));
   ^

似乎我的编译器不知道如何不喜欢jpeglib.h头文件,但我无法弄清楚原因。以下是makefile中生成错误的命令:

g++ -c -o LoadJPEG.o -O3 -Wall -Wno-unused-result -std=gnu++0x \
-I../lib/imagelib -I../lib/sfm-driver -I../lib/matrix -I../lib/5point \
-I../lib/sba-1.5 -I../lib/ann_1.1_char/include -I../include  \
-D__NO_UI__ -D__BUNDLER__ -D__BUNDLER_DISTR__ LoadJPEG.cpp

以下是问题jpeglib.h中的位置:

700 /* Error handler object */
701 
702 struct jpeg_error_mgr {
703   /* Error exit handler: does not return to caller */
704   JMETHOD(noreturn_t, error_exit, (j_common_ptr cinfo));
705   /* Conditionally emit a trace or warning message */
706   JMETHOD(void, emit_message, (j_common_ptr cinfo, int msg_level));
707   /* Routine that actually outputs a trace or error message */
708   JMETHOD(void, output_message, (j_common_ptr cinfo));

我不知道这是否重要,但jpeglib.h文件包含在extern "C" {块中。

我在bundler_sfm repo上打开了a GitHub issue,但似乎我的问题可能并非特定于该项目。如果有人能说出这里出了什么问题,我真的很感激。

0 个答案:

没有答案