Why do I get these errors in VS when I use OGRE_NEW?

automaticoo
  • Why do I get these errors in VS when I use OGRE_NEW? automaticoo

    I am trying to get more experienced with Ogre 3D and I am following the basic tutorials on the website. All the code samples compile just fine.

    The first time I encountered an "error" was in Basic Tutorial 3.

    The code line where Visual Studio says something is not right is

    mTerrainGroup = OGRE_NEW Ogre::TerrainGroup(mSceneMgr, Ogre::Terrain::ALIGN_X_Z, 513, 12000.0f);
    

    Visual Studio compiles this line but it shows an ugly red line beneath it and on mouse hover it says

    #define OGRE_NEW new (__FILE__, __LINE__, __FUNCTION__) Error: no instance of overloaded 'operator new' matches the argument list" or if I mouse hover over Ogre::TerrainGlobalOptions() it says "Error: expected a type specifier

    I searched on Google but couldn't find my answer. I got about a year C++ experience but that was mainly with the WinSock libary.

    Thanks in advance.

  • OGRE_NEW is just an overload of the operator new. Try to replace OGRE_NEW by the normal operator new. If it compiles, there is a problem in the declaration of OGRE_NEW. Otherwise, just find the problem and uses again the OGRE_NEW operator.

    Ps: if you use OGRE_NEW, you need to use OGRE_DELETE to remove your allocated object.

Tags
c++ ogre
Related questions and answers
  • this on what I had done there, but modifying it to fit with Ogre. It is working but not correctly and I would like some help to understand what it is I am doing wrong. I have a state system and when I enter the "gamestate" I call some functions such as setting up a basic scene, creating the physics simulation. I am doing that as follows. void GameState::enter() { ... // Setup Physics... physics properties. I know there will be errors here as I get the items colliding with the ground but not with each other properly. So I would appreciate some input on what I am doing wrong. void

  • I am quite new to OpenGL, I have managed after long trial and error to integrate Nehe's Cel-Shading rendering with my Model loaders, and have them drawn using the Toon shade and outline..., In); // Get The Current Line ( NEW ) shaderData[i][0] = shaderData[i][1] = shaderData[i][2] = float(atof (Line)); // Copy Over The Value ( NEW ) } fclose...; // Looping Variable ( NEW ) char Line[255]; // Storage For 255 Characters ( NEW ) float shaderData[32][3

  • So I'm trying to start a C++, OpenGL project on Visual Studio 2010, and I have put glut.h and glut32.dll in the project directory, along with the glut.dll and glut32.lib files in a folder named "glut" in the project directory. I have also gone to "Porject Properties -> Linker -> Input -> Additional dependencies" and I have typed in "glut32.lib" at the end, and made sure I am not missing a semicolon. when I try doing #include "glut.h" in the Main.cpp file, it complains error LNK1104: cannot open file 'glut32.libkernel32.lib' Am I missing any files? What am I doing wrong here?

  • I have created an ogre application using the ogreappwizard. When I try to compile the solution I get an error saying that Parameter "basePath" cannot be a relative path.. I followed all of the instructions, and have tried reinstalling both the Ogre SDK and the appwizard. I am losing my head here. What is going on?

  • Possible Duplicate: What are good games to “earn your wings” with? Hai, I'm new to the genre "Creating Games".Previously i had done only porting.I need some suggestion's for making a game. What are the basic game logics i need to start with? - Should i write Tic-Tac-Toe game? - Actually this seem very basic to me. I'm totally confused on where to start with.I like to create big games but after starting i feel the game is too heavy to handle. Can any one list out the basic needs of a Game Play programmer? I don't mind using any platform (Flash,c

  • ); glDrawArrays(GL_TRIANGLES, 0, 6); glBindTexture(GL_TEXTURE_2D, 0); } Tried everything I can think of or find in a FBO tutorial or have read about. I don't get any errors and it returns as complete. (Also I can't seem to get it glTexImage2d a image of size width and height. says invalid values, and if I try to use GL_TEXTURE_RECTANGLE it says invalid enum :-/ but that's for a different question after I just get it working to begin with^^)

  • . I fixed those by just removing those entirely but this one cannot be removed it needs to exist. Don't know if this has anything to do with it, but I'm using visual studio 11 dev preview, and using compiler vs100 (vs10's compiler) settings. dbgheap.c Line:1322 Expression: _CrtISValidHeapPointer(pUserData) also when i use debugger none of my vars from this function show up after the error. ...][2]; stm >> matWorld.m[1][3]; } if (type == "rotationZ") { string data = nodeChildren[i]->getCharData(); stringstream stm(data); stm >>

  • i was able to compile and link V8 against my game and code interpretation works fine. However I want to divide my code and the game loop should exist in one thread and the scripting engine should run in a second thread alongside my game loop. I am using SDL and therefore tried this code to spawn a new thread SDL_CreateThread(ScriptingEngine::SpawnMain, NULL); where the following code is my...;v8::Value> result = script->Run(); context.Dispose(); return EXIT_SUCCESS; } } However I get an error like Access violation reading location 0x00000000. in api.cc

  • I've just started implementing bullet into my Ogre project. I followed the install instructions here: http://www.ogre3d.org/tikiwiki/OgreBullet+Tutorial+1 And the rest if the tutorial here: http://www.ogre3d.org/tikiwiki/OgreBullet+Tutorial+2 I got that to work fine however now I wanted to extend it to a handle a first person camera. I created a CapsuleShape and a Rigid Body (like the tutorial..., but I have no idea how Below is the code I'm using. (part of) Header File OgreBulletDynamics::DynamicsWorld *mWorld; // OgreBullet World OgreBulletCollisions::DebugDrawer *debugDrawer; std

Data information