Developer forums (C::B DEVELOPMENT STRICTLY!) > Development
Compile Errors With Visual C++ .Net 2003
(1/1)
Tsurumaru:
I've been playing with the source for a couple days and have solved most of the problems that have come up but this one is beyond me.
Esentially this section of code genrates lots of type cast errors
--- Code: (cpp) ---template <class T> void Register_CompileTargetBase(asIScriptEngine* engine, const wxString& classname)
{
// add CompileOptionsBase methods/properties
Register_CompileOptionsBase<T>(engine, classname);
engine->RegisterObjectMethod(cbU2C(classname), "wxString& GetFilename()", asMETHOD(T, GetFilename), asCALL_THISCALL);
engine->RegisterObjectMethod(cbU2C(classname), "wxString& GetTitle()", asMETHOD(T, GetTitle), asCALL_THISCALL);
engine->RegisterObjectMethod(cbU2C(classname), "void SetTitle(const wxString& in)", asMETHOD(T, SetTitle), asCALL_THISCALL);
engine->RegisterObjectMethod(cbU2C(classname), "void SetOutputFilename(const wxString& in)", asMETHOD(T, SetOutputFilename), asCALL_THISCALL);
engine->RegisterObjectMethod(cbU2C(classname), "void SetWorkingDir(const wxString& in)", asMETHOD(T, SetWorkingDir), asCALL_THISCALL);
engine->RegisterObjectMethod(cbU2C(classname), "void SetObjectOutput(const wxString& in)", asMETHOD(T, SetObjectOutput), asCALL_THISCALL);
engine->RegisterObjectMethod(cbU2C(classname), "void SetDepsOutput(const wxString& in)", asMETHOD(T, SetDepsOutput), asCALL_THISCALL);
engine->RegisterObjectMethod(cbU2C(classname), "int GetOptionRelation(int)", asMETHOD(T, GetOptionRelation), asCALL_THISCALL);
engine->RegisterObjectMethod(cbU2C(classname), "void SetOptionRelation(int,int)", asMETHOD(T, SetOptionRelation), asCALL_THISCALL);
engine->RegisterObjectMethod(cbU2C(classname), "wxString GetWorkingDir()", asMETHOD(T, GetWorkingDir), asCALL_THISCALL);
engine->RegisterObjectMethod(cbU2C(classname), "wxString GetObjectOutput()", asMETHOD(T, GetObjectOutput), asCALL_THISCALL);
engine->RegisterObjectMethod(cbU2C(classname), "wxString GetDepsOutput()", asMETHOD(T, GetDepsOutput), asCALL_THISCALL);
engine->RegisterObjectMethod(cbU2C(classname), "wxString GetOutputFilename()", asMETHOD(T, GetOutputFilename), asCALL_THISCALL);
engine->RegisterObjectMethod(cbU2C(classname), "wxString SuggestOutputFilename()", asMETHOD(T, SuggestOutputFilename), asCALL_THISCALL);
engine->RegisterObjectMethod(cbU2C(classname), "wxString GetExecutableFilename()", asMETHOD(T, GetExecutableFilename), asCALL_THISCALL);
engine->RegisterObjectMethod(cbU2C(classname), "wxString GetDynamicLibFilename()", asMETHOD(T, GetDynamicLibFilename), asCALL_THISCALL);
engine->RegisterObjectMethod(cbU2C(classname), "wxString GetStaticLibFilename()", asMETHOD(T, GetStaticLibFilename), asCALL_THISCALL);
engine->RegisterObjectMethod(cbU2C(classname), "wxString GetBasePath()", asMETHOD(T, GetBasePath), asCALL_THISCALL);
engine->RegisterObjectMethod(cbU2C(classname), "void SetTargetType(const int& in)", asMETHOD(T, SetTargetType), asCALL_THISCALL);
engine->RegisterObjectMethod(cbU2C(classname), "int& GetTargetType()", asMETHOD(T, GetTargetType), asCALL_THISCALL);
engine->RegisterObjectMethod(cbU2C(classname), "wxString& GetExecutionParameters()", asMETHOD(T, GetExecutionParameters), asCALL_THISCALL);
engine->RegisterObjectMethod(cbU2C(classname), "void SetExecutionParameters(const wxString& in)", asMETHOD(T, SetExecutionParameters), asCALL_THISCALL);
engine->RegisterObjectMethod(cbU2C(classname), "wxString& GetHostApplication()", asMETHOD(T, GetHostApplication), asCALL_THISCALL);
engine->RegisterObjectMethod(cbU2C(classname), "void SetHostApplication(const wxString& in)", asMETHOD(T, SetHostApplication), asCALL_THISCALL);
engine->RegisterObjectMethod(cbU2C(classname), "void SetCompilerID(const wxString& in)", asMETHOD(T, SetCompilerID), asCALL_THISCALL);
engine->RegisterObjectMethod(cbU2C(classname), "const wxString& GetCompilerID() const", asMETHOD(T, GetCompilerID), asCALL_THISCALL);
}
--- End code ---
Here's what the Visual C++ 2003 compiler(Note not the free toolkit) emits:
--- Code: (cpp) ---sdk\as\bindings\scriptbindings.cpp(282) : error C2440: 'type cast' : cannot convert from 'const wxString &(__thiscall CompileTargetBase::* )(void)' to 'void (__thiscall ProjectBuildTarget::* )(void)'
Pointers to members have different representations; cannot cast between them
sdk\as\bindings\scriptbindings.cpp(341) : see reference to function template instantiation 'void Register_CompileTargetBase<ProjectBuildTarget>(asIScriptEngine *,const wxString &)' being compiled
sdk\as\bindings\scriptbindings.cpp(283) : error C2440: 'type cast' : cannot convert from 'const wxString &(__thiscall CompileTargetBase::* )(void)' to 'void (__thiscall ProjectBuildTarget::* )(void)'
Pointers to members have different representations; cannot cast between them
sdk\as\bindings\scriptbindings.cpp(284) : error C2440: 'type cast' : cannot convert from 'void (__thiscall CompileTargetBase::* )(const wxString &)' to 'void (__thiscall ProjectBuildTarget::* )(void)'
Pointers to members have different representations; cannot cast between them
sdk\as\bindings\scriptbindings.cpp(285) : error C2440: 'type cast' : cannot convert from 'void (__thiscall CompileTargetBase::* )(const wxString &)' to 'void (__thiscall ProjectBuildTarget::* )(void)'
Pointers to members have different representations; cannot cast between them
sdk\as\bindings\scriptbindings.cpp(286) : error C2440: 'type cast' : cannot convert from 'void (__thiscall CompileTargetBase::* )(const wxString &)' to 'void (__thiscall ProjectBuildTarget::* )(void)'
Pointers to members have different representations; cannot cast between them
sdk\as\bindings\scriptbindings.cpp(287) : error C2440: 'type cast' : cannot convert from 'void (__thiscall CompileTargetBase::* )(const wxString &)' to 'void (__thiscall ProjectBuildTarget::* )(void)'
Pointers to members have different representations; cannot cast between them
sdk\as\bindings\scriptbindings.cpp(288) : error C2440: 'type cast' : cannot convert from 'void (__thiscall CompileTargetBase::* )(const wxString &)' to 'void (__thiscall ProjectBuildTarget::* )(void)'
Pointers to members have different representations; cannot cast between them
sdk\as\bindings\scriptbindings.cpp(289) : error C2440: 'type cast' : cannot convert from 'OptionsRelation (__thiscall CompileTargetBase::* )(OptionsRelationType)' to 'void (__thiscall ProjectBuildTarget::* )(void)'
Pointers to members have different representations; cannot cast between them
sdk\as\bindings\scriptbindings.cpp(290) : error C2440: 'type cast' : cannot convert from 'void (__thiscall CompileTargetBase::* )(OptionsRelationType,OptionsRelation)' to 'void (__thiscall ProjectBuildTarget::* )(void)'
Pointers to members have different representations; cannot cast between them
sdk\as\bindings\scriptbindings.cpp(291) : error C2440: 'type cast' : cannot convert from 'wxString (__thiscall CompileTargetBase::* )(void)' to 'void (__thiscall ProjectBuildTarget::* )(void)'
Pointers to members have different representations; cannot cast between them
sdk\as\bindings\scriptbindings.cpp(292) : error C2440: 'type cast' : cannot convert from 'wxString (__thiscall CompileTargetBase::* )(void)' to 'void (__thiscall ProjectBuildTarget::* )(void)'
Pointers to members have different representations; cannot cast between them
sdk\as\bindings\scriptbindings.cpp(293) : error C2440: 'type cast' : cannot convert from 'wxString (__thiscall CompileTargetBase::* )(void)' to 'void (__thiscall ProjectBuildTarget::* )(void)'
Pointers to members have different representations; cannot cast between them
sdk\as\bindings\scriptbindings.cpp(294) : error C2440: 'type cast' : cannot convert from 'wxString (__thiscall CompileTargetBase::* )(void)' to 'void (__thiscall ProjectBuildTarget::* )(void)'
Pointers to members have different representations; cannot cast between them
sdk\as\bindings\scriptbindings.cpp(295) : error C2440: 'type cast' : cannot convert from 'wxString (__thiscall CompileTargetBase::* )(void)' to 'void (__thiscall ProjectBuildTarget::* )(void)'
Pointers to members have different representations; cannot cast between them
sdk\as\bindings\scriptbindings.cpp(296) : error C2440: 'type cast' : cannot convert from 'wxString (__thiscall CompileTargetBase::* )(void)' to 'void (__thiscall ProjectBuildTarget::* )(void)'
Pointers to members have different representations; cannot cast between them
sdk\as\bindings\scriptbindings.cpp(297) : error C2440: 'type cast' : cannot convert from 'wxString (__thiscall CompileTargetBase::* )(void)' to 'void (__thiscall ProjectBuildTarget::* )(void)'
Pointers to members have different representations; cannot cast between them
sdk\as\bindings\scriptbindings.cpp(298) : error C2440: 'type cast' : cannot convert from 'wxString (__thiscall CompileTargetBase::* )(void)' to 'void (__thiscall ProjectBuildTarget::* )(void)'
Pointers to members have different representations; cannot cast between them
sdk\as\bindings\scriptbindings.cpp(299) : error C2440: 'type cast' : cannot convert from 'wxString (__thiscall CompileTargetBase::* )(void)' to 'void (__thiscall ProjectBuildTarget::* )(void)'
Pointers to members have different representations; cannot cast between them
sdk\as\bindings\scriptbindings.cpp(301) : error C2440: 'type cast' : cannot convert from 'const TargetType &(__thiscall CompileTargetBase::* )(void)' to 'void (__thiscall ProjectBuildTarget::* )(void)'
Pointers to members have different representations; cannot cast between them
sdk\as\bindings\scriptbindings.cpp(302) : error C2440: 'type cast' : cannot convert from 'const wxString &(__thiscall CompileTargetBase::* )(void)' to 'void (__thiscall ProjectBuildTarget::* )(void)'
Pointers to members have different representations; cannot cast between them
sdk\as\bindings\scriptbindings.cpp(303) : error C2440: 'type cast' : cannot convert from 'void (__thiscall CompileTargetBase::* )(const wxString &)' to 'void (__thiscall ProjectBuildTarget::* )(void)'
Pointers to members have different representations; cannot cast between them
sdk\as\bindings\scriptbindings.cpp(304) : error C2440: 'type cast' : cannot convert from 'const wxString &(__thiscall CompileTargetBase::* )(void)' to 'void (__thiscall ProjectBuildTarget::* )(void)'
Pointers to members have different representations; cannot cast between them
sdk\as\bindings\scriptbindings.cpp(305) : error C2440: 'type cast' : cannot convert from 'void (__thiscall CompileTargetBase::* )(const wxString &)' to 'void (__thiscall ProjectBuildTarget::* )(void)'
Pointers to members have different representations; cannot cast between them
sdk\as\bindings\scriptbindings.cpp(306) : error C2440: 'type cast' : cannot convert from 'void (__thiscall CompileTargetBase::* )(const wxString &)' to 'void (__thiscall ProjectBuildTarget::* )(void)'
Pointers to members have different representations; cannot cast between them
sdk\as\bindings\scriptbindings.cpp(307) : error C2440: 'type cast' : cannot convert from 'const wxString &(__thiscall CompileTargetBase::* )(void)' to 'void (__thiscall ProjectBuildTarget::* )(void)'
Pointers to members have different representations; cannot cast between them
--- End code ---
Thanks in advance. I'd really like to get this to compile so I can hopefully maybe contribute some in the future.
I might also point out that I just did an update from the repository 30 minutes ago so my source copy is updated.
mandrav:
--- Quote ---Here's what the Visual C++ 2003 compiler(Note not the free toolkit) emits:
--- End quote ---
GCC is the only supported compiler for building C::B and it builds this piece of code without any trouble.
Of course, you 're free to try with other compilers yourself. I cannot help you more though, as I have no experience with your compiler.
Good luck.
Tsurumaru:
No problem thanks!. I'll try to play with it some more after I've studied the code more indepth.
starmoon:
hello ,i am interest in this,would you send me a copy of it. i want to study it. my email is star98622@126.com
Navigation
[0] Message Index
Go to full version