Google

My 1st Visual Studio 9 project

Problems building or running the engine, queries about how to use features etc.

Moderators: Moderators, OGRE Team

My 1st Visual Studio 9 project

Postby st33d » Sun May 18, 2008 6:28 pm

I've been trying to follow the instructions on the wiki on how to set up a VS9 project and they seem to be out of date.

The Complete Blanks Guide is of no use because the application wizard will not work for VS9.

I have tried to go through the steps listed for making a VS8 project but they don't make sense.

What chiefly concerns me is that VS9 ignores files unless you make the compiler aware of them.

ExampleApplication.h is not in the Ogre VS9 SDK.

Can anyone help me please, because I don't want to have to install yet another compiler. This is the third compiler I have downloaded and I still haven't been able to make anything in Ogre.
st33d
Newcomer
 
Posts: 10
Joined: Sun Apr 13, 2008 3:08 pm

Postby synaptic » Sun May 18, 2008 6:57 pm

Well the tutorial for vc8 should work for vc9, which part is it thats giving you trouble?

As for the ExampleApplication.h if you check the OgreSDK directory you'll find it in the Samples/include directory
User avatar
synaptic
Veteran
 
Posts: 266
Joined: Wed Jun 15, 2005 11:25 pm
Location: UK, Bath

Postby st33d » Sun May 18, 2008 7:02 pm

Oh I see it now.

Thanks.

I try it again later, I have a BBQ to go to now.
st33d
Newcomer
 
Posts: 10
Joined: Sun Apr 13, 2008 3:08 pm

Postby st33d » Mon May 19, 2008 10:54 pm

I've added those header files to a folder called "include" in the project directory.

the file structure is like so:

/bin
copied from sdk

/include
ExampleApplication.h
ExampleFrameListener.h

/media
copied from sdk

/src/
SampleApp.cpp

ogreProject.vcproj

Visual Studio give me the following error:
Code: Select all
1>Compiling...
1>SampleApp.cpp
1>c:\documents and settings\aaron\my documents\cpp\ogre\ogreproject\src\sampleapp.cpp(1) : fatal error C1083: Cannot open include file: 'ExampleApplication.h': No such file or directory
1>Build log was saved at "file://c:\Documents and Settings\Aaron\My Documents\cpp\ogre\ogreProject\Debug\BuildLog.htm"
1>ogreProject - 1 error(s), 0 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

I have used the "add existing item" option to make the solution explorer aware of the ExampleApplication.h and it still can't see it.

I forced the path by rewriting the include to "../include/ExampleApplication.h"

But now it complains it can't find Ogre.h. Was I supposed to copy more that just the two files it said to copy?

I'm getting the feeling the project must be set up wrong. I haven't tried to include from other directories before and I wasn't under the impression I'd have to put full path names in for everything.

What should I do?
st33d
Newcomer
 
Posts: 10
Joined: Sun Apr 13, 2008 3:08 pm

Postby dragon2009 » Tue May 20, 2008 12:09 am

VC9 has a problem of not checking for file existence prior to compiling.

At the top, go to Tools => Options => Projects and Solutions => VC++ Directories

Select Include Files

Add the directory where your includes are located.
dragon2009
Newcomer
 
Posts: 8
Joined: Mon May 19, 2008 6:25 pm

Postby synaptic » Tue May 20, 2008 12:51 am

I wouldnt recommend adding the includes there!!!! :shock:

Instead i would suggest that you add the files to your project settings, will save headaches later on :), simply goto

Project --> Properties
Under the C/C++-- General add the location of you includes here.

For example if your using the OgreSDK then you'd simply type $(OGRE_HOME)\include

And i believe you have structured your project in the same way as ogre so you'd need to also add ..\include as well so you'd pick up the files in your project

Jay 8)
User avatar
synaptic
Veteran
 
Posts: 266
Joined: Wed Jun 15, 2005 11:25 pm
Location: UK, Bath

Postby dragon2009 » Tue May 20, 2008 8:51 pm

synaptic wrote:I wouldnt recommend adding the includes there!!!! :shock:


Oh, have you hit any problems or found any conflicts? I have all my includes/libraries/executables there and I've had no problems so far :lol:
dragon2009
Newcomer
 
Posts: 8
Joined: Mon May 19, 2008 6:25 pm

Postby st33d » Mon May 26, 2008 9:24 pm

Okay.

I added the includes directory that was local and the include directory in the SDK to the project's properties.

Compiling part went fine. Now I've got a linking error.

Code: Select all
1>Compiling manifest to resources...
1>Microsoft (R) Windows (R) Resource Compiler Version 6.0.5724.0
1>Copyright (C) Microsoft Corporation.  All rights reserved.
1>Linking...
1>LINK : fatal error LNK1104: cannot open file 'OgreMain_d.lib'
1>Build log was saved at "file://c:\Documents and Settings\Aaron\My Documents\cpp\ogre\ogreProject\Debug\BuildLog.htm"
1>ogreProject - 1 error(s), 0 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========


I've gone through each step of the guide right. The dll is in bin/debug in the project folder, but for some reason it can't see it.

