从MSVC移植到GCC,模糊错误 [英] Porting from MSVC to GCC, vague errors

查看:69
本文介绍了从MSVC移植到GCC,模糊错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

正如标题所说,我正在将一些代码从MSVC(不确定哪个版本,使用Visual Studio 2008)移植到GCC 4.0,而GCC 4.0会产生大量的一般错误.GCC 4.0没有错误或警告。

项目使用一个大的头文件''precompiled.h'',它包含两个其他头文件,math / math.h和math / vector.h。我已经禁用导致其他错误的ALWAYS_SEARCH_USER_PATHS。


来自math / math.h

As the title says, I am porting some code from MSVC (not sure which version, using Visual Studio 2008), which compiles without errors or warnings, to GCC 4.0 which generates a large number of generic errors.

The project uses a large header file ''precompiled.h'' which includes two other header files, math/math.h and math/vector.h in that order. I''ve already disabled the ALWAYS_SEARCH_USER_PATHS which was causing other errors.

From math/math.h

展开 | 选择 | Wrap | 行号

推荐答案

我怀疑我对此有什么帮助,但也许你可以发布你的makefile?这听起来像是你的包含或你的makefile的问题。
I doubt I can be of any help with this, but maybe you could post your makefile? It sounds like a problem with either your includes or your makefile.


我正在使用Xcode作为我的开发环境,我不确定在哪里查看makefile。它在尝试创建预编译的头文件对象 /precompiled.h.gch 时失败,这是第一个被编译的对象。


使用-H编译器标志我可以看到正在以正确的顺序添加标头,并且在包含所有标头之后才会生成错误。因为这个代码在MSVC中编译没有错误我假设它是GCC特有的东西。
I''m using Xcode as my development environment and I''m not sure where exactly to view the makefile. It fails while trying to create the precompiled header object /precompiled.h.gch, which is the first object being compiled.

By using the -H compiler flag I can see that the headers are being added in the correct order, and errors are not generated until after all the headers have been included. Since this the code compiles without errors in MSVC I''m assuming it''s something specific with GCC.


好的,我明白了,对不起。我以为你只是使用文本编辑器,手工编写makefile,并从shell运行gcc。
Okay, I see, sorry. I had thought you were just using a text editor, writing the makefiles by hand, and running gcc from the shell.


这篇关于从MSVC移植到GCC,模糊错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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