Opened 12 years ago
Closed 10 years ago
#1563 closed defect (fixed)
[PATCH] FCollada MSVC build broken
Reported by: | historic_bruno | Owned by: | |
---|---|---|---|
Priority: | Nice to Have | Milestone: | Alpha 16 |
Component: | Build & Packages | Keywords: | windows patch |
Cc: | Philip Taylor | Patch: |
Description
Some of the changes related to r12072 broke the FCollada build in MSVC, specifically those in FUStringConversion.cpp
. If I comment out the new template lines, the build succeeds. At first I thought the types didn't match up by mistake, and it would be an easy fix, but that only caused other errors (I really don't understand the purpose of the new code anyway).
1>------ Build started: Project: FCollada, Configuration: Release DLL Win32 ------ 1> FUStringConversion.cpp 1>FUtils\FUStringConversion.cpp(249): error C2785: 'uint32 FUStringConversion::ToUInt32(const CH **)' and 'unsigned int FUStringConversion::ToUInt32(const char **)' have different return types 1> c:\users\ben\devel\ps\libraries\fcollada\src\fcollada\futils\FUStringConversion.h(97) : see declaration of 'FUStringConversion::ToUInt32' 1> FUtils\FUStringConversion.cpp(249) : see declaration of 'FUStringConversion::ToUInt32' 1>FUtils\FUStringConversion.cpp(249): error C3190: 'unsigned int FUStringConversion::ToUInt32(const char **)' with the provided template arguments is not the explicit instantiation of any member function of 'FUStringConversion' 1>FUtils\FUStringConversion.cpp(249): error C2945: explicit instantiation does not refer to a template-class specialization 1>FUtils\FUStringConversion.cpp(250): error C3190: 'unsigned int FUStringConversion::HexToUInt32(const char **,unsigned int)' with the provided template arguments is not the explicit instantiation of any member function of 'FUStringConversion' 1>FUtils\FUStringConversion.cpp(250): error C2945: explicit instantiation does not refer to a template-class specialization 1>FUtils\FUStringConversion.cpp(255): error C3190: 'void FUStringConversion::ToInt32List(const char *,fm::vector<T,PRIMITIVE> &)' with the provided template arguments is not the explicit instantiation of any member function of 'FUStringConversion' 1> with 1> [ 1> T=int, 1> PRIMITIVE=true 1> ] 1>FUtils\FUStringConversion.cpp(255): error C2945: explicit instantiation does not refer to a template-class specialization 1>FUtils\FUStringConversion.cpp(257): error C3190: 'void FUStringConversion::ToInterleavedUInt32List(const char *,fm::pvector<T> &)' with the provided template arguments is not the explicit instantiation of any member function of 'FUStringConversion' 1> with 1> [ 1> T=fm::vector<unsigned int,true> 1> ] 1>FUtils\FUStringConversion.cpp(257): error C2945: explicit instantiation does not refer to a template-class specialization 1>FUtils\FUStringConversion.cpp(260): error C3190: 'void FUStringConversion::ToUInt32List(const char *,fm::vector<T,PRIMITIVE> &)' with the provided template arguments is not the explicit instantiation of any member function of 'FUStringConversion' 1> with 1> [ 1> T=unsigned int, 1> PRIMITIVE=true 1> ] 1>FUtils\FUStringConversion.cpp(260): error C2945: explicit instantiation does not refer to a template-class specialization 1>FUtils\FUStringConversion.cpp(268): error C3190: 'void FUStringConversion::ToString(FUStringBuilderT<Char> &,const unsigned int *,size_t)' with the provided template arguments is not the explicit instantiation of any member function of 'FUStringConversion' 1> with 1> [ 1> Char=fchar 1> ] 1>FUtils\FUStringConversion.cpp(268): error C2945: explicit instantiation does not refer to a template-class specialization
Attachments (1)
Change History (11)
comment:3 by , 12 years ago
Cc: | added |
---|
comment:4 by , 11 years ago
Keywords: | windows added |
---|
The template function returns a "uint32" (which is defined as "unsigned long" for WIN32) while the added template lines just use "unsigned int".
(The patch is untested. Does it work or at least help?)
follow-up: 6 comment:5 by , 11 years ago
Keywords: | patch review added |
---|---|
Milestone: | Backlog → Alpha 15 |
Summary: | FCollada MSVC build broken → [PATCH] FCollada MSVC build broken |
comment:6 by , 11 years ago
Keywords: | review removed |
---|
Replying to Markus:
Hi, with the patch applied, I get the following errors (VC++ 2010):
2> FUStringConversion.cpp 2>e:\devel\ps\libraries\source\fcollada\src\fcollada\FUtils/FUString.h(432): error C2893: Failed to specialize function template 'FMVector2 FUStringConversion::ToVector2(const CH **)' 2> With the following template arguments: 2> 'char' 2>e:\devel\ps\libraries\source\fcollada\src\fcollada\FUtils/FUString.h(432): error C2893: Failed to specialize function template 'FMVector3 FUStringConversion::ToVector3(const CH **)' 2> With the following template arguments: 2> 'char' 2>e:\devel\ps\libraries\source\fcollada\src\fcollada\FUtils/FUString.h(432): error C2893: Failed to specialize function template 'FMVector4 FUStringConversion::ToVector4(const CH **)' 2> With the following template arguments: 2> 'char' 2>e:\devel\ps\libraries\source\fcollada\src\fcollada\FUtils/FUString.h(432): error C2893: Failed to specialize function template 'bool FUStringConversion::ToBoolean(const CH *)' 2> With the following template arguments: 2> 'char' 2>e:\devel\ps\libraries\source\fcollada\src\fcollada\FUtils/FUString.h(432): error C2893: Failed to specialize function template 'uint32 FUStringConversion::ToUInt32(const CH **)' 2> With the following template arguments: 2> 'char' 2>e:\devel\ps\libraries\source\fcollada\src\fcollada\FUtils/FUString.h(432): error C2893: Failed to specialize function template 'uint32 FUStringConversion::HexToUInt32(const CH **,uint32)' 2> With the following template arguments: 2> 'char' 2>e:\devel\ps\libraries\source\fcollada\src\fcollada\FUtils/FUString.h(432): error C2893: Failed to specialize function template 'void FUStringConversion::ToBooleanList(const CH *,BooleanList &)' 2> With the following template arguments: 2> 'char' 2>e:\devel\ps\libraries\source\fcollada\src\fcollada\FUtils/FUString.h(432): error C2893: Failed to specialize function template 'void FUStringConversion::ToDateTime(const CH *,FUDateTime &)' 2> With the following template arguments: 2> 'char' 2>e:\devel\ps\libraries\source\fcollada\src\fcollada\FUtils/FUString.h(432): error C2893: Failed to specialize function template 'void FUStringConversion::ToFloatList(const CH *,FloatList &)' 2> With the following template arguments: 2> 'char' 2>e:\devel\ps\libraries\source\fcollada\src\fcollada\FUtils/FUString.h(432): error C2893: Failed to specialize function template 'void FUStringConversion::ToInt32List(const CH *,Int32List &)' 2> With the following template arguments: 2> 'char' 2>e:\devel\ps\libraries\source\fcollada\src\fcollada\FUtils/FUString.h(432): error C2893: Failed to specialize function template 'void FUStringConversion::ToInterleavedFloatList(const CH *,fm::pvector<T> &)' 2> with 2> [ 2> T=FloatList 2> ] 2> With the following template arguments: 2> 'char' 2>e:\devel\ps\libraries\source\fcollada\src\fcollada\FUtils/FUString.h(432): error C2893: Failed to specialize function template 'void FUStringConversion::ToInterleavedUInt32List(const CH *,fm::pvector<T> &)' 2> with 2> [ 2> T=UInt32List 2> ] 2> With the following template arguments: 2> 'char' 2>e:\devel\ps\libraries\source\fcollada\src\fcollada\FUtils/FUString.h(432): error C2893: Failed to specialize function template 'void FUStringConversion::ToMatrix(const CH **,FMMatrix44 &)' 2> With the following template arguments: 2> 'char' 2>e:\devel\ps\libraries\source\fcollada\src\fcollada\FUtils/FUString.h(432): error C2893: Failed to specialize function template 'void FUStringConversion::ToMatrixList(const CH *,FMMatrix44List &)' 2> With the following template arguments: 2> 'char' 2>e:\devel\ps\libraries\source\fcollada\src\fcollada\FUtils/FUString.h(432): error C2893: Failed to specialize function template 'void FUStringConversion::ToUInt32List(const CH *,UInt32List &)' 2> With the following template arguments: 2> 'char' 2>e:\devel\ps\libraries\source\fcollada\src\fcollada\FUtils/FUString.h(432): error C2893: Failed to specialize function template 'void FUStringConversion::ToVector3List(const CH *,FMVector3List &)' 2> With the following template arguments: 2> 'char' 2>e:\devel\ps\libraries\source\fcollada\src\fcollada\FUtils/FUString.h(432): error C2893: Failed to specialize function template 'void FUStringConversion::ToString(FUStringBuilderT<Char> &,const uint32 *,size_t)' 2> With the following template arguments: 2> 'char'
comment:8 by , 11 years ago
Just out of curiosity: Whats at FUString.h:432 for you?
One other difference is the missing FCOLLADA_EXPORT
. The error message says "specialize", which is wrong as the lines should just instantiate.
As r12072 noted g++ -O2
for the change and it works in VS10 without it, we could just remove it for non-gcc.
(I cant help anymore, as I dont have VS; my patch was just an educated guess...)
comment:9 by , 11 years ago
Milestone: | Alpha 15 → Backlog |
---|
comment:10 by , 10 years ago
Milestone: | Backlog → Alpha 16 |
---|---|
Resolution: | → fixed |
Status: | new → closed |
In r14845, I simply commented out the template instantiations in FUStringConversion.cpp
for MSVC builds. There was also an error about a change introduced in r13629:
libraries\source\fcollada\src\fcollada\fcdocument\fcdgeometrypolygonstools.cpp(1035) : error C2220: warning treated as error - no 'object' file generated libraries\source\fcollada\src\fcollada\fcdocument\fcdgeometrypolygonstools.cpp(1035) : warning C4003: not enough actual parameters for macro 'FUFail'
the simplest fix for that is using a semicolon there to act as a parameter (this approach is used elsewhere).
The FColladaTest build is still broken, complaining about unresolved external symbols, but I don't know if it has ever worked and we don't use it.
Please check if this fixed it Changeset r12232