Skip to content
This repository was archived by the owner on Nov 25, 2021. It is now read-only.

Fixed uWebSocket method signatures mismatch#3

Closed
bydavy wants to merge 1 commit into
udacity:masterfrom
bydavy:fixedCompil
Closed

Fixed uWebSocket method signatures mismatch#3
bydavy wants to merge 1 commit into
udacity:masterfrom
bydavy:fixedCompil

Conversation

@bydavy

@bydavy bydavy commented May 27, 2017

Copy link
Copy Markdown

I can't compile the project on Ubuntu (what about other platforms?). The method signature for uWebsocket doesn't match the header file. I provided a fix which compile successfully on Ubuntu, can someone confirm it still compiles on Windows and Mac?

This was causing a compilation error on Ubuntu (and I assume all
other platfoms).
@bydavy

bydavy commented May 27, 2017

Copy link
Copy Markdown
Author

The compilation errors were against uWebSockets v0.14.3

@bydavy

bydavy commented May 27, 2017

Copy link
Copy Markdown
Author

Here are the compilation errors for reference:

cmake .. && make && ./mpc
-- Configuring done
-- Generating done
-- Build files have been written to: CarND-MPC-Project/build
[ 33%] Building CXX object CMakeFiles/mpc.dir/src/main.cpp.o
CarND-MPC-Project/src/main.cpp: In function ‘int main()’:
CarND-MPC-Project/src/main.cpp:151:4: error: no matching function for call to ‘uWS::Hub::onMessage(main()::<lambda(uWS::WebSocket, char*, size_t, uWS::OpCode)>)’
});
^
In file included from /usr/include/uWS/Hub.h:4:0,
from /usr/include/uWS/uWS.h:4,
from CarND-MPC-Project/src/main.cpp:2:
/usr/include/uWS/Group.h:69:10: note: candidate: void uWS::Group::onMessage(std::function<void(uWS::WebSocket, char, long unsigned int, uWS::OpCode)>) [with bool isServer = true]
void onMessage(std::function<void(WebSocket , char , size_t, OpCode)> handler);
^~~~~~~~~
/usr/include/uWS/Group.h:69:10: note: no known conversion for argument 1 from ‘main()::<lambda(uWS::WebSocket, char
, size_t, uWS::OpCode)>’ to ‘std::function<void(uWS::WebSocket
, char*, long unsigned int, uWS::OpCode)>’
/usr/include/uWS/Group.h:69:10: note: candidate: void uWS::Group::onMessage(std::function<void(uWS::WebSocket, char, long unsigned int, uWS::OpCode)>) [with bool isServer = false]
/usr/include/uWS/Group.h:69:10: note: no known conversion for argument 1 from ‘main()::<lambda(uWS::WebSocket, char*, size_t, uWS::OpCode)>’ to ‘std::function<void(uWS::WebSocket, char, long unsigned int, uWS::OpCode)>’
CarND-MPC-Project/src/main.cpp:169:4: error: no matching function for call to ‘uWS::Hub::onConnection(main()::<lambda(uWS::WebSocket, uWS::HttpRequest)>)’
});
^
In file included from /usr/include/uWS/Hub.h:4:0,
from /usr/include/uWS/uWS.h:4,
from CarND-MPC-Project/src/main.cpp:2:
/usr/include/uWS/Group.h:67:10: note: candidate: void uWS::Group::onConnection(std::function<void(uWS::WebSocket, uWS::HttpRequest)>) [with bool isServer = true]
void onConnection(std::function<void(WebSocket , HttpRequest)> handler);
^~~~~~~~~~~~
/usr/include/uWS/Group.h:67:10: note: no known conversion for argument 1 from ‘main()::<lambda(uWS::WebSocket, uWS::HttpRequest)>’ to ‘std::function<void(uWS::WebSocket
, uWS::HttpRequest)>’
/usr/include/uWS/Group.h:67:10: note: candidate: void uWS::Group::onConnection(std::function<void(uWS::WebSocket
, uWS::HttpRequest)>) [with bool isServer = false]
/usr/include/uWS/Group.h:67:10: note: no known conversion for argument 1 from ‘main()::<lambda(uWS::WebSocket, uWS::HttpRequest)>’ to ‘std::function<void(uWS::WebSocket, uWS::HttpRequest)>’
CarND-MPC-Project/src/main.cpp:175:4: error: no matching function for call to ‘uWS::Hub::onDisconnection(main()::<lambda(uWS::WebSocket, int, char
, size_t)>)’
});
^
In file included from /usr/include/uWS/Hub.h:4:0,
from /usr/include/uWS/uWS.h:4,
from CarND-MPC-Project/src/main.cpp:2:
/usr/include/uWS/Group.h:70:10: note: candidate: void uWS::Group::onDisconnection(std::function<void(uWS::WebSocket, int, char, long unsigned int)>) [with bool isServer = true]
void onDisconnection(std::function<void(WebSocket , int code, char message, size_t length)> handler);
^~~~~~~~~~~~~~~
/usr/include/uWS/Group.h:70:10: note: no known conversion for argument 1 from ‘main()::<lambda(uWS::WebSocket, int, char
, size_t)>’ to ‘std::function<void(uWS::WebSocket
, int, char*, long unsigned int)>’
/usr/include/uWS/Group.h:70:10: note: candidate: void uWS::Group::onDisconnection(std::function<void(uWS::WebSocket, int, char, long unsigned int)>) [with bool isServer = false]
/usr/include/uWS/Group.h:70:10: note: no known conversion for argument 1 from ‘main()::<lambda(uWS::WebSocket, int, char*, size_t)>’ to ‘std::function<void(uWS::WebSocket, int, char, long unsigned int)>’
CMakeFiles/mpc.dir/build.make:86: recipe for target 'CMakeFiles/mpc.dir/src/main.cpp.o' failed
make[2]: *** [CMakeFiles/mpc.dir/src/main.cpp.o] Error 1
CMakeFiles/Makefile2:67: recipe for target 'CMakeFiles/mpc.dir/all' failed
make[1]: *** [CMakeFiles/mpc.dir/all] Error 2
Makefile:83: recipe for target 'all' failed
make: *** [all] Error 2

