Skip to content

Carla plugin fails to compile on ue58-dev-carla (UBT, MSVC 14.44) #9864

Description

@M-Colley

Describe the bug

cmake --build Build succeeds because it builds LibCarla and the Python API,
not the Unreal plugin. The first time UBT compiles UnrealEditor-Carla.dll
it fails with three independent errors. Anything that builds the plugin — the
carla-unreal-editor target, or adding the plugin to another project — hits
them.

Errors

Navigation/CarlaNavigationSubsystem.cpp(44,43): error C2352:
  'UNavigationQueryFilter::GetQueryFilter': a call of a non-static member
  function requires an object

Sensor/CustomV2XSensor.cpp(38,39): error C2653: 'UCarlaStatics' is not a class
  or namespace name          (also lines 64 and 186)

Sensor/V2X/CaService.cpp(597..599,25): error C2398: Element '1': conversion
  from 'T' to 'float' requires a narrowing conversion

Cause and fix, one at a time

1. CarlaNavigationSubsystem.cpp:44. The call passes two arguments:

UNavigationQueryFilter::GetQueryFilter(*NavData, UCarlaWalkerNavFilter::StaticClass());

NavigationQueryFilter.h declares both a non-static
GetQueryFilter(const ANavigationData&, const UObject*) const and a static
GetQueryFilter(const ANavigationData&, TSubclassOf<UNavigationQueryFilter>).
StaticClass() returns UClass*, which reaches const UObject* by a standard
pointer conversion but TSubclassOf only by a user-defined one, so overload
resolution picks the member function. Use the three-argument static overload:

UNavigationQueryFilter::GetQueryFilter(
    *NavData, nullptr, UCarlaWalkerNavFilter::StaticClass());

2. CustomV2XSensor.cpp. Uses UCarlaStatics::GetCurrentEpisode without
including Carla/Game/CarlaStatics.h; it only compiles when a unity blob
happens to pull the header in first. Add the include.

3. CaService.cpp:597-599. FVector components are double in UE5, so
Accelerometer.X + GetNormalDistribution(...) is a double and narrows inside
the braced initialiser of the float-based carla::geom::Vector3D. Add
static_cast<float> around each element.

Environment

  • Windows 11 Pro 26100, VS 2022 Build Tools 17.14.39, MSVC 14.44.35207
  • CARLA ue58-dev-carla @ de3f38e64, CARLA fork of UE 5.8

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions