不能从int&缺少参数1的默认参数 [英] cannot convert from int & missing default parameter for parameter 1

查看:334
本文介绍了不能从int&缺少参数1的默认参数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用现有的MFC项目在Qt开发新项目。 SO在MFC我有一个函数,它使用SYSTEMTime和返回CString。

I am developing new project in Qt with existing MFC project . SO in MFC I have a function which uses SYSTEMTime and return CString.

示例

    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.
}

上述函数在VS2010中编译。

The above function compile in VS2010.

现在在QT中做同样的事情

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() ) 
                                 ) ;

  }

我遇到以下错误

  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 - >我无法对lib_know进行任何更改,因为此库正被许多其他项目使用..

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.

感谢和问候,

推荐答案

SOLVED !!!!! ..知道:: init_file_version_info使用了一些boost库,使用hit和trail方法现在工作...有趣的是,编译器没有抛出任何链接器错误或任何与boost函数相关

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

这篇关于不能从int&缺少参数1的默认参数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