Jump to content
  • Advertisement
Sign in to follow this  
3dmodelerguy

#define errors

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

here is my code: #ifndef DEFINES_H #define DEFINES_H #include "PrecompiledHeaders.h" #define AddGLSupport( wxString name, wxFrame frame, wxPoint point, wxSize size, DWORD style, wxString string ) wxGLCanvas *name = new wxGLCanvas( frame, -1, point, size, style, string); #endif here are my errors: Deleting intermediate files and output files for project 'Stromgage 3D Game Engine - Win32 Debug'. --------------------Configuration: Stromgage 3D Game Engine - Win32 Debug-------------------- Compiling... PrecompiledHeaders.cpp Compiling... GameWindow.cpp GLCanvas.cpp MainApp.cpp c:\stromgage 3d game engine\stromgage 3d game engine\defines.h(6) : error C2010: 'n' : unexpected in macro formal parameter list c:\stromgage 3d game engine\stromgage 3d game engine\defines.h(6) : error C2010: 'f' : unexpected in macro formal parameter list c:\stromgage 3d game engine\stromgage 3d game engine\defines.h(6) : error C2010: 'p' : unexpected in macro formal parameter list c:\stromgage 3d game engine\stromgage 3d game engine\defines.h(6) : error C2010: 's' : unexpected in macro formal parameter list c:\stromgage 3d game engine\stromgage 3d game engine\defines.h(6) : error C2010: 'S' : unexpected in macro formal parameter list c:\stromgage 3d game engine\stromgage 3d game engine\defines.h(6) : error C2010: 's' : unexpected in macro formal parameter list c:\stromgage 3d game engine\stromgage 3d game engine\defines.h(6) : error C2009: reuse of macro formal 'wxString' c:\stromgage 3d game engine\stromgage 3d game engine\defines.h(7) : error C2065: 'frame' : undeclared identifier c:\stromgage 3d game engine\stromgage 3d game engine\defines.h(7) : error C2065: 'point' : undeclared identifier c:\stromgage 3d game engine\stromgage 3d game engine\defines.h(7) : error C2065: 'size' : undeclared identifier c:\stromgage 3d game engine\stromgage 3d game engine\defines.h(7) : error C2065: 'style' : undeclared identifier c:\stromgage 3d game engine\stromgage 3d game engine\defines.h(7) : error C2065: 'string' : undeclared identifier what are these errors?

Share this post


Link to post
Share on other sites
Advertisement
Your errors are most likely coming from trying to give your macro parameters types. The preprocessor literally just copies and replaces for macros. Because of this it's impossible to perform any type checking on its parameters.

Also, if you're trying to make that second line part of the macro, you have to put a backslash at the end of the first line.

-Auron

Share this post


Link to post
Share on other sites
Auron is right about the backslash ( \ ) at the end of the line. I made a post b/c i didn't see he said that, then I reread and was like darn...i was beat to it [smile].

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.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!