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)

fix-int32.patch (2.7 KB ) - added by Markus 11 years ago.
use the typedef

Download all attachments as: .zip

Change History (11)

comment:1 by infyquest, 12 years ago

Please check if this fixed it Changeset r12232

Last edited 12 years ago by historic_bruno (previous) (diff)

comment:2 by historic_bruno, 12 years ago

No, that was a different build error :)

comment:3 by historic_bruno, 12 years ago

Cc: Philip Taylor added

comment:4 by Markus, 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?)

Last edited 11 years ago by Markus (previous) (diff)

by Markus, 11 years ago

Attachment: fix-int32.patch added

use the typedef

comment:5 by Markus, 11 years ago

Keywords: patch review added
Milestone: BacklogAlpha 15
Summary: FCollada MSVC build broken[PATCH] FCollada MSVC build broken

in reply to:  5 comment:6 by historic_bruno, 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'
Last edited 11 years ago by historic_bruno (previous) (diff)

comment:7 by ben, 11 years ago

In 13522:

Fixes include paths in FCollada VC project files, refs #1563

comment:8 by Markus, 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 historic_bruno, 11 years ago

Milestone: Alpha 15Backlog

comment:10 by historic_bruno, 10 years ago

Milestone: BacklogAlpha 16
Resolution: fixed
Status: newclosed

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.

Note: See TracTickets for help on using tickets.