‘typedef’ was ignored in this declaration

本文深入探讨了C++中结构体定义与typedef的正确用法,解析了一个常见警告错误的原因,并提供了清晰的解决方案。通过理解结构体声明与typedef的关系,读者将学会如何避免在代码中出现类似的警告。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

typedef struct Elem{
    Elem(float N,int E)
    :e(E),
    n(N)
    {}
    float e;
    int n;
};

warning:‘typedef’ was ignored in this declaration
原因:结构体没有使用别名
解决:去掉typedef或在括号外加别名

Info: ******************************************************************* Info: Running Quartus Prime Analysis & Synthesis Info: Version 18.1.0 Build 625 09/12/2018 SJ Standard Edition Info: Processing started: Tue Jun 24 13:16:33 2025 Info: Command: quartus_map --read_settings_files=on --write_settings_files=off wash -c wash Warning (18236): Number of processors has not been specified which may cause overloading on shared machines. Set the global assignment NUM_PARALLEL_PROCESSORS in your QSF to an appropriate value for best performance. Info (20030): Parallel compilation is enabled and will use 16 of the 16 processors detected Warning (10463): Verilog HDL Declaration warning at wash.v(17): "enum" is SystemVerilog-2005 keyword Error (10170): Verilog HDL syntax error at wash.v(17) near text: "logic"; expecting ";". Check for and fix any syntax errors that appear immediately before or at the specified keyword. The Intel FPGA Knowledge Database contains many articles with specific details on how to resolve this error. Visit the Knowledge Database at https://www.altera.com/support/support-resources/knowledge-base/search.html and search for this specific error message number. Error (10170): Verilog HDL syntax error at wash.v(25) near text: "}"; expecting ";". Check for and fix any syntax errors that appear immediately before or at the specified keyword. The Intel FPGA Knowledge Database contains many articles with specific details on how to resolve this error. Visit the Knowledge Database at https://www.altera.com/support/support-resources/knowledge-base/search.html and search for this specific error message number. Error (10112): Ignored design unit "washing_machine" at wash.v(1) due to previous errors Info (12021): Found 0 design units, including 0 entities, in source file wash.v Error: Quartus Prime Analysis & Synthesis was unsuccessful. 3 errors, 2 warnings Error: Peak virtual memory: 4711 megabytes Error: Processing ended: Tue Jun 24 13:16:39 2025 Error: Elapsed time: 00:00:06 Error: Total CPU time (on all processors): 00:00:12 Error (293001): Quartus Prime Full Compilation was unsuccessful. 5 errors, 2 warnings
最新发布
06-25
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值