Can anyone tell me what's going on please?
st33d
Newcomer
 
Posts: 10
Joined: Sun Apr 13, 2008 3:08 pm

Postby synaptic » Mon May 26, 2008 10:47 pm

in the project settings make sure you have placed the location of the ogre library :) ie $(OGRE_HOME)\lib :) otherwise vc cant find the library
User avatar
synaptic
Veteran
 
Posts: 266
Joined: Wed Jun 15, 2005 11:25 pm
Location: UK, Bath

Postby st33d » Mon May 26, 2008 11:11 pm

I was about to ask where I do that but I found a section under Linker > General called Additional Library Directories.

That's that bug out of the way.

Code: Select all
1>------ Build started: Project: ogreProject, Configuration: Debug Win32 ------
1>Compiling...
1>SampleApp.cpp
1>Linking...
1>SampleApp.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: static class OIS::InputManager * __cdecl OIS::InputManager::createInputSystem(class std::multimap<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >,struct std::less<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > >,class std::allocator<struct std::pair<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const ,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > > > > &)" (__imp_?createInputSystem@InputManager@OIS@@SAPAV12@AAV?$multimap@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@V12@U?$less@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@2@V?$allocator@U?$pair@$$CBV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@V12@@std@@@2@@std@@@Z) referenced in function "public: __thiscall ExampleFrameListener::ExampleFrameListener(class Ogre::RenderWindow *,class Ogre::Camera *,bool,bool,bool)" (??0ExampleFrameListener@@QAE@PAVRenderWindow@Ogre@@PAVCamera@2@_N22@Z)
1>SampleApp.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: struct OIS::MouseState const & __thiscall OIS::Mouse::getMouseState(void)const " (__imp_?getMouseState@Mouse@OIS@@QBEABUMouseState@2@XZ) referenced in function "public: virtual void __thiscall ExampleFrameListener::windowResized(class Ogre::RenderWindow *)" (?windowResized@ExampleFrameListener@@UAEXPAVRenderWindow@Ogre@@@Z)
1>SampleApp.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: static void __cdecl OIS::InputManager::destroyInputSystem(class OIS::InputManager *)" (__imp_?destroyInputSystem@InputManager@OIS@@SAXPAV12@@Z) referenced in function "public: virtual void __thiscall ExampleFrameListener::windowClosed(class Ogre::RenderWindow *)" (?windowClosed@ExampleFrameListener@@UAEXPAVRenderWindow@Ogre@@@Z)
1>SampleApp.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: bool __thiscall OIS::MouseState::buttonDown(enum OIS::MouseButtonID)const " (__imp_?buttonDown@MouseState@OIS@@QBE_NW4MouseButtonID@2@@Z) referenced in function "public: bool __thiscall ExampleFrameListener::processUnbufferedMouseInput(struct Ogre::FrameEvent const &)" (?processUnbufferedMouseInput@ExampleFrameListener@@QAE_NABUFrameEvent@Ogre@@@Z)
1>..\bin\Debug\ogreProject.exe : fatal error LNK1120: 4 unresolved externals
1>Build log was saved at "file://c:\Documents and Settings\Aaron\My Documents\cpp\ogre\ogreProject\Debug\BuildLog.htm"
1>ogreProject - 5 error(s), 0 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========


I've no idea what these errors mean. Sorry about this.
st33d
Newcomer
 
Posts: 10
Joined: Sun Apr 13, 2008 3:08 pm

Postby synaptic » Mon May 26, 2008 11:52 pm

Now this one is really easy to solve just include OIS.lib for release and OIS_d.lib for debug..

When you get this kind of result look at whats its telling you, its telling you it cant find the code for OIS::InputManager so keep an eye for that :)
User avatar
synaptic
Veteran
 
Posts: 266
Joined: Wed Jun 15, 2005 11:25 pm
Location: UK, Bath

Postby st33d » Tue May 27, 2008 12:05 am

I don't know what OIS.lib is or how to include it. I tried adding it to the additional libraries and I tried using a preprocessor include. Neither worked.
st33d
Newcomer
 
Posts: 10
Joined: Sun Apr 13, 2008 3:08 pm

Postby synaptic » Tue May 27, 2008 12:28 am

Look in the OgreSDK directory

Image
User avatar
synaptic
Veteran
 
Posts: 266
Joined: Wed Jun 15, 2005 11:25 pm
Location: UK, Bath

Postby st33d » Tue May 27, 2008 11:08 pm

Thanks.

Now it is insisting that it can't find OgreMain_d.lib. I have C:/OgreSDK/lib (using forward slashes only in this post so I don't escape characters) listed under Linker > General > Additional Library Directories

In fact I just tried the literal path just now to make sure the $(OGRE_HOME) is working, but if it wasn't then it wouldn't be including the headers from the SDK. I have tried playing around with the directory and rebuilding. No joy.

Any ideas why it can't see it?
st33d
Newcomer
 
Posts: 10
Joined: Sun Apr 13, 2008 3:08 pm

Postby st33d » Wed May 28, 2008 11:00 pm

I should have posted the error.

