Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Cannot convert from int & missing default parameter for parameter 1[SOLVED}
Qt 6.11 is out! See what's new in the release blog

Cannot convert from int & missing default parameter for parameter 1[SOLVED}

Scheduled Pinned Locked Moved General and Desktop
5 Posts 2 Posters 2.1k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • P Offline
    P Offline
    pratsam
    wrote on last edited by
    #1

    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

    1 Reply Last reply
    0
    • P Offline
      P Offline
      pratsam
      wrote on last edited by
      #2

      Please ignore syntax error which happened while uploading the code.

      1 Reply Last reply
      0
      • P Offline
        P Offline
        pratsam
        wrote on last edited by
        #3

        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

        1 Reply Last reply
        0
        • SGaistS Offline
          SGaistS Offline
          SGaist
          Lifetime Qt Champion
          wrote on last edited by
          #4

          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 :)

          Interested in AI ? www.idiap.ch
          Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

          1 Reply Last reply
          0
          • P Offline
            P Offline
            pratsam
            wrote on last edited by
            #5

            As suggested , I have updated the post .. cheers

            1 Reply Last reply
            0

            • Login

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • Users
            • Groups
            • Search
            • Get Qt Extensions
            • Unsolved