GCC-使用无效注册的 [英] GCC- Invalid use of Register

查看:159
本文介绍了GCC-使用无效注册的的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我编译为Windows VS2012和海湾合作委员会下的一个项目($ C $个cblocks)。
在VS2012一切都运行完美。在GCC我获得以下编译错误:

I am compiling a project under VS2012 and GCC (CodeBlocks) for Windows. On VS2012 everything works perfect. Under GCC I am obtaining the following compiling error:

C:\Users\Piotrek\AppData\Local\Temp\ccfdl0Ye.s|164|Error: invalid use of register|
C:\Users\Piotrek\AppData\Local\Temp\ccfdl0Ye.s|166|Error: invalid use of register|
C:\Users\Piotrek\AppData\Local\Temp\ccfdl0Ye.s|221|Error: invalid use of register|
||=== Build finished: 3 errors, 14 warnings (0 minutes, 0 seconds) ===|

我使用的编译器选项-fpermissive - 它应该有无关的错误。

I am using the compiler option -fpermissive - It should have nothing to do with the error.

我只是不明白为什么它指向本地Temp文件夹下的临时文件,并说我使用的是错误的寄存器??

I just can't understand why is it pointing to a temporary file under the Local Temp folder, and saying that I am using a wrong register??

没有任何人有对发生了什么事吗?

Does anybody have any idea on what's happening?

推荐答案

它看起来像您所遇到的编译错误。该
错误信息(从源文件名判断)来自
汇编。唯一的一次汇编程序应该生成
错误消息时,有一些是在非法
汇编和C ++编译器应该的从不的产生非法
汇编;如果它不能产生法律汇编,它应该
输出错误信息和失败。

It looks like you've encountered a bug in the compiler. The error messages (judging from the "source" file name) are from the assembler. The only time the assembler should generate an error message is when there is something illegal in the assembler, and the C++ compiler should never generate illegal assembler; if it can't generate legal assembler, it should output an error message and fail.

真正的问题,当你得到这种消息的,是
找出你的code是什么触发它。 G ++有
选项​​,它告诉它不会删除任何中间的
文件。利用这一点,那么试试,看看什么是在怎么回事
在这些线路装配台文件。 (当你问G ++输出
汇编,它把漂亮的意见中,以帮助寻找
相应的源代码。我不知道这是否也做到这一点时,
生成汇编作为中间文件。)然后再试试
切割code(如果损坏程度严重,使用二进制搜索)
直到你能得到的误差为一行或两行的程序。
试着猜测什么特别之处他们,改变他们做
同样的事情,以不同的方式。

The real problem, when you get this sort of message, is to figure out what in your code is triggering it. g++ has an option which tells it to not delete any of the intermediate files. Use this, then try and see what is going on in the assember files at these lines. (When you ask g++ to output assembler, it puts nice comments in to help finding the corresponding source. I don't know if it also does this when generating assembler as an intermediate file.) And then try cutting code (if worse comes to worse, using binary search) until you can get the error for a program of one or two lines. Try to guess what's special about them, and change them to do the same thing, in a different way.

和不失败错误报告给G ++。

And don't fail to report the error to g++.

这篇关于GCC-使用无效注册的的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