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 » Mon Jun 16, 2014 12:00 pm

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 *'
0 x

User avatar
Klaim
Old One
Posts: 2565
Joined: Sun Sep 11, 2005 1:04 am
Location: Paris, France
Contact:

Re: Compilation problem

Post by Klaim » Mon Jun 16, 2014 12:30 pm

Look closely at the error report: getAvailableRenderers() returns a const reference, not a pointer...
0 x

Uma
Gnoblar
Posts: 23
Joined: Fri Mar 28, 2014 8:01 am

Re: Compilation problem

Post by Uma » Tue Jun 17, 2014 7:05 am

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?
0 x

User avatar
c6burns
Beholder
Posts: 1511
Joined: Fri Feb 22, 2013 4:44 am
Location: Deep behind enemy lines

Re: Compilation problem

Post by c6burns » Tue Jun 17, 2014 8:06 am

change -> to .
0 x

Uma
Gnoblar
Posts: 23
Joined: Fri Mar 28, 2014 8:01 am

Re: Compilation problem

Post by Uma » Tue Jun 17, 2014 8:47 am

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..........
0 x

User avatar
c6burns
Beholder
Posts: 1511
Joined: Fri Feb 22, 2013 4:44 am
Location: Deep behind enemy lines

Re: Compilation problem

Post by c6burns » Tue Jun 17, 2014 9:16 am

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.
0 x

Uma
Gnoblar
Posts: 23
Joined: Fri Mar 28, 2014 8:01 am

Re: Compilation problem

Post by Uma » Thu Jun 19, 2014 10:05 am

Yes, I got it.
But in the WinMain, app.go(); throws an error.
Error C2039: 'go' : is not a member of 'VideoSettings'
0 x

User avatar
Klaim
Old One
Posts: 2565
Joined: Sun Sep 11, 2005 1:04 am
Location: Paris, France
Contact:

Re: Compilation problem

Post by Klaim » Thu Jun 19, 2014 11:38 am

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.
0 x

User avatar
c6burns
Beholder
Posts: 1511
Joined: Fri Feb 22, 2013 4:44 am
Location: Deep behind enemy lines

Re: Compilation problem

Post by c6burns » Thu Jun 19, 2014 12:48 pm

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
0 x

Uma
Gnoblar
Posts: 23
Joined: Fri Mar 28, 2014 8:01 am

Re: Compilation problem

Post by Uma » Fri Jun 20, 2014 11:18 am

Thanks all,

I'll try it. :)
0 x

ronitkhan
Gnoblar
Posts: 1
Joined: Fri Jul 11, 2014 6:26 am

Re: Compilation problem

Post by ronitkhan » Fri Jul 11, 2014 6:36 am

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
0 x

User avatar
c6burns
Beholder
Posts: 1511
Joined: Fri Feb 22, 2013 4:44 am
Location: Deep behind enemy lines

Re: Compilation problem

Post by c6burns » Fri Jul 11, 2014 6:42 am

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

Post Reply