|
Boost Users : |
From: Christian Henning (chhenning_at_[hidden])
Date: 2007-10-30 10:25:33
Thanks guys, that solved this problem.
Still I'm having compilation errors. I'm trying to compile the following code:
#include "car.hpp"
#include <boost/extension/extension.hpp>
#include <boost/reflection/reflection.hpp>
#include <boost/reflection/reflector.hpp>
int _tmain(int argc, _TCHAR* argv[])
{
boost::extension::reflection<car, std::string> car_reflection( "A Car!" );
return 0;
}
The car class is separated into a header file. The errors have
something to do with the extension namespace. Here are some examples:
1>c:\documents and settings\i64044\my documents\visual studio
2005\projects\reflection\reflection\reflection.cpp(13) : error C3083:
'extension': the symbol to the left of a '::' must be a type
1>c:\documents and settings\i64044\my documents\visual studio
2005\projects\reflection\reflection\reflection.cpp(13) : error C2039:
'reflection' : is not a member of 'boost'
1>c:\documents and settings\i64044\my documents\visual studio
2005\projects\reflection\reflection\reflection.cpp(13) : error C2065:
'reflection' : undeclared identifier
1>c:\documents and settings\i64044\my documents\visual studio
2005\projects\reflection\reflection\reflection.cpp(13) : error C2275:
'car' : illegal use of this type as an expression
1> c:\documents and settings\i64044\my documents\visual studio
2005\projects\reflection\reflection\car.hpp(15) : see declaration of
'car'
1>c:\documents and settings\i64044\my documents\visual studio
2005\projects\reflection\reflection\reflection.cpp(13) : error C2275:
'std::string' : illegal use of this type as an expression
1>c:\documents and settings\i64044\my documents\visual studio
2005\projects\reflection\reflection\reflection.cpp(13) : error C3861:
'car_reflection': identifier not found
I think the real question is what header files and compiler symbols I
need to use to have the code compiling? The documentation is a little
spares on details.
Thanks,
Christian
On 10/30/07, Ovanes Markarian <om_boost_at_[hidden]> wrote:
> I think his problem is that VC++ wizard automatically uses MB-charset for
> wizard generated projects. I assume the lib itself uses LoadLibrary, which
> expands dependent on the MB-Setting to either LoadLibraryA or LoadLibraryW.
>
> Right-click on the project and select Properties; in the General tree node
> set the Character Set to 'Not Set' instead of Multi-Byte... Than it should
> be fine.
>
>
> Best Regards,
> Ovanes
>
>
> On 10/30/07, Johan Nilsson <r.johan.nilsson_at_[hidden]> wrote:
> > Christian Henning wrote:
> > > Hi there, I just pulled the latest reflection code from the sandbox
> > > and tried to compile the example. But unfortunately there are
> > > compilation errors.
> > >
> > > For example:
> > >
> > >
> c:\boost-sandbox\boost\extension\impl\library_impl.hpp(37)
> : error
> > > C2664: 'LoadLibraryW' : cannot convert parameter 1 from 'const char *'
> > > to 'LPCWSTR'
> > >
> > > Is the relection lib in a usable stage?
> >
> > I don't know, but try to compile using the "Multi-Byte character set" flag
> > to get rid of the above error (assuming that you are using VC++).
> >
> > If the library only supports multi-byte mode, it should probably
> explicitly
> > use the Ansi varieties of the Win32 APIs.
> >
> > / Johan
> >
> >
> > _______________________________________________
> > Boost-users mailing list
> > Boost-users_at_[hidden]
> > http://lists.boost.org/mailman/listinfo.cgi/boost-users
> >
>
>
> _______________________________________________
> Boost-users mailing list
> Boost-users_at_[hidden]
> http://lists.boost.org/mailman/listinfo.cgi/boost-users
>
Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net