Compilation problem

Get answers to all your basic programming questions. No Ogre questions, please!
Post Reply
Uma
Gnoblar
Posts: 23
Joined: Fri Mar 28, 2014 8:01 am

Compilation problem

Post by Uma »

Hi,

I'm compiling a application and it contains following line, which throws an error. I use ogre 1.8.

Code: Select all

Ogre::Root *root = new Ogre::Root();
Ogre::RenderSystemList *rsList = root::getSingleton().getAvailableRenderers();
The error is as follows:
Error C2440: 'initializing' : cannot convert from 'const Ogre::RenderSystemList' to 'Ogre::RenderSystemList *'
User avatar
Klaim
Old One
Posts: 2565
Joined: Sun Sep 11, 2005 1:04 am
Location: Paris, France
x 56
Contact:

Re: Compilation problem

Post by Klaim »

Look closely at the error report: getAvailableRenderers() returns a const reference, not a pointer...
Uma
Gnoblar
Posts: 23
Joined: Fri Mar 28, 2014 8:01 am

Re: Compilation problem

Post by Uma »

Thanks for your help, I edited my code as follows:

Code: Select all

const Ogre::RenderSystemList *rsList = Ogre::Root::getSingleton().getAvailableRenderers();
And,

Code: Select all

const Ogre::RenderSystemList& rsList = Ogre::Root::getSingleton().getAvailableRenderers();
Second one is work(first one gets same error), but I have other code beyond like this:

Code: Select all

Ogre::RenderSystem *selectedRenderSystem = NULL;
  bool foundit = false;
  for( int c = 0; c<(int)rsList->size(); c++ )
  {
    selectedRenderSystem = rsList->at(c);
    Ogre::String rname = selectedRenderSystem->getName();
    if(rname.compare("Direct3D9 Rendering SubSystem")==0)
    {
      foundit=true;
      break;
    }
  }
So it throws error:
Error C2232: '->std::vector<_Ty,_Ax>::at' : left operand has 'class' type, use '.'


Am I miss something?
User avatar
c6burns
Beholder
Posts: 1512
Joined: Fri Feb 22, 2013 4:44 am
Location: Deep behind enemy lines
x 138

Re: Compilation problem

Post by c6burns »

change -> to .
Uma
Gnoblar
Posts: 23
Joined: Fri Mar 28, 2014 8:01 am

Re: Compilation problem

Post by Uma »

It works, Thanks for your help.

Now I got these errors in my application:
Error LNK1120: 1 unresolved externals
Error LNK2019: unresolved external symbol _WinMain@16 referenced in function ___tmainCRTStartup
Anyone knows how to solve this..........
User avatar
c6burns
Beholder
Posts: 1512
Joined: Fri Feb 22, 2013 4:44 am
Location: Deep behind enemy lines
x 138

Re: Compilation problem

Post by c6burns »

Maybe you have a main instead of a WinMain. Maybe you meant to make a console project (which uses main as an entry point), but made a windows project (which uses WinMain). Or maybe you just have no main of any kind.
Uma
Gnoblar
Posts: 23
Joined: Fri Mar 28, 2014 8:01 am

Re: Compilation problem

Post by Uma »

Yes, I got it.
But in the WinMain, app.go(); throws an error.
Error C2039: 'go' : is not a member of 'VideoSettings'
User avatar
Klaim
Old One
Posts: 2565
Joined: Sun Sep 11, 2005 1:04 am
Location: Paris, France
x 56
Contact:

Re: Compilation problem

Post by Klaim »

We can't know what is app we don't have your code. Check it's type interface, you are certainly calling something that isn't there.
User avatar
c6burns
Beholder
Posts: 1512
Joined: Fri Feb 22, 2013 4:44 am
Location: Deep behind enemy lines
x 138

Re: Compilation problem

Post by c6burns »

Klaim is right, the error is telling you VideoSettings::go does not exist. Maybe you are using the tutorial framework, but you haven't defined VideoSettings to inherit from BaseApplication? Like so:

Code: Select all

class MyTutorialFrameworkApp : public BaseApplication
In that example, MyTutorialFrameworkApp inherits BaseApplication::go
Uma
Gnoblar
Posts: 23
Joined: Fri Mar 28, 2014 8:01 am

Re: Compilation problem

Post by Uma »

Thanks all,

I'll try it. :)
ronitkhan
Gnoblar
Posts: 1
Joined: Fri Jul 11, 2014 6:26 am

Re: Compilation problem

Post by ronitkhan »

I started getting compilation errors and I am not sure what is causing them. The error messages don't give me much info and I don't know even where to start trouble shooting. I did change if I accidentally change the engine code and I didn't.

Here are the first few lines of error messages in the hope that someone will recognize the problem:

Code:
...
19> PCH.UTG.UTG.h.cpp
19>d:\dev\projects\ue4\engine\source\runtime\coreuobject\public\uobject\UObjectHash.h(52): error C2440: 'default argument' : cannot convert from 'EName' to 'FName'
19> Source or target has incomplete type
19>d:\dev\projects\ue4\engine\source\runtime\coreuobject\public\uobject\UObjectGlobals.h(10): error C2504: 'FLogCategory' : base class undefined
19>d:\dev\projects\ue4\engine\source\runtime\coreuobject\public\uobject\UObjectGlobals.h(10): error C2143: syntax error : missing ',' before '<'
19>d:\dev\projects\ue4\engine\source\runtime\coreuobject\public\uobject\UObjectGlobals.h(10): error C2039: 'Log' : is not a member of 'ELogVerbosity'
19>d:\dev\projects\ue4\engine\source\runtime\coreuobject\public\uobject\UObjectGlobals.h(10): error C2039: 'All' : is not a member of 'ELogVerbosity'
19>d:\dev\projects\ue4\engine\source\runtime\coreuobject\public\uobject\UObjectGlobals.h(10): error C2614: 'FLogCategoryLogUObjectGlobals' : illegal member initialization: 'FLogCategory' is not a base or member
User avatar
c6burns
Beholder
Posts: 1512
Joined: Fri Feb 22, 2013 4:44 am
Location: Deep behind enemy lines
x 138

Re: Compilation problem

Post by c6burns »

You are compiling unreal engine 4 code and asking for help from Ogre community? Unreal has their own community for this.
Post Reply