2011-03-19 69 views
1

我编译在命令行中使用AVR-GCC编译用make在OSX

之一包括我使用的有下面几行:

#ifndef F_CPU 
#warning No CPU speed specified - assuming Axon is running at 16MHz 
#define F_CPU 16000000 
#endif 

#if F_CPU != 16000000 
#warning "AxonII normally runs at 16MHz but you have defined a different value" 
#endif 

当我运行使我得到:

In file included from main.c:7: 
../webbotavrclib/sys/axon2.h:86:11: error: operator '!=' has no left operand 

第86行是#if F_CPU != 16000000以上。我不确定为什么我会收到错误。可以生产

回答

1

这种消息,例如用于以下编译:

$ gcc main.c -DF_CPU= 
    main.c:6:11: error: operator '!=' has no left operand 

注意F_CPU被定义,但并不是任何东西=使用!。

+0

我错过了在我的make文件中发布的事实,F_CPU事实上被定义为什么都没有。 – Justin808 2011-03-20 01:21:38