Jump to content
  • Advertisement
Sign in to follow this  
MTclip

code wont compile any more and ive gone crazy

This topic is 4595 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

i know there are posts like this all the time (ive read some, but they did not help) my question is this.. is there ever a reason that code would just not compile any more... I am using msvc++ 2003 ... basically i changed like five lines of code (moved them from one file to another ) then wham.. I get about 1300 errors.. so i move it back...but the errors are still there.. not even a clean build fixes it. all the errors are saying my class are undefined.. ive spent the last 2 hours trying to figure out whats going on... so ive decided its not my fault(even though i know it is) but i feel its at least worth asking... sorry for the retard question.. thanks..

Share this post


Link to post
Share on other sites
Advertisement
Things can blow up suddenly if you accidently deleted or inserted a {, } or ; in the wrong place. Other than that, I don't think we can be much help.

Share this post


Link to post
Share on other sites
Try to clean your project, remove precompiled headers and rebuild everything.
Check if you are editing the correct file, i.e. there isn't a second file with this name in your project. Maybe insert #error in your header file to see if it is parsed.

Share this post


Link to post
Share on other sites
yeah, that is totally what i think it is but i just cant find it...
There should really be a "I SCREWED MY CODE UP REAL BAD SO FIX IT" button

;P

Share this post


Link to post
Share on other sites
Source control is nice to have :)

Quote:

my question is this.. is there ever a reason that code would just not compile any more...


Yes, there's a reason: You made a mistake somewhere ;)

Quote:

all the errors are saying my class are undefined..


Are you using namespaces, and forgot to add them in the new file?
I have no other ideas.. (other than what SiCrane said..)

Share this post


Link to post
Share on other sites
well i found something and i dont even know what its saying

C2040: 'WereModel::GetMaterial' : 'int *(void)' differs in levels of indirection from 'void (void)'

the actuall function it complaning about looks like this
WereMaterial * GetMaterial(){return m_pMaterial;}

i know that this is not the root of my prob but its just looks strange

Share this post


Link to post
Share on other sites
First: I agree that source control is a Good Thing. If something blows up, you can always just back out to the last good configuration you checked in.


Second, here's how to diagnose your problem:

After you're done building, click on the "Output" window (no, not the "Tasks" window, the real build output window).

Scroll to the very top, and find the first error message that the compiler printed out.

What does that error message say?

Share this post


Link to post
Share on other sites
ok it does not really make sense why it says that to me but here it is

error C2146: syntax error : missing ';' before identifier 'm_timer'

here is what the code looks like up the error


#pragma once

#define WIN32_LEAN_AND_MEAN
#define VC_EXTRALEAN

#include <windows.h>
#include <d3d9.h>
#include <d3dx9.h>

#include <fstream>
#include <string>

#include "wereglobalincludes.h"

class WereEngine
{
public:

WereTimer m_timer;



also is there a way to specify the order in which files get compiled?
does it matter?

Share this post


Link to post
Share on other sites
Quote:
Original post by MTclip
error C2146: syntax error : missing ';' before identifier 'm_timer'
You're possibly missing a ';' after a class or struct definition in another file. When I was first learning C++ I found those particularly easy to leave out.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

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

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!