【问题标题】:Errors Compiling Procyon Library with AVR Studio 6使用 AVR Studio 6 编译 Procyon 库时出错
【发布时间】:2013-01-22 03:28:15
【问题描述】:

我在使用 AVR Studio 6 编译 Procyon 库时遇到了一些问题。我使用的代码完全适用于 AVR Studio 4。

以下行在这个公共库中编译失败:

//! prints a string stored in program rom
/// \note This function does not actually store your string in
/// program rom, but merely reads it assuming you stored it properly.
void rprintfProgStr(const prog_char str[]);

这会导致错误:

Error   1   unknown type name 'prog_char' D:\AVRTests\ProcyonLibTest\ProcyonLibTest\rprintf.h   85  1   ProcyonLibTest

这个函数的减速还有另一个错误。 下一个是:

// use this to store hex conversion in RAM
//static char HexChars[] = "0123456789ABCDEF";
// use this to store hex conversion in program memory
//static prog_char HexChars[] = "0123456789ABCDEF";
static char __attribute__ ((progmem)) HexChars[] = "0123456789ABCDEF";

这会导致错误:

Error   2   variable 'HexChars' must be const in order to be put into read-only section by means of '__attribute__((progmem))'  D:\AVRTests\ProcyonLibTest\ProcyonLibTest\rprintf.c 45  39  ProcyonLibTest

这是一个标准库,根据研究,每个人似乎都在工作。关于为什么会发生这种情况的任何想法?

【问题讨论】:

  • 如果您查看此问题,请考虑对其进行投票,以便获得了解 AVR 的人的关注。谢谢。

标签: c avr avr-gcc


【解决方案1】:

错误 1 ​​似乎与不包括 <avr/pgmspace.h> 有关。或者版本不兼容。您可能需要创建自己的 typedef 才能使其正常工作。

错误 2 看起来像是由更新的编译器版本引起的错误。您可以修改文件以使变量为 const。

如果您不想调整这些文件,那么您需要获得所有内容的兼容版本。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2016-12-18
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2015-11-26
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多