Jump to content
  • Advertisement
Macin2

C++ I dont want so-called VS2010 "errors" to be errors

This topic is 436 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hello,

I have a game which I originally wrote in DevCpp and Opengl2.0, but now I switched to Visual Studio (2010) and Opengl3.0, cause it allows a lot of things that are mandatory for making the game cool. I had to take VS cause there doesnt exist Devpack for anything else than OpenGl2. So I have run an OpenGl sample in VS2010, and everything is good. But when I loaded my game, it started to throw me a lot of errors, which DevCpp didnt throw, and instead it normally compiled. It is mainly error C2864: "only static const integral data members can be initialized within a class", but there are even some others. I know that I could fix it manually in program, but the rework would be brutal and time-consuming cause the project is BIG. I dont wanna do that. I just want the VS2010 compiler to behave like DevC++ one and normally do its job and compile it for me. I tried some additional command line options like /std=c++11 but it said it doesnt know them. I tried /O1 cause I read somewhere it helps (didnt). It would be really cool if there existed a solution cause I really dont want to manually recheck 70k+ lines (and make additional mistakes during it).

Please help :D

Share this post


Link to post
Share on other sites
Advertisement

In general, newer compilers have better conformance to standards, only straying if the functionality is part of a vendor extension or a long-standing defect with the compiler.

Ill-formed or non-standard code will only become less and less supported, so you don't have much choice than to update your understanding of the language if you wish to move away from ancient toolchains and their quirks.

Share this post


Link to post
Share on other sites

I concur; fixing the warnings is the only course of action.  And even more so, you are upgrading from OpenGL 2.0 to 3.0.

Because this is such a large undertaking, I recommend upgrading your project and continuing development in parallel branches.  Use Visual Studio to fix warnings on one branch, and use Dev-C++ on the other branch.  Upgrade and refactor in small sprints on the upgrade branch and continue developing your game on the other.

Once the project has been fully upgraded, you can take everything you’ve learned from upgrading and migrate your changes on the other branch into your upgraded branch.  (Hopefully you are using some form of version control with those 70k+ lines!)

Good luck!

Share this post


Link to post
Share on other sites

Ideally you should use the most recent version of Visual Studio.  If for some reason you cannot, you should at least upgrade to a Visual Studio version that implements the C++ features you are using (see https://msdn.microsoft.com/en-us/library/hh567368.aspx).  If for some reason you are stuck with VS 2010, you have to change all your code so it only uses the C++ features it supports.

Edited by BFG

Share this post


Link to post
Share on other sites
5 hours ago, Macin2 said:

I just want the VS2010 compiler to behave like DevC++ one and normally do its job and compile it for me.

There's a reason that the newer VS compiler is behaving differently than the one shipped with Dev-C++: the one with Dev-C++ is over a decade old, and very buggy.  The Dev-C++ software contains over 250 known bugs.  Code that "worked" with that compiler is, in fact, incorrect and may exhibit problems in your released product.  Using a modern compiler should also result in better performance.

As others have suggested, you should probably bite the bullet and fix all of the errors in your code.   You'll end up with a better product in the long run - there are reasons that those things are considered errors.

Given you're updating to a newer IDE/compiler, why is your newer choice 7 years old?  There have been several newer versions of Visual Studio since 2010, and each version has a freely available option.  If you for some reason insist on using Dev-C++ for any future projects, at least use the more recently updated "Orwell Dev-C++" -- I still don't really recommend it, but it has at least had more recent bug fixes and has a significantly newer compiler/debugger/etc.

 

This is a fast moving field where new software and technologies are released all the time.  You certainly don't need to jump on to every new thing as it comes out -- and I would actually recommend waiting for a while and updating between projects! -- but if you want to remain relevant and produce good products you do need to make some effort to stay at least reasonably current.  Definitely, don't start any future projects using such an outdated choice of software without some very good reason!

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!