cannot convert from int & missing default parameter for parameter 1

一笑奈何 提交于 2019-12-12 01:48:19

问题


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( "%02i/%02i/%04i, %02i:%02i:%02i",
        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>         

Source or target has incomplete type

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,


回答1:


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



来源:https://stackoverflow.com/questions/20375642/cannot-convert-from-int-missing-default-parameter-for-parameter-1

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!