错误:无法将typeid与-fno-rtti一起使用 [英] Error: Cannot use typeid with -fno-rtti
问题描述
当我尝试编译我的项目时,我正在使用"opencv框架",得到这个不能在-fno-rtti中使用typeid的信息". 我用谷歌搜索了这个问题,但是,看来我在互联网上发现的错误与我的问题无关. 我不知道问题是否与包含,代码或编译器有关.
I´m getting this "Cannot use typeid with -fno-rtti" when I´m trying to compile my project, I´m using an opencv framework. I googled the problem but, it seems the errors I found in internet does not have relation with my problem. I don´t know if the problem is related with the includes, the code or the compiler.
Xcode经常给我错误,但是第一个错误在这里:
Xcode is giving me the error a lot of times, but the first error is here:
virtual const std::type_info& type() { return typeid(T); }
推荐答案
它在消息中告诉您错误:如果在编译器上使用no-rtti
标志,则typeid
将不可用.只需启用RTTI;毕竟它是C ++的一部分.
It's telling you the error right in the message: if you use the no-rtti
flag on the compiler, then typeid
is not going to be available. Just enable RTTI; it's part of C++ after all.
这篇关于错误:无法将typeid与-fno-rtti一起使用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!