litespeedtech / lsquic

LiteSpeed QUIC and HTTP/3 Library
MIT License
1.54k stars 334 forks source link

make error #73

Closed Zxy675272387 closed 5 years ago

Zxy675272387 commented 5 years ago

when I cd lsquic-client and make,the errors as below,it seems that my libevent version is not suitable,but I don't know how fix it [ 35%] Linking C executable http_client CMakeFiles/http_client.dir/test/http_client.c.o: In function create_another_conn_or_stop': /home/b/quictest/lsquic/lsquic-client/test/http_client.c:292: undefined reference toevent_free' CMakeFiles/http_client.dir/test/http_client.c.o: In function http_client_on_conn_closed': /home/b/quictest/lsquic/lsquic-client/test/http_client.c:332: undefined reference toevent_new' CMakeFiles/http_client.dir/test/prog.c.o: In function prog_run': /home/b/quictest/lsquic/lsquic-client/test/prog.c:345: undefined reference toevent_new'

dtikhonov commented 5 years ago

You need libevent2. What OS are you using?

Zxy675272387 commented 5 years ago

debian 9.5 and my libevent version is libevent-2.1.10-stable

dtikhonov commented 5 years ago

libevent on my system is 2.0.21. If the API were incompatible, lsquic would not have compiled -- but what you are getting are link errors.

dtikhonov commented 5 years ago

I just downloaded libevent 2.1.10 and compiled, linked, and ran lsquic using it:

cmake -DCMAKE_LIBRARY_PATH=$HOME/local/lib -DCMAKE_INCLUDE_PATH=$HOME/local/include .

I don't know why it fails on your system.

Zxy675272387 commented 5 years ago

I enter the source file http_client.c,find you use include<event2/event.h>,but on my os ,if I include<event2/event.h>to use libevent it can't be compiled. If I change the include into include,the error is http_client.c:286:30: error: unknown type name ‘evutil_socket_t’ create_another_conn_or_stop (evutil_socket_t sock, short events, void *ctx),is this happened because of my OS?

dtikhonov commented 5 years ago

It may be because you don't have libevent development package installed. On Ubuntu, libevent header files are in /usr/include/event2 and are distrubuted in libevent-dev package. I don't have experience with Debian, but it should be similar.

dtikhonov commented 5 years ago

If everything else fails, you can do what I did above: compile and install a separate copy of libevent and use that.

Zxy675272387 commented 5 years ago

I find why,because my libevent and libevent-dev seems are not the same version,after I change to 2.0.21,there is no error,but the make msg is : 35%] Built target lsquic [ 35%] Built target http_client [ 35%] Built target graph_cubic [ 35%] Built target test_frame_rw [ 35%] Built target test_wuf_gquic_le [ 35%] Built target test_wuf_gquic_be [ 35%] Built target test_ver_nego [ 35%] Built target test_export_key [ 35%] Built target test_stream [ 35%] Built target test_frame_chop [ 35%] Built target test_streamgen [ 35%] Built target test_di_nocopy [ 35%] Built target test_cubic [ 35%] Built target test_engine_ctor [ 35%] Built target test_blocked_gquic_be [ 35%] Built target test_reg_pkt_headergen [ 35%] Built target test_conn_hash [ 35%] Built target test_goaway_gquic_be [ 35%] Built target test_frame_writer [ 35%] Built target test_packno_len [ 35%] Built target test_ackparse_gquic_le [ 35%] Built target test_qlog [ 35%] Built target test_spi [ 35%] Built target test_ackparse_gquic_be [ 35%] Built target test_packet_out [ 35%] Built target test_rst_stream_gquic_be [ 35%] Built target test_conn_close_gquic_le [ 35%] Built target test_ackgen_gquic_be [ 35%] Built target test_conn_close_gquic_be [ 35%] Built target test_rtt [ 35%] Built target test_ackgen_gquic_le [ 35%] Built target test_dec [ 35%] Built target test_lsquic_hash [ 35%] Built target test_attq [ 35%] Built target test_alarmset [ 35%] Built target test_arr [ 35%] Built target test_blocked_gquic_le [ 35%] Built target test_some_packets [ 35%] Built target test_parse_packet_in [ 35%] Built target test_elision [ 35%] Built target test_goaway_gquic_le [ 35%] Built target test_buf [ 35%] Built target test_quic_be_floats [ 35%] Built target test_rechist [ 35%] Built target test_frame_reader [ 35%] Built target test_hkdf [ 35%] Built target test_malo [ 35%] Built target test_quic_le_floats [ 35%] Built target test_rst_stream_gquic_le [ 35%] Built target test_senhist [ 35%] Built target test_set [ 35%] Built target test_sfcw [ 35%] Built target test_stop_waiting_gquic_be [ 35%] Built target test_stop_waiting_gquic_le [ 35%] Built target test_streamparse

dtikhonov commented 5 years ago

there is no error,but the make msg is

Yes, those are test files: by default, everything is built. You can type make http_client to compile just the client program.

litespeedtech commented 5 years ago

No feedback for a while -- closing bug.