How can I resolve the error: "'CheckVA' : none of the 11 overloads could convert all the argument types"?

Hi,

I’m getting a compile error in my project and I can’t track down the cause, the error is:

Error 1 error C2665: ‘CheckVA’ : none of the 11 overloads could convert all the argument types …\Engine\Source\Runtime\Core\Public\Containers\UnrealString.h 910 1

When I go to the cause it brings me to the FString class here:

VARARG_DECL( static FString, static FString, return, Printf, VARARG_NONE, const TCHAR*, VARARG_NONE, VARARG_NONE );

I have no idea what this is or what it does but I haven’t changed it.

The only things I’ve been changing so far are converting some variables from floats to FVectors. This error is obviously complaining about mismatched parameters but the compiler doesn’t show me where I’ve made the error.

I’ve even searched the whole project for VARARG_DECL and found 11 instances, each a declaration not a call to it so I don’t even get where this is being used.

Any help is much appreciated. Thanks

VARARG_DECL is a workaround for the fact that not all of our supported compilers support C++11 variadic templates (VS2012, I’m looking at you here). It’s actually defined in OutputDevice.h, line 102.

I’ve tried this and the error window does indeed take you to the wrong place. If you take a look in the output window instead you’ll be able to see where the error is actually coming from, eg:

1>C:\Git\UnrealEngine\Engine\Source\Runtime\Core\Public\Containers\UnrealString.h(910): error C2665: 'CheckVA' : none of the 11 overloads could convert all the argument types
1>          C:\Git\UnrealEngine\Engine\Source\Runtime\Core\Public\Misc\OutputDevice.h(98): could be 'bool CheckVA(bool)'
1>          C:\Git\UnrealEngine\Engine\Source\Runtime\Core\Public\Misc\OutputDevice.h(97): or       'void *CheckVA(ANSICHAR *)'
1>          C:\Git\UnrealEngine\Engine\Source\Runtime\Core\Public\Misc\OutputDevice.h(96): or       'TCHAR CheckVA(TCHAR)'
1>          C:\Git\UnrealEngine\Engine\Source\Runtime\Core\Public\Misc\OutputDevice.h(95): or       'long CheckVA(unsigned long)'
1>          C:\Git\UnrealEngine\Engine\Source\Runtime\Core\Public\Misc\OutputDevice.h(94): or       'long CheckVA(long)'
1>          C:\Git\UnrealEngine\Engine\Source\Runtime\Core\Public\Misc\OutputDevice.h(93): or       'double CheckVA(double)'
1>          C:\Git\UnrealEngine\Engine\Source\Runtime\Core\Public\Misc\OutputDevice.h(92): or       'int64 CheckVA(int64)'
1>          C:\Git\UnrealEngine\Engine\Source\Runtime\Core\Public\Misc\OutputDevice.h(91): or       'uint64 CheckVA(uint64)'
1>          C:\Git\UnrealEngine\Engine\Source\Runtime\Core\Public\Misc\OutputDevice.h(90): or       'int32 CheckVA(int32)'
1>          C:\Git\UnrealEngine\Engine\Source\Runtime\Core\Public\Misc\OutputDevice.h(89): or       'uint8 CheckVA(uint8)'
1>          C:\Git\UnrealEngine\Engine\Source\Runtime\Core\Public\Misc\OutputDevice.h(88): or       'uint32 CheckVA(uint32)'
1>          while trying to match the argument list '(FVector)'
1>          C:\UnrealProjects\MyTestFirstPerson\Source\MyTestFirstPerson\MyTestFirstPerson.cpp(21) : see reference to function template instantiation 'FString FString::Printf<FVector>(const TCHAR *,T1)' being compiled
1>          with
1>          [
1>              T1=FVector
1>          ]

In that output above, selecting the following line takes to me the real error:

C:\UnrealProjects\MyTestFirstPerson\Source\MyTestFirstPerson\MyTestFirstPerson.cpp(21) : see reference to function template instantiation 'FString FString::Printf<FVector>(const TCHAR *,T1)' being compiled

If you take a look in OutputDevice.h, you’ll see the various CheckVA functions which define the valid types (uint32, uint8, int32, uint64, int64, double, long, unsigned long, TCHAR, ANSICHAR*, bool, T*, const T* - the last two are templated for any pointer type).

Thanks Jamie, that did indeed take me to the correct place and I’ve since been able to fix it. Must remember to always look at the output!