Airsim: Compile Error - latest Master

Created on 30 Jun 2018  路  10Comments  路  Source: microsoft/AirSim

After compilation of Airsim and going through UE4Editor and running the compatibility rebuild (as stated in the docs), i get this error (Note that it happens not only for this file, but every one that has this in it).

AirSim/Unreal/Environments/Blocks/Plugins/AirSim/Source/AirLib/include/api/VehicleApiBase.hpp:87:29: error: 
      default initialization of an object of const type 'const
      msr::airlib::RCData' without a user-provided default constructor
        static const RCData invalid_rc_data;
                            ^
                                           {}

This is happening using the Linux build on the updated Ubuntu 16.04.
I followed all the steps as stated, and I didnt have this issue a couple weeks ago (I wanted to update Airsim, so i redownloaded it).

As such, the compatibility rebuild is not working.

Any solutions?

doc update

Most helpful comment

Hey @mitairlines I actually was dealing with that exact error and found the solution. The issue is with the clang compiler itself. Look at this post for some more details: https://stackoverflow.com/questions/7411515/why-does-c-require-a-user-provided-default-constructor-to-default-construct-a

You have to make sure you have clang 5.0 installed. One way to verify what clang version is being used when you run UE4Editor is by looking at the log that being printed in the terminal. In the top 50 lines you should see this:

LogInit: Compiled with Clang: 5.0.0 (tags/RELEASE_500/final)

If its version 3.8, then there is your issue. Here is how I solved it:

In my root directory (cd ~):

sudo update-alternatives --install /usr/bin/clang++ clang++ /usr/bin/clang++-5.0 100
sudo update-alternatives --install /usr/bin/clang clang /usr/bin/clang-5.0 100
clang --version

When you run clang version you should get:
clang version 5.0.0-3~16.04.1 (tags/RELEASE_500/final)

To be safe, I started fresh followed the install and build instructions from here https://github.com/Microsoft/AirSim/blob/master/docs/build_linux.md and everything worked.

I hope this helps.

All 10 comments

I have the same problem.

I just tried getting fresh clone and do rebuild on Ubuntu 16.04. When starting UE4Editor I was prompted to build plugin which I said ok and everything went fine. Could you please post the prompts you are seeing. I would also suggest to run:

git clean -ffdx
git pull
./setup.sh
./build.sh

This worked on my m/c.

Note that above will remove any untracked changes in your repo.

Thank you for your response,
I tried what you suggested above and now I am getting the following:
The project could not be compiled. Would you like to open it in Null Source Code Access?
ERROR: UBT ERROR: Failed to produce item: /home/AirSim/Unreal/Environments/Blocks/Plugins/AirSim/Binaries/Linux/libUE4Editor-AirSim.so Total build time: 6341.95 seconds (Local executor: 0.00 seconds)

Hey @mitairlines I actually was dealing with that exact error and found the solution. The issue is with the clang compiler itself. Look at this post for some more details: https://stackoverflow.com/questions/7411515/why-does-c-require-a-user-provided-default-constructor-to-default-construct-a

You have to make sure you have clang 5.0 installed. One way to verify what clang version is being used when you run UE4Editor is by looking at the log that being printed in the terminal. In the top 50 lines you should see this:

LogInit: Compiled with Clang: 5.0.0 (tags/RELEASE_500/final)

If its version 3.8, then there is your issue. Here is how I solved it:

In my root directory (cd ~):

sudo update-alternatives --install /usr/bin/clang++ clang++ /usr/bin/clang++-5.0 100
sudo update-alternatives --install /usr/bin/clang clang /usr/bin/clang-5.0 100
clang --version

When you run clang version you should get:
clang version 5.0.0-3~16.04.1 (tags/RELEASE_500/final)

To be safe, I started fresh followed the install and build instructions from here https://github.com/Microsoft/AirSim/blob/master/docs/build_linux.md and everything worked.

I hope this helps.

Thanks so much for your help! It looks like it worked, and blocks compiled properly. However, now, when I try to run hello_drone.py it says
Client Ver:1 (Min Req: 1), Server Ver:1 (Min Req: 1)

Traceback (most recent call last):
File "hello_drone.py", line 12, in
client.enableApiControl(True)
File "/home/AirSim/PythonClient/airsim/client.py", line 37, in enableApiControl
return self.client.call('enableApiControl', is_enabled, vehicle_name)
File "/home/.local/lib/python3.5/site-packages/msgpackrpc/session.py", line 41, in call
return self.send_request(method, args).get()
File "/home/.local/lib/python3.5/site-packages/msgpackrpc/future.py", line 45, in get
raise error.RPCError(self._error)
msgpackrpc.error.RPCError: rpclib: function 'enableApiControl' (called with 2 arg(s)) threw an exception. The exception contained this information: Vehicle API for '' is not available. This could either because this is simulation-only API or this vehicle does not exist.

It seems to be that you have to package it before you can use the API's on it. You should be able to package in your unreal editor: *File > Package Project > Linux * > choose directory ... open.

Also are you using python2 or python3?

Thank you for your reply,
I am using python 3.5.
I performed the operation you detailed, but the program still threw the same error:

UATHelper: Packaging (Linux): error: exception handling was disabled in PCH file but is currently enabled
UATHelper: Packaging (Linux): error: definition of macro 'PLATFORM_EXCEPTIONS_DISABLED' differs between the precompiled header ('1') and the command line ('0')

UATHelper: Packaging (Linux): ERROR: UBT ERROR: Failed to produce item: /home/AirSim/Unreal/Environments/Blocks/Binaries/Linux/Blocks
PackagingResults: Error: UBT ERROR: Failed to produce item: /home/AirSim/Unreal/Environments/Blocks/Binaries/Linux/Blocks

@stanleycelestin1Your suggestion works for me. Thanks.

@mitairlines this is probably too late, but you can get around this by setting bUsePchFiles=false in your PROJECT/Source/Project.target.cs file.
Also, the blocks linux binary is now available : https://github.com/Microsoft/AirSim/releases/tag/v1.2.0Linux

Was this page helpful?
0 / 5 - 0 ratings

Related issues

vinbo picture vinbo  路  4Comments

ShukuiZhang picture ShukuiZhang  路  4Comments

HereIsPatrick picture HereIsPatrick  路  3Comments

git-moeen picture git-moeen  路  4Comments

Mayankm96 picture Mayankm96  路  4Comments