udacity / sdc-issue-reports

29 stars 6 forks source link

Udacity EKF repository fails to build #810

Closed MichaelTien8901 closed 7 years ago

MichaelTien8901 commented 7 years ago

Udacity EKF repository fails to build with error in uWebSockets calls.

https://github.com/udacity/CarND-Extended-Kalman-Filter-Project/issues/37

pierluigiferrari commented 7 years ago

Here is the full log:

    Scanning dependencies of target ExtendedKF
    [ 20%] Building CXX object CMakeFiles/ExtendedKF.dir/main.cpp.o
    /Users/pierluigiferrari/Downloads/CarND-Extended-Kalman-Filter-Project-master/src/main.cpp:41:5: error: no
          matching member function for call to 'onMessage'
      h.onMessage([&fusionEKF,&tools,&estimations,&ground_truth](uWS::WebSocket<uWS::SERVER> ws, char *data...
      ~~^~~~~~~~~
    /usr/local/include/uWS/Group.h:69:10: note: candidate function not viable: no known conversion from '(lambda at
          /Users/pierluigiferrari/Downloads/CarND-Extended-Kalman-Filter-Project-master/src/main.cpp:41:15)' to
          'std::function<void (WebSocket<true> *, char *, size_t, OpCode)>' (aka 'function<void (WebSocket<true> *,
          char *, unsigned long, uWS::OpCode)>') for 1st argument
        void onMessage(std::function<void(WebSocket<isServer> *, char *, size_t, OpCode)> handler);
             ^
    /usr/local/include/uWS/Group.h:69:10: note: candidate function not viable: no known conversion from '(lambda at
          /Users/pierluigiferrari/Downloads/CarND-Extended-Kalman-Filter-Project-master/src/main.cpp:41:15)' to
          'std::function<void (WebSocket<false> *, char *, size_t, OpCode)>' (aka 'function<void (WebSocket<false>
          *, char *, unsigned long, uWS::OpCode)>') for 1st argument
    /Users/pierluigiferrari/Downloads/CarND-Extended-Kalman-Filter-Project-master/src/main.cpp:165:5: error: no
          matching member function for call to 'onConnection'
      h.onConnection([&h](uWS::WebSocket<uWS::SERVER> ws, uWS::HttpRequest req) {
      ~~^~~~~~~~~~~~
    /usr/local/include/uWS/Group.h:67:10: note: candidate function not viable: no known conversion from '(lambda at
          /Users/pierluigiferrari/Downloads/CarND-Extended-Kalman-Filter-Project-master/src/main.cpp:165:18)' to
          'std::function<void (WebSocket<true> *, HttpRequest)>' for 1st argument
        void onConnection(std::function<void(WebSocket<isServer> *, HttpRequest)> handler);
             ^
    /usr/local/include/uWS/Group.h:67:10: note: candidate function not viable: no known conversion from '(lambda at
          /Users/pierluigiferrari/Downloads/CarND-Extended-Kalman-Filter-Project-master/src/main.cpp:165:18)' to
          'std::function<void (WebSocket<false> *, HttpRequest)>' for 1st argument
    /Users/pierluigiferrari/Downloads/CarND-Extended-Kalman-Filter-Project-master/src/main.cpp:169:5: error: no
          matching member function for call to 'onDisconnection'
      h.onDisconnection([&h](uWS::WebSocket<uWS::SERVER> ws, int code, char *message, size_t length) {
      ~~^~~~~~~~~~~~~~~
    /usr/local/include/uWS/Group.h:70:10: note: candidate function not viable: no known conversion from '(lambda at
          /Users/pierluigiferrari/Downloads/CarND-Extended-Kalman-Filter-Project-master/src/main.cpp:169:21)' to
          'std::function<void (WebSocket<true> *, int, char *, size_t)>' (aka 'function<void (WebSocket<true> *,
          int, char *, unsigned long)>') for 1st argument
        void onDisconnection(std::function<void(WebSocket<isServer> *, int code, char *message, size_t lengt...
             ^
    /usr/local/include/uWS/Group.h:70:10: note: candidate function not viable: no known conversion from '(lambda at
          /Users/pierluigiferrari/Downloads/CarND-Extended-Kalman-Filter-Project-master/src/main.cpp:169:21)' to
          'std::function<void (WebSocket<false> *, int, char *, size_t)>' (aka 'function<void (WebSocket<false> *,
          int, char *, unsigned long)>') for 1st argument
    3 errors generated.
    make[2]: *** [CMakeFiles/ExtendedKF.dir/main.cpp.o] Error 1
    make[1]: *** [CMakeFiles/ExtendedKF.dir/all] Error 2
    make: *** [all] Error 2

This happened on Mac OS Sierra, but it also happens on Ubuntu and Windows 10.

One thing to note: Since the install-mac.sh shell script does not work for Mac OS 10.11 or later, I just installed uWebSocket following the instructions on their github page, i.e. I just installed the latest master.

pierluigiferrari commented 7 years ago

And here is the related forum discussion:

https://discussions.udacity.com/t/udacity-ekf-repository-fails-to-build/248521

awbrown90 commented 7 years ago

@MichaelTien8901 I checked the forums and it looks like the issue was solved when the patch file was included in the main repository, can you verify? Really sorry for the trouble there.

MichaelTien8901 commented 7 years ago

Yes. Issue was solved, at least for ubuntu 16.04(with vitualbox), and MacOS.
I also use bash for Windows 10 and default version of ubuntu is 14.04(because I activated Bash before Windows 10 Creator Update). I need to replace it to 16.04 to compile.
In Windows Visual Studio 2017, it is really painful to install and update(and I am doing it now). Better not to try this.

anshoomehra commented 7 years ago

Hi There,

I am still getting the same error, I took latest project files and also installed uWebSocket latest from github, could you please advise ..

Thx

build $ make [ 20%] Building CXX object CMakeFiles/ExtendedKF.dir/src/main.cpp.o /Users/xxxx/Dropbox/Autonomous Car Driving Udacity/Sensor Fusion/CarND-Extended-Kalman-Filter-Project/src/main.cpp:41:5: error: no matching member function for call to 'onMessage' h.onMessage([&fusionEKF,&tools,&estimations,&ground_truth](uWS::WebSocket ws, char data, size_t length, uWS::OpCode opCode) { ^~~ /usr/local/include/uWS/Group.h:69:10: note: candidate function not viable: no known conversion from '(lambda at /Users/xxxx/Dropbox/Autonomous Car Driving Udacity/Sensor Fusion/CarND-Extended-Kalman-Filter-Project/src/main.cpp:41:15)' to 'std::function<void (WebSocket , char , size_t, OpCode)>' (aka 'function<void (WebSocket , char , unsigned long, uWS::OpCode)>') for 1st argument void onMessage(std::function<void(WebSocket , char , size_t, OpCode)> handler); ^ /usr/local/include/uWS/Group.h:69:10: note: candidate function not viable: no known conversion from '(lambda at /Users/xxxx/Dropbox/Autonomous Car Driving Udacity/Sensor Fusion/CarND-Extended-Kalman-Filter-Project/src/main.cpp:41:15)' to 'std::function<void (WebSocket , char , size_t, OpCode)>' (aka 'function<void (WebSocket , char , unsigned long, uWS::OpCode)>') for 1st argument /Users/xxxx/Dropbox/Autonomous Car Driving Udacity/Sensor Fusion/CarND-Extended-Kalman-Filter-Project/src/main.cpp:165:5: error: no matching member function for call to 'onConnection' h.onConnection([&h](uWS::WebSocket ws, uWS::HttpRequest req) { ^~~~~~ /usr/local/include/uWS/Group.h:67:10: note: candidate function not viable: no known conversion from '(lambda at /Users/xxxxx/Dropbox/Autonomous Car Driving Udacity/Sensor Fusion/CarND-Extended-Kalman-Filter-Project/src/main.cpp:165:18)' to 'std::function<void (WebSocket , HttpRequest)>' for 1st argument void onConnection(std::function<void(WebSocket , HttpRequest)> handler); ^ /usr/local/include/uWS/Group.h:67:10: note: candidate function not viable: no known conversion from '(lambda at /Users/xxxx/Dropbox/Autonomous Car Driving Udacity/Sensor Fusion/CarND-Extended-Kalman-Filter-Project/src/main.cpp:165:18)' to 'std::function<void (WebSocket , HttpRequest)>' for 1st argument /Users/xxxx/Dropbox/Autonomous Car Driving Udacity/Sensor Fusion/CarND-Extended-Kalman-Filter-Project/src/main.cpp:169:5: error: no matching member function for call to 'onDisconnection' h.onDisconnection([&h](uWS::WebSocket ws, int code, char message, size_t length) { ^~~~~ /usr/local/include/uWS/Group.h:70:10: note: candidate function not viable: no known conversion from '(lambda at /Users/xxxxx/Dropbox/Autonomous Car Driving Udacity/Sensor Fusion/CarND-Extended-Kalman-Filter-Project/src/main.cpp:169:21)' to 'std::function<void (WebSocket , int, char , size_t)>' (aka 'function<void (WebSocket , int, char , unsigned long)>') for 1st argument void onDisconnection(std::function<void(WebSocket , int code, char message, size_t length)> handler); ^ /usr/local/include/uWS/Group.h:70:10: note: candidate function not viable: no known conversion from '(lambda at /Users/xxxxx/Dropbox/Autonomous Car Driving Udacity/Sensor Fusion/CarND-Extended-Kalman-Filter-Project/src/main.cpp:169:21)' to 'std::function<void (WebSocket , int, char , size_t)>' (aka 'function<void (WebSocket , int, char *, unsigned long)>') for 1st argument 3 errors generated. make[2]: [CMakeFiles/ExtendedKF.dir/src/main.cpp.o] Error 1 make[1]: [CMakeFiles/ExtendedKF.dir/all] Error 2 make: *** [all] Error 2

pierluigiferrari commented 7 years ago

@anshoomehra Take a look at the forum discussion linked above. The project code is not compatible with the latest master of uWS. The install scripts in the repo install an older version. You need to either use the install shell script to install uWS, or to manually install uWS, clone the uWS github repo and before proceeding with the installation, check out the older version from the repo listed in the install shell script, then install. This is the version of the repo you need to check out for the manual installation (i.e. if you can't use the shell script for some reason):

git clone https://github.com/uWebSockets/uWebSockets 
cd uWebSockets
git checkout e94b6e1

Here is a complete list of instructions for the manual installation process. The easiest would of course be to just run the shell script.

awbrown90 commented 7 years ago

For reference here is guide for installing uWebSocketIO, https://classroom.udacity.com/nanodegrees/nd013/parts/40f38239-66b6-46ec-ae68-03afd8a601c8/modules/0949fca6-b379-42af-a919-ee50aa304e6a/lessons/f758c44c-5e40-4e01-93b5-1a82aa4e044f/concepts/16cf4a78-4fc7-49e1-8621-3450ca938b77

anshoomehra commented 7 years ago

Thanks guys! @pierluigiferrari @awbrown90 ..

I think Udacity should update github readme as well, from Project Detail section, I just switched to GitHub and started following install steps!

baumanab commented 7 years ago

Thanks to everyone who provided resources and feedback. We do plan to add some information to project repos to help resolve issues with installation.