Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cmake .. && make failed #11

Closed
zfadminer opened this issue Jun 20, 2017 · 3 comments
Closed

cmake .. && make failed #11

zfadminer opened this issue Jun 20, 2017 · 3 comments

Comments

@zfadminer
Copy link

i have installed all the dependeces,but when i run " cmake .. && make“ ,it failed show:

[ 33%] Building CXX object CMakeFiles/pid.dir/src/main.cpp.o
/home/adminer/CarND-PID-Control-Project-master/src/main.cpp: In lambda function:
/home/adminer/CarND-PID-Control-Project-master/src/main.cpp:51:18: warning: unused variable ‘speed’ [-Wunused-variable]
double speed = std::stod(j[1]["speed"].getstd::string());
^~~~~
/home/adminer/CarND-PID-Control-Project-master/src/main.cpp:52:18: warning: unused variable ‘angle’ [-Wunused-variable]
double angle = std::stod(j[1]["steering_angle"].getstd::string());
^~~~~
/home/adminer/CarND-PID-Control-Project-master/src/main.cpp: In function ‘int main()’:
/home/adminer/CarND-PID-Control-Project-master/src/main.cpp:77: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 /home/adminer/CarND-PID-Control-Project-master/src/main.cpp:1:
/usr/include/uWS/Group.h:69:10: note: candidate: void uWS::Group::onMessage(std::function<void(uWS::WebSocket, char, 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*, unsigned int, uWS::OpCode)>’
/usr/include/uWS/Group.h:69:10: note: candidate: void uWS::Group::onMessage(std::function<void(uWS::WebSocket, char, 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, unsigned int, uWS::OpCode)>’
/home/adminer/CarND-PID-Control-Project-master/src/main.cpp:96: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 /home/adminer/CarND-PID-Control-Project-master/src/main.cpp:1:
/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)>’
/home/adminer/CarND-PID-Control-Project-master/src/main.cpp:101: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 /home/adminer/CarND-PID-Control-Project-master/src/main.cpp:1:
/usr/include/uWS/Group.h:70:10: note: candidate: void uWS::Group::onDisconnection(std::function<void(uWS::WebSocket, int, char, 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*, unsigned int)>’
/usr/include/uWS/Group.h:70:10: note: candidate: void uWS::Group::onDisconnection(std::function<void(uWS::WebSocket, int, char, 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, unsigned int)>’
CMakeFiles/pid.dir/build.make:86: recipe for target 'CMakeFiles/pid.dir/src/main.cpp.o' failed
make[2]: *** [CMakeFiles/pid.dir/src/main.cpp.o] Error 1
CMakeFiles/Makefile2:67: recipe for target 'CMakeFiles/pid.dir/all' failed
make[1]: *** [CMakeFiles/pid.dir/all] Error 2
Makefile:83: recipe for target 'all' failed
make: *** [all] Error 2

who can help me
thank you very much!

@githubuse
Copy link

I met same problem, compile from Mac, can't be solved with uWebSockets(checkout e94b6e1) as udacity/CarND-MPC-Project#3 .
my error log is similar:
[ 33%] Building CXX object CMakeFiles/pid.dir/src/PID.cpp.o
[ 66%] Building CXX object CMakeFiles/pid.dir/src/main.cpp.o
/Users/xhpan/Desktop/self_driving_research/CarND-PID-Control-Project/src/main.cpp:50:5: error: no matching member function for call
to 'onMessage'
h.onMessage([&pid](uWS::WebSocketuWS::SERVER *ws, char *data, size_t length, uWS::OpCode opCode) {
~~^~~~~~~~~
/usr/local/include/uWS/Group.h:63:10: note: candidate function not viable: no known conversion from '(lambda at
/Users/xhpan/Desktop/self_driving_research/CarND-PID-Control-Project/src/main.cpp:50: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:63:10: note: candidate function not viable: no known conversion from '(lambda at
/Users/xhpan/Desktop/self_driving_research/CarND-PID-Control-Project/src/main.cpp:50:15)' to 'std::function<void
(WebSocket, char *, size_t, OpCode)>' (aka 'function<void (WebSocket, char *, unsigned long, uWS::OpCode)>')
for 1st argument
/Users/xhpan/Desktop/self_driving_research/CarND-PID-Control-Project/src/main.cpp:120:5: error: no matching member function for
call to 'onConnection'
h.onConnection([&h](uWS::WebSocketuWS::SERVER *ws, uWS::HttpRequest req) {
~~^~~~~~~~~~~~
/usr/local/include/uWS/Group.h:62:10: note: candidate function not viable: no known conversion from '(lambda at
/Users/xhpan/Desktop/self_driving_research/CarND-PID-Control-Project/src/main.cpp:120:18)' to 'std::function<void
(WebSocket, HttpRequest)>' for 1st argument
void onConnection(std::function<void(WebSocket, HttpRequest)> handler);
^
/usr/local/include/uWS/Group.h:62:10: note: candidate function not viable: no known conversion from '(lambda at
/Users/xhpan/Desktop/self_driving_research/CarND-PID-Control-Project/src/main.cpp:120:18)' to 'std::function<void
(WebSocket, HttpRequest)>' for 1st argument
/Users/xhpan/Desktop/self_driving_research/CarND-PID-Control-Project/src/main.cpp:124:5: error: no matching member function for
call to 'onDisconnection'
h.onDisconnection([&h](uWS::WebSocketuWS::SERVER *ws, int code, char *message, size_t length) {
~~^~~~~~~~~~~~~~~
/usr/local/include/uWS/Group.h:64:10: note: candidate function not viable: no known conversion from '(lambda at
/Users/xhpan/Desktop/self_driving_research/CarND-PID-Control-Project/src/main.cpp:124: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:64:10: note: candidate function not viable: no known conversion from '(lambda at
/Users/xhpan/Desktop/self_driving_research/CarND-PID-Control-Project/src/main.cpp:124: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/pid.dir/src/main.cpp.o] Error 1
make[1]: *** [CMakeFiles/pid.dir/all] Error 2

@mvirgo
Copy link
Contributor

mvirgo commented Nov 20, 2018

Closing due to no recent comments; we now have a Workspace in the classroom with uWS already all set up, so should be able to avoid this issue.

@mvirgo mvirgo closed this as completed Nov 20, 2018
@bakijan
Copy link

bakijan commented Jul 8, 2019

I got same error in Workspace in the classroom
cmake .. && make
-- Configuring done
-- Generating done
-- Build files have been written to: /home/workspace/CarND-PID-Control-Project/build
[ 33%] Linking CXX executable pid
/usr/lib/libuWS.so: undefined reference to SSL_CTX_use_certificate_chain_file@OPENSSL_1.0.0' /usr/lib/libuWS.so: undefined reference to SSL_want@OPENSSL_1.0.0'
/usr/lib/libuWS.so: undefined reference to SSL_write@OPENSSL_1.0.0' /usr/lib/libuWS.so: undefined reference to SSL_set_fd@OPENSSL_1.0.0'
/usr/lib/libuWS.so: undefined reference to SSL_set_connect_state@OPENSSL_1.0.0' /usr/lib/libuWS.so: undefined reference to SSL_ctrl@OPENSSL_1.0.0'
/usr/lib/libuWS.so: undefined reference to SSL_free@OPENSSL_1.0.0' /usr/lib/libuWS.so: undefined reference to SSL_library_init@OPENSSL_1.0.0'
/usr/lib/libuWS.so: undefined reference to SSL_CTX_ctrl@OPENSSL_1.0.0' /usr/lib/libuWS.so: undefined reference to SSL_CTX_set_default_passwd_cb_userdata@OPENSSL_1.0.0'
/usr/lib/libuWS.so: undefined reference to SSLv23_server_method@OPENSSL_1.0.0' /usr/lib/libuWS.so: undefined reference to SSL_pending@OPENSSL_1.0.0'
/usr/lib/libuWS.so: undefined reference to SSLv23_client_method@OPENSSL_1.0.0' /usr/lib/libuWS.so: undefined reference to SHA1@OPENSSL_1.0.0'
/usr/lib/libuWS.so: undefined reference to SSL_CTX_new@OPENSSL_1.0.0' /usr/lib/libuWS.so: undefined reference to SSL_CTX_use_PrivateKey_file@OPENSSL_1.0.0'
/usr/lib/libuWS.so: undefined reference to SSL_set_accept_state@OPENSSL_1.0.0' /usr/lib/libuWS.so: undefined reference to SSL_CTX_free@OPENSSL_1.0.0'
/usr/lib/libuWS.so: undefined reference to SSL_get_error@OPENSSL_1.0.0' /usr/lib/libuWS.so: undefined reference to SSL_CTX_set_default_passwd_cb@OPENSSL_1.0.0'
/usr/lib/libuWS.so: undefined reference to SSL_new@OPENSSL_1.0.0' /usr/lib/libuWS.so: undefined reference to SSL_shutdown@OPENSSL_1.0.0'
/usr/lib/libuWS.so: undefined reference to `SSL_read@OPENSSL_1.0.0'
collect2: error: ld returned 1 exit status
CMakeFiles/pid.dir/build.make:120: recipe for target 'pid' failed
make[2]: *** [pid] Error 1
CMakeFiles/Makefile2:67: recipe for target 'CMakeFiles/pid.dir/all' failed
make[1]: *** [CMakeFiles/pid.dir/all] Error 2
Makefile:83: recipe for target 'all' failed
make: *** [all] Error 2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants