Debug Error , QT 6_2_1 MSVC20119 when i try to use OGR 3D in Qt
-
I have exactly the same problem when I try to use a console application, with another code approach ,
here's my .main fileclass Application { public : Application(); ~Application(); void Start(); void Run(); void Exit(); public : Ogre::Root* pRoot; Ogre::SceneManager* pSceneManager; Ogre::RenderWindow* pRenderWindow; Ogre::Viewport* pViewport; Ogre::Camera* pCamera; }; Application::Application() { pRoot = 0; pSceneManager = 0; pRenderWindow = 0; pViewport = 0; pCamera = 0; } Application::~Application() { Exit(); } void Application::Run() { pRoot->startRendering(); } void Application::Start() { qInfo() << "tested"; pRoot = new Ogre::Root(); qInfo() << "tested"; pRenderWindow = pRoot->initialise(true,"Ma premiere application Ogre"); pSceneManager = pRoot->createSceneManager("MonGestionnaireDeScene"); pCamera = pSceneManager->createCamera("MaCamera"); pViewport = pRenderWindow->addViewport(pCamera); } void Application::Exit() { if (pRoot!=0) delete pRoot; } #if OGRE_PLATFORM == OGRE_PLATFORM_WIN32 #define WIN32_LEAN_AND_MEAN #include "windows.h" INT WINAPI WinMain( HINSTANCE hInst, HINSTANCE, LPSTR strCmdLine, INT ) #else int main(int argc, char **argv) #endif { try { Application MonApplication ; MonApplication.Start (); MonApplication.Run() ; qInfo() << "tested"; MonApplication.Exit(); } catch( Ogre::Exception &e ) { #if OGRE_PLATFORM == OGRE_PLATFORM_WIN32 //MessageBox( NULL, e.what(), "An exception has occurred!", MB_OK | MB_ICONERROR | MB_TASKMODAL); qInfo() << "fucking"; #else fprintf(stderr, "An exception has occurred: %s\n", e.what()); #endif } return 0; }
-
hi , and thank you for your answer,
i run in debugger , and crashed here
when i create an instance of this classQOgreBasicTest *testOgre = new QOgreBasicTest();
@Alex42 said in Debug Error , QT 6_2_1 MSVC20119 when i try to use OGR 3D in Qt:
i run in debugger , and crashed here
What I see in your screenshot is the debugger stopped at a breakpoint on the start of
on_pushButton_clicked()
, not "crashed" in the screenshot like you claim?when i create an instance of this class
QOgreBasicTest *testOgre = new QOgreBasicTest();
If it crashes while executing that line then let it do so and show the stack trace after the crash has happened?
-
@JonB said in Debug Error , QT 6_2_1 MSVC20119 when i try to use OGR 3D in Qt:
What I see in your screenshot is the debugger stopped at a breakpoint on the start of on_pushButton_clicked(), not "crashed" in the screenshot like you claim?
hi @JonB thank you for your answer
here the screenshot when i try to unfold the debug withe another exception
-
(other program )when i run in only main cpp , i have the same problem
Application MonApplication ; MonApplication.Start (); MonApplication.Run() ;
-
You're mixing debug and release dlls which is not allowed under windows. Compile ogre in debug mode and use these libraries. You must not mix VCRUNTIMExxx.dll and VCRUNTIMExxxD.dll