Jump to content
  • Advertisement
Sign in to follow this  

c++ syntax error

This topic is 1930 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 ran to this problem that I cannot figure out what's causing it. I'm using visual studio 2010 express (C++) and first this code seeme'd to work but running clean-build ends up in error.




template<class Archive,class EntClass> inline 
void loadEntityConstructData(Archive & ar, EntClass * obj, const unsigned int version)

 Point2F pos;
 F32 angle;
 std::string data;

 EntityData *entData = 0;





Gives error:
Error 220 error C2061: syntax error : identifier 'obj'

the code above is called from another template function:



template<class Archive> inline void load_construct_data(Archive & ar, classname * t, const unsigned int version) 
{ loadEntityConstructData(ar,t,version); }  


maybe someone knows what's wrong?




Share this post

Link to post
Share on other sites
Did you try removing the scope operator :: from the new call? Edited by SiCrane

Share this post

Link to post
Share on other sites

i found the problem. the new was actually overrided and that caused the problem.


#define DEBUG_NEW new(_NORMAL_BLOCK,__FILE__, __LINE__)_)
#define new DEBUG_NEW


for the memory leak detecting code. not sure if there's better way overloading the new.


thanks in anycase

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.

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!