OGRE Wiki
Support and community documentation for Ogre3D
Ogre Forums
ogre3d.org
Log in
Username:
Password:
CapsLock is on.
Remember me (for 1 year)
Log in
Home
Tutorials
Tutorials Home
Basic Tutorials
Intermediate Tutorials
Mad Marx Tutorials
In Depth Tutorials
Older Tutorials
External Tutorials
Cookbook
Cookbook Home
CodeBank
Snippets
Experiences
Ogre Articles
Libraries
Libraries Home
Alternative Languages
Assembling A Toolset
Development Tools
OGRE Libraries
List of Libraries
Tools
Tools Home
DCC Tools
DCC Tutorials
DCC Articles
DCC Resources
Assembling a production pipeline
Development
Development Home
Roadmap
Building Ogre
Installing the Ogre SDK
Setting Up An Application
Ogre Wiki Tutorial Framework
Frequently Asked Questions
Google Summer Of Code
Help Requested
Ogre Core Articles
Community
Community Home
Projects Using Ogre
Recommended Reading
Contractors
Wiki
Immediate Wiki Tasklist
Wiki Ideas
Wiki Guidelines
Article Writing Guidelines
Wiki Styles
Wiki Page Tracker
Ogre Wiki Help
Ogre Wiki Help Overview
Help - Basic Syntax
Help - Images
Help - Pages and Structures
Help - Wiki Plugins
Toolbox
Freetags
Categories
List Pages
Structures
Trackers
Statistics
Rankings
List Galleries
Ogre Lexicon
Comments
History: Codeblocks and MS Visual Studio
View page
Source of version: 5
(current)
%prevogre% {DIV(class="Layout_box9")}{SPLIT(colsize=15%|85%)}{IMG(src="img/wiki_up/Big_Logo_Visual_C++_and_CodeBlocks.jpg")}{IMG}--- {DIV(class="bigBold")}Installing the Ogre SDK for Visual C++ 2008 & Code::Blocks{DIV} Use this guide to install the precompiled OGRE SDK for Visual C++ 2008 & Code::Blocks. Once you have OGRE downloaded and setup, learn how to ((Setting Up An Application - Shoggoth|setup your first application)).{DIV} {maketoc} !Software # Download and install Microsoft Visual C++ Express 2008 # Download and install the Ogre SDK for Visual C++ 2008. (This article was written using the 1.4.7 release) # Download and install Code::Blocks ## When installing Code::Blocks select Microsoft Visual C++ 2005/2008 as the default compiler !The demos in Code::Blocks !!Opening the demos in Code::Blocks # Run Code::Blocks # If you did not already set Microsoft Visual C++ 2005/2008 as the default compiler, do so via the Settings->Compiler and debugger... menu. # Open Samples_vc9.sln; if you installed the SDK in the default location this is c:\OgreSDK\samples\Samples_vc9.sln # Answer "Yes" to all of the questions. # File->Save workspace as... to save all the open projects as a workspace. A good place to save this is e.g. c:\OgreSDK\samples\Samples_cb.sln !!Making the demos build and run in Code::Blocks To begin with the demos will not build and run correctly. This is partly due to Samples_vc9.sln containing incorrect information, and partly due to differences between the Code::Blocks and Visual C++ IDEs. # In the left hand panel, select the project (demo) you would like to build. Right click on it and select the "Activate Project" menu item ## Trying to build the project without activating it will cause Code::blocks to build using its application wide build settings instead of the project-specific build setttings. This will result in a myriad of errors, most immediately ones like this: fatal error C1083: Cannot open include file: 'ExampleApplication.h' # Change the link options for the build targets. Right click on the demo project and select "Properties...". Select the "Build targets" tab. Select the either target in the list on the left and click on the "Build options..." button. Open the "Linker Settings" tab. ## Put quotes around "/pdb:..\..\bin\Debug Win32\Demo_[demoname].pdb" under "Other linker options" for the debug target ### If you don't do this you get an error that ..\..\bin\Debug can't be found when running the debug target ## Under "link libraries" add user32 to both build targets ### If you don't do this the linker spits out symbol errors such as: unresolved external symbol _imp__MessageBoxA@16 referenced in function _WinMain@16 ## {img src="img/wiki_up/Codeblocks_visual_c--_demo_linker_settings_complete.png" alt="Codeblocks_visual_c--_demo_linker_settings_complete.png"} ## The project will now build, but it won't run correctly. # Change the execution options for the build targets. Right click on the demo project and select "Properties...". Select the "Build targets" tab. ## Select the "Debug Win32" target ## Change the "Execution working dir" to "..\..\bin\debug" ### If you don't change the working directory, you will get the error "This application has failed to start because OgreMain_d.dll was not found..." When your program runs, the loader looks for the .dll files as well as the cfg files that tell ogre where to load media from in the current path. ## Select the "Release Win32" target ## Change the "Execution working dir" to "..\..\bin\release" ## {img src="img/wiki_up/Codeblocks_visual_c--_demo_working_directory_complete.png" alt="Codeblocks_visual_c--_demo_working_directory_complete.png"} # Build and run either target for this demo. They'll both work!
Search by Tags
Search Wiki by Freetags
Latest Changes
Ogre 2.1 FAQ
Minimal Ogre Collision
Artifex Terra
OpenMB
Advanced Mogre Framework
MogreSocks
Critter AI
Mogre Add-ons
MOGRE
Mogre MyGUI wrapper
...more
Search
Find
Advanced
Search Help
Online Users
182 online users