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
Describe the bug
cmake --build Buildsucceeds because it builds LibCarla and the Python API,not the Unreal plugin. The first time UBT compiles
UnrealEditor-Carla.dllit fails with three independent errors. Anything that builds the plugin — the
carla-unreal-editortarget, or adding the plugin to another project — hitsthem.
Errors
Cause and fix, one at a time
1.
CarlaNavigationSubsystem.cpp:44. The call passes two arguments:UNavigationQueryFilter::GetQueryFilter(*NavData, UCarlaWalkerNavFilter::StaticClass());NavigationQueryFilter.hdeclares both a non-staticGetQueryFilter(const ANavigationData&, const UObject*) constand a staticGetQueryFilter(const ANavigationData&, TSubclassOf<UNavigationQueryFilter>).StaticClass()returnsUClass*, which reachesconst UObject*by a standardpointer conversion but
TSubclassOfonly by a user-defined one, so overloadresolution picks the member function. Use the three-argument static overload:
2.
CustomV2XSensor.cpp. UsesUCarlaStatics::GetCurrentEpisodewithoutincluding
Carla/Game/CarlaStatics.h; it only compiles when a unity blobhappens to pull the header in first. Add the include.
3.
CaService.cpp:597-599.FVectorcomponents aredoublein UE5, soAccelerometer.X + GetNormalDistribution(...)is adoubleand narrows insidethe braced initialiser of the float-based
carla::geom::Vector3D. Addstatic_cast<float>around each element.Environment
ue58-dev-carla@de3f38e64, CARLA fork of UE 5.8