What I didn't understand was that the dependancies needed to be space separated instead of semicolon separated like the folder references.

The project compiled! :D

However. It kept compiling it to the wrong place. VC9 insists on compiling to a capitalised "Debug" directory. Even if you set it up to compile in a non capitalised "debug" directory, it won't pull in a VC9 dll it generates. Of course the OgreSDK files are in non capitalised directories. And yes, it wants it in bin\Debug. bin\debug will compile but it won't run!

This is bloody annoying. :x

However, I managed to figure it out and get the basic Ogre test app up and running. Thanks very much for the help. I can start playing with Ogre!
st33d
Newcomer
 
Posts: 10
Joined: Sun Apr 13, 2008 3:08 pm

Postby db123 » Sat May 31, 2008 3:17 am

hahaha...
what is BBQ???
db123
Regular
 
Posts: 78
Joined: Wed May 21, 2008 5:55 am

Postby ajs15822 » Sat May 31, 2008 5:30 am

db123 wrote:hahaha...
what is BBQ???


Well, we're getting totally off-topic but since I'm from Texas, I must answer: BBQ (short-hand for "barbecue") is a cooking method where meat (usually chicken, beef, or sausage) is grilled over an open flame (usually charcoal). I believe the OP was using it in the context that he was going to attend a barbecue party.
User avatar
ajs15822
OGRE Expert User
OGRE Expert User
 
Posts: 564
Joined: Mon Jan 02, 2006 2:05 am
Location: Texas

how can i configure project properties

Postby shakurshams » Sat Oct 18, 2008 9:11 pm

this is my first post in the forum.i am having problem compiling an ogre application.
Alothough all the sample applications were built and ran succesfuly , i cant compile my own application which is provided in the link below :
http://www.ogre3d.org/wiki/index.php/Basic_Tutorial_1

so i think i am having the linking problem.plzz help me out.i am giving u a full description of wat i did

1. i installed VS2008 , ogere SDK 1.4.7 and Direct X runtime. (i told before that sample app are runnig so i think there is no prob with installing ).

2.then i followed this link and i did exactly wat it says:
http://www.ogre3d.org/wiki/index.php/SettingUpAnApplication#Microsoft_Visual_C.2B.2B_6_.28SP3.2B.29


3. i created same kind of folders and to configure the properties of the project i follwed the first 3 steps mentioned in the link above.to clarify i am giving u the heading of those 3 steps (these r just the headings):

i. Select project properties and under
configuration properties add the following:
ii. And, for those using Ogre3D 1.4.x
iii. And, for those using the SDK:

i just copied and paste all those in the respective fields .And yes i separated additional dependences with a space.

after this when i am trying to build ...the compiler shows this error message:
Code: Select all
------ Rebuild All started: Project: testproject, Configuration: Debug Win32 ------
Deleting intermediate and output files for project 'testproject', configuration 'Debug|Win32'
Compiling...
solve.cpp
Compiling manifest to resources...
Microsoft (R) Windows (R) Resource Compiler Version 6.0.5724.0
Copyright (C) Microsoft Corporation.  All rights reserved.
Linking...
MSVCRTD.lib(crtexe.obj) : error LNK2019: unresolved external symbol _main referenced in function ___tmainCRTStartup
..\bin\Debug\testproject.exe : fatal error LNK1120: 1 unresolved externals
Build log was saved at "file://c:\ogk\testsolution\testproject\Debug\BuildLog.htm"
testproject - 2 error(s), 0 warning(s)
========== Rebuild All: 0 succeeded, 1 failed, 0 skipped ==========


plz pple dont laugh at me . i am an ameture and i still dont understand these things clearly.
plzz help me as it is giving me so much pain.
thnx in advance.
:oops: [/b]
shakurshams
Newcomer
 
Posts: 2
Joined: Sat Oct 18, 2008 8:53 pm

Postby DreamPath » Tue Nov 25, 2008 3:37 pm

Probably you create "Console Application" NOT "Window Application".
thats way you have this error.

Do somethink that:
Go to Project->Properties->Configuration Properties->Linker->System tab and set "Windows (/SUBSYSTEM:WINDOWS)" in Subsystem
DreamPath
Newcomer
 
Posts: 3
Joined: Tue Nov 25, 2008 3:31 pm

Re: how can i configure project properties

Postby jacmoe » Tue Nov 25, 2008 9:25 pm

shakurshams wrote:plzz help me as it is giving me so much pain.

If you can't take that, you can't take being a programmer! Get used to it, and get used to it fast! :twisted:

I think you are doing just fine. :wink:
/* when invited to a free lunch, you should not complain about the quality of the caviar */
Ogitor Scenebuilder - powered by Ogre, presented by Qt, Fueled by Passion.
Ogre AppWizards - project wizards for Visual Studio and Code::Blocks.
User avatar
jacmoe
OGRE Moderator
OGRE Moderator
 
Posts: 17493
Joined: Thu Jan 22, 2004 10:13 am
Location: Denmark


Return to Help

Who is online

Users browsing this forum: Google [Bot], Mako_energy, NQ and 10 guests