qgroundcontrol icon indicating copy to clipboard operation
qgroundcontrol copied to clipboard

Build Failure: GPSDriverUBX constructor signature mismatch in GPSProvider.cc

Open sipher-01 opened this issue 10 months ago • 2 comments

Have you checked the latest release for fixes?

  • [x] Yes, I’ve tested on the latest release

Description

Description

Expected Behavior

QGroundControl should compile successfully from the latest master branch without any errors when following the standard build instructions.

Current Behavior

The build fails with a constructor signature mismatch error at GPSProvider.cc:223. The code attempts to instantiate GPSDriverUBX with 5 parameters, but the current GPSDriverUBX constructor expects 6 parameters (including a Settings struct).

Error Message:

/home/sipher/Desktop/qgroundcontrol/src/GPS/GPSProvider.cc: In member function 'GPSBaseStationSupport* GPSProvider::_connectGPS()':

/home/sipher/Desktop/qgroundcontrol/src/GPS/GPSProvider.cc:223:120: error: no matching function for call to 'GPSDriverUBX::GPSDriverUBX(GPSHelper::Interface, int (*)(GPSCallbackType, void*, int, void*), GPSProvider*, sensor_gps_s*, satellite_info_s*)'

  223 |         gpsDriver = new GPSDriverUBX(GPSDriverUBX::Interface::UART, &_callbackEntry, this, &_sensorGps, &_satelliteInfo);
      |                                                                                                                        ^

Steps To Reproduce

  1. Clone the repository:

    git clone --recursive https://github.com/mavlink/qgroundcontrol.git
    
  2. Enter the directory and checkout master:

    cd qgroundcontrol
    git checkout master
    
  3. Create build directory and configure:

    mkdir build && cd build
    cmake ..
    
  4. Build:

    cmake --build . -j$(nproc)
    
  5. Observe build failure at GPSProvider.cc:223

Additional Details

Root Cause:

The GPS driver dependency was updated to a newer version that changed the GPSDriverUBX constructor signature, but GPSProvider.cc was not updated to match.

Current code in GPSProvider.cc (line ~223):

gpsDriver = new GPSDriverUBX(GPSDriverUBX::Interface::UART, &_callbackEntry, this, &_sensorGps, &_satelliteInfo);

Constructor now expects:

GPSDriverUBX(Interface interface, GPSCallbackPtr callback, void *callback_user, 
             sensor_gps_s *gps_position, satellite_info_s *satellite_info,
             const Settings &settings);

Proposed Fix

Update the GPSType::u_blox case in GPSProvider.cc to include the required Settings struct:

case GPSType::u_blox: {
    // Define the default settings required by the new driver version
    GPSDriverUBX::Settings settings{};
    settings.dynamic_model = 7;             // Portable/Airborne
    settings.heading_offset = 0.0f;         // Default no offset
    settings.uart2_baudrate = -1;           // -1 for "don't change"
    settings.ppk_output = false;            // Default OFF
    settings.mode = GPSDriverUBX::UBXMode::Normal;
    
    gpsDriver = new GPSDriverUBX(GPSDriverUBX::Interface::UART, &_callbackEntry, this, &_sensorGps, &_satelliteInfo, settings);
    baudrate = 0;
    break;
}

Platform

Linux

Flight Stack

None

System Information

Environment

  • QGC Version: Master branch (commit ef9cd3f86)
  • QGC build: Self-built from source
  • Operating System: Ubuntu [22.04.5 LTS/jammy]
  • Flight Controller: N/A (build issue, not runtime)
  • Autopilot Software: N/A (build issue, not runtime

Log Files and Screenshots

/home/sipher/Desktop/qgroundcontrol/src/GPS/GPSProvider.cc: In member function ‘GPSBaseStationSupport* GPSProvider::_connectGPS()’: /home/sipher/Desktop/qgroundcontrol/src/GPS/GPSProvider.cc:223:120: error: no matching function for call to ‘GPSDriverUBX::GPSDriverUBX(GPSHelper::Interface, int (*)(GPSCallbackType, void*, int, void*), GPSProvider*, sensor_gps_s*, satellite_info_s*)’   223 |         gpsDriver = new GPSDriverUBX(GPSDriverUBX::Interface::UART, &_callbackEntry, this, &_sensorGps, &_satelliteInfo);       |                                                                                                                        ^ getting this error while building the custom qgc and getting no matching constructor for GPSDriverUBX

sipher-01 avatar Jan 20 '26 07:01 sipher-01

Thanks for opening your first issue! 👋

A maintainer will review this soon. In the meantime:

Please make sure you've provided all requested information in the template.

github-actions[bot] avatar Jan 20 '26 07:01 github-actions[bot]

You're probably missing the recent commit that solved this by adjusting the GPS Drivers module tag

HTRamsey avatar Jan 20 '26 13:01 HTRamsey