@domluna

domluna commented May 27, 2017

Copy link
Copy Markdown
Contributor

@bydavy I'm guessing the install_ubuntu.sh script didn't work for you? It looks like signatures were changed in a recent version.

@bydavy

bydavy commented May 31, 2017

Copy link
Copy Markdown
Author

I tried uWebSockets v0.14.3 and install_ubuntu.sh (aka uWebSockets master) and I hit this error in both cases.

@domluna

domluna commented May 31, 2017

Copy link
Copy Markdown
Contributor

@bydavy an important part was commented out https://github.com/udacity/CarND-MPC-Project/blob/master/install-ubuntu.sh#L6. At that checkout the script should work.

@bydavy

bydavy commented Jun 1, 2017

Copy link
Copy Markdown
Author

I confirm this commit fixed my issue. uWebSockets has changed some method signatures "recently" and it was the reason of the failure. Pulling the given git hash will ensure to use the expected version of uWebSockets.

@bydavy bydavy closed this Jun 1, 2017
@bydavy

bydavy commented Jun 1, 2017

Copy link
Copy Markdown
Author

Thank you for the fix @domluna !

@TIEHua

TIEHua commented Apr 25, 2018

Copy link
Copy Markdown

fatal error: uWS/uWS.h: No such file or directory
I don't know why

2 similar comments
@TIEHua

TIEHua commented Apr 25, 2018

Copy link
Copy Markdown

fatal error: uWS/uWS.h: No such file or directory
I don't know why

@TIEHua

TIEHua commented Apr 25, 2018

Copy link
Copy Markdown

fatal error: uWS/uWS.h: No such file or directory
I don't know why

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants