2011-09-30 110 views
5

我绊倒上的编译错误:C/C++预处理错误

Invoking: GCC C Compiler 
gcc -O0 -g3 -Wall -c -fmessage-length=0 -MMD -MP -MF"src/3dsloader.d"-MT"src/3dsloader.d" -o "src/3dsloader.o" "../src/3dsloader.c" 
In file included from ../src/3dsloader.c:42: 
../src/3dsloader.h:8:9: error: macro names must be identifiers 
make: *** [src/3dsloader.o] Error 1 

它指向:

#ifndef 3DSLOADER_H_ 
#define 3DSLOADER_H_ 

以下消息:

Multiple markers at this line 
    macro names must be identifiers 
    macro definition not found: #ifndef 3DSLOADER_H_ 

我运行C使用Eclipse IDE的Ubuntu/C++ OpenGL程序。到目前为止所有其他程序工作正常。但是这个加载3DS文件的软件已经和我嘲笑了两天,但没有修复它。

有什么建议吗?所有评论都非常感谢!

回答

9

C标识符不能以数字开头。试试_H_3DSLOADER。

确切地说:它们只能以字母或下划线开头。

+0

做你的建议,我更改为loader3D,因此头成为LOADER3DS_H_。然后它运作得非常好。非常感谢很多人! – ThreaderSlash