Cannot convert from int & missing default parameter for parameter 1[SOLVED}
-
I am developing new project in Qt with existing MFC project . SO in MFC I have a function which uses SYSTEMTime and return CString.
example
@CString getTimestampString( void )
{
SYSTEMTIME systemTime;
CString datestr;GetSystemTime( &systemTime ); datestr.Format( "i/i/i, i:i:i", systemTime.wDay, systemTime.wMonth, systemTime.wYear, systemTime.wHour, systemTime.wMinute, systemTime.wSecond ); return ( datestr + "; " + get_file_version_info().ProductName.c_str() + ", " + get_file_version_info().ProductVersion.c_str() ); // get_file_version_info are in some other director under lib_know directory.
}@
The above function compile in VS2010.
Now doing same thing in QT
@QString getTimestampString( void )
{
QDateTime systemTime = QDateTime::currentDateTime();
QString datestr = systemTime.toString() ;return( QString("%1; %2, %3").arg( datestr )
.arg( get_file_version_info().ProductName.c_str() )
.arg( get_file_version_info().ProductVersion.c_str() )
) ;@}
..............................................................................................................................................................................................
I got following errors:
@C:\mydir\application\libs\lib_know/FileVersioninfo.h(83): error C2440: 'default argument' : cannot convert from 'int' to 'know::FileVersionInfo::Pcalculator'
1> @@1>C:\mydir\application\libs\lib_know/FileVersioninfo.h(83): error C2548: 'know::init_file_version_info' : missing default parameter for parameter 1 @
PS -> I cant able to make any changes in lib_know as this library is being used by many other projects..
Please let me know where I am falling , I am completely clueless now.
Thanks and regards,
............................................................................................................
Someone has suggested me that error occurred because "there is no overload of arg that takes a char*" But I havent undeerstood what he means?
Any little help wil l be beneficial.Thanks
-
SOLVED !!!!!.. the know::init_file_version_info was using some boost library which I have not included by using hit and trail method It works now... The interesting thing was that compiler was not throwing any linker error or anything related to boost functions
-
Hi and welcome to devnet,
Nice you found out and thanks for sharing.
Please, update the thread title prepending [solved] so other forum users may know a solution has been found :)