🎉 Celebrating 25 Years of GameDev.net! 🎉

Not many can claim 25 years on the Internet! Join us in celebrating this milestone. Learn more about our history, and thank you for being a part of our community!

Compiler error registering std::string operator==

Started by
4 comments, last by WitchLord 18 years, 11 months ago
I discovered today that this is due to using precompiled headers. Prior to using precompiled headers I had no problem registering operator== for std::string in AS. After configuring my project to use precompiled headers, no longer am I able to do so without the fatal error. Also, Deyja's preprocessor appears to suffer some incompatabilities with precompiled headers too.
Advertisement
Precompiled headers really only work if the project is written with them from the begining. I've never used them, because they are a terrible solution to the problem they are supposed to solve. So naturally my advice is: Turn off precompiled headers, and do it without the monolithic header.
I'm just trying to improve my build times. My project is rather large now and if I have to do a rebuild it takes quite some time.

Precompiled headers really are not that difficult to use. All that is required is that it is included at the beginning of each source file.

The only problems i had are those that I described, 2 small errors for a large project is not too bad. I resolved the issue just by turning precompiled headers for those 2 files off and everything works.

I just wanted to give everyone a heads up as to why msvc was giving an error message on seemingly random method pointers.
On a related note, one approach to improve build times is to have #include's defined only in your C/CPP files and not in the header files themselves. The downside of this is that you'll need to add a lot more includes in your source files, but the upside is that header dependencies are minimised, leading to shorter (incremental) build times. It should also simplify cross-dependency issues between structs/classes.
tIDE Tile Map Editorhttp://tide.codeplex.com
Or you could do it right and only include exactly what you need, ever. Headers can include headers if the header requires that header. Including more than neccessary is better than headers that only work if included in exactly the right order.
Thanks for letting us know, Rain Dog.

I'm putting together a FAQ, and have already included your solution in that one. I'm crediting you for the solution, of course. [smile]

The FAQ is still quite small, so there's not much use showing it yet, but it grows steadily. Hopefully it will be a good addition to the library manual.

Regards,
Andreas

AngelCode.com - game development and more - Reference DB - game developer references
AngelScript - free scripting library - BMFont - free bitmap font generator - Tower - free puzzle game

This topic is closed to new replies.

Advertisement