C++ 包含jpeglib.h的错误:在‘;之前应包含标识符*’;代币

C++ 包含jpeglib.h的错误:在‘;之前应包含标识符*’;代币,c++,compiler-errors,g++,libjpeg,C++,Compiler Errors,G++,Libjpeg,我试图在Fedora 25计算机上构建,但在编译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, erro

我试图在Fedora 25计算机上构建,但在编译
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,但似乎我的问题可能不是该项目特有的。如果有人能告诉我这里出了什么问题,我将非常感激。

在这之前还有其他错误吗?这是唯一的编译器输出吗?@cdhowie,在这之后,编译器会抱怨一些
JPEGib.h
函数未正确使用,例如:
LoadJPEG.cpp:32:37:错误:函数“jpeg\u error\u mgr*jpeg\u std\u error()的参数太多“
问题顶部的两个错误是编译器报告的
jpeglib.h
中唯一的错误。源程序包使用包管理器提供的
libjpeg
dev包在Ubuntu 16.04上成功构建。显然,您使用的是
libjpeg
,包括
jpeglib.h
,即您自己构建,因为它是在
/usr/local
下安装的。因此,您的
libjpeg
构建可能有问题。您最好从包管理器中删除它并安装
libjpeg-devel