Thread

Index > Lgi > lgi build fails on vc9
Author/Date lgi build fails on vc9
tinman
17/02/2011 3:57am
I am new to lgi and am having a look at it to see how easy / lightweight it is to use for quick projects. I'm using VC2008 Express. I've loaded the lgi_vc9.sln and set all the #define options for the 3rd party libs to 0, as I was just wanting a quick look at lgi itself.

Or do I really need them and the text about setting the defines to 0 is misleading me?

Anyway, I get a whole slew of errors for every file, all seeming to stem from the fact that there is no OsAppArguments::operator=() method. The compiler tries to generate one with the default parameters (OsAppArguments& OsAppArguments::operator=(const OsAppArguments&)) but because the GAutoPtr::operator=() does not take a const reference the compiler generated method fails to compile.

The solution seems to be to add an "OsAppArguments& OsAppArguments::operator=(OsAppArguments& rhs)" method, but note the lack of const. If that's an issue you'll maybe need to do something like copy the contents of the GAutoWString rather than trying to transfer ownership as in the simple assignment case.

Here's the lovely error message BTW:

1>------ Build started: Project: Lgi_vc9, Configuration: Debug Win32 ------
1>Compiling...
1>GInput.cpp
1>c:\David\Tools\Software Development\Libraries\GUI\LGI\3.3.0\lgi-src-v3.3.0\Lgi\include\win32\LgiOsDefs.h(84) : error C2679: binary '=' : no operator found which takes a right-hand operand of type 'const GAutoWString' (or there is no acceptable conversion)
1> c:\david\tools\software development\libraries\gui\lgi\3.3.0\lgi-src-v3.3.0\lgi\include\common\GAutoPtr.h(107): could be 'GAutoPtr<X,Arr> &GAutoPtr<X,Arr>::operator =(GAutoPtr<X,Arr>)'
1> with
1> [
1> X=char16,
1> Arr=true
1> ]
1> while trying to match the argument list '(GAutoWString, const GAutoWString)'
1> This diagnostic occurred in the compiler generated function 'OsAppArguments &OsAppArguments::operator =(const OsAppArguments &)'

Cheers.
fret
17/02/2011 9:22am
That release is quite old, I seriously suggest you checkout the current SVN and use that. I've just fixed the vs2008 build so you should be good to go. The command you want is:

svn co https://lgi.svn.sourceforge.net/svnroot/lgi/trunk lgi


In the meantime I should really make a new stable release.
tinman
17/02/2011 7:27pm
Thanks.
Reply