nicolasff / webdis

A Redis HTTP interface with JSON output
https://webd.is
BSD 2-Clause "Simplified" License
2.82k stars 305 forks source link

Unidentified reference to http_ #74

Closed djonesesight closed 10 years ago

djonesesight commented 11 years ago

esight@esight-MS-7588:~/webdis$ sudo make install cc -c -O0 -ggdb -Wall -Wextra -I. -Ijansson/src -Ihttp-parser -llibrary -o webdis.o webdis.c cc -c -O0 -ggdb -Wall -Wextra -I. -Ijansson/src -Ihttp-parser -llibrary -o cmd.o cmd.c cc -c -O0 -ggdb -Wall -Wextra -I. -Ijansson/src -Ihttp-parser -llibrary -o worker.o worker.c cc -c -O0 -ggdb -Wall -Wextra -I. -Ijansson/src -Ihttp-parser -llibrary -o slog.o slog.c cc -c -O0 -ggdb -Wall -Wextra -I. -Ijansson/src -Ihttp-parser -llibrary -o server.o server.c cc -c -O0 -ggdb -Wall -Wextra -I. -Ijansson/src -Ihttp-parser -llibrary -o libb64/cencode.o libb64/cencode.c cc -c -O0 -ggdb -Wall -Wextra -I. -Ijansson/src -Ihttp-parser -llibrary -o acl.o acl.c cc -c -O0 -ggdb -Wall -Wextra -I. -Ijansson/src -Ihttp-parser -llibrary -o md5/md5.o md5/md5.c cc -c -O0 -ggdb -Wall -Wextra -I. -Ijansson/src -Ihttp-parser -llibrary -o sha1/sha1.o sha1/sha1.c cc -c -O0 -ggdb -Wall -Wextra -I. -Ijansson/src -Ihttp-parser -llibrary -o http.o http.c http.c: In function ‘evhttp_send_continue_done’: http.c:399:66: warning: unused parameter ‘arg’ [-Wunused-parameter] http.c: In function ‘evhttp_write_cb’: http.c:754:37: warning: unused parameter ‘bufev’ [-Wunused-parameter] http.c: In function ‘evhttp_read_cb’: http.c:1044:36: warning: unused parameter ‘bufev’ [-Wunused-parameter] http.c: In function ‘evhttp_deferred_read_cb’: http.c:1099:45: warning: unused parameter ‘cb’ [-Wunused-parameter] http.c: In function ‘evhttp_write_connectioncb’: http.c:1106:66: warning: unused parameter ‘arg’ [-Wunused-parameter] http.c: In function ‘evhttp_connection_retry’: http.c:1273:41: warning: unused parameter ‘fd’ [-Wunused-parameter] http.c:1273:51: warning: unused parameter ‘what’ [-Wunused-parameter] http.c: In function ‘evhttp_error_cb’: http.c:1323:37: warning: unused parameter ‘bufev’ [-Wunused-parameter] http.c: In function ‘evhttp_send_done’: http.c:2341:57: warning: unused parameter ‘arg’ [-Wunused-parameter] http.c: In function ‘accept_socket_cb’: http.c:3076:41: warning: unused parameter ‘listener’ [-Wunused-parameter] cc -c -O0 -ggdb -Wall -Wextra -I. -Ijansson/src -Ihttp-parser -llibrary -o client.o client.c cc -c -O0 -ggdb -Wall -Wextra -I. -Ijansson/src -Ihttp-parser -llibrary -o websocket.o websocket.c cc -c -O0 -ggdb -Wall -Wextra -I. -Ijansson/src -Ihttp-parser -llibrary -o pool.o pool.c cc -c -O0 -ggdb -Wall -Wextra -I. -Ijansson/src -Ihttp-parser -llibrary -o conf.o conf.c cc -c -O0 -ggdb -Wall -Wextra -I. -Ijansson/src -Ihttp-parser -llibrary -o formats/json.o formats/json.c cc -c -O0 -ggdb -Wall -Wextra -I. -Ijansson/src -Ihttp-parser -llibrary -o formats/raw.o formats/raw.c cc -c -O0 -ggdb -Wall -Wextra -I. -Ijansson/src -Ihttp-parser -llibrary -o formats/common.o formats/common.c cc -c -O0 -ggdb -Wall -Wextra -I. -Ijansson/src -Ihttp-parser -llibrary -o formats/custom-type.o formats/custom-type.c cc -c -O0 -ggdb -Wall -Wextra -I. -Ijansson/src -Ihttp-parser -llibrary -o hiredis/hiredis.o hiredis/hiredis.c cc -c -O0 -ggdb -Wall -Wextra -I. -Ijansson/src -Ihttp-parser -llibrary -o hiredis/sds.o hiredis/sds.c cc -c -O0 -ggdb -Wall -Wextra -I. -Ijansson/src -Ihttp-parser -llibrary -o hiredis/net.o hiredis/net.c cc -c -O0 -ggdb -Wall -Wextra -I. -Ijansson/src -Ihttp-parser -llibrary -o hiredis/async.o hiredis/async.c cc -c -O0 -ggdb -Wall -Wextra -I. -Ijansson/src -Ihttp-parser -llibrary -o jansson/src/dump.o jansson/src/dump.c cc -c -O0 -ggdb -Wall -Wextra -I. -Ijansson/src -Ihttp-parser -llibrary -o jansson/src/error.o jansson/src/error.c cc -c -O0 -ggdb -Wall -Wextra -I. -Ijansson/src -Ihttp-parser -llibrary -o jansson/src/hashtable.o jansson/src/hashtable.c cc -c -O0 -ggdb -Wall -Wextra -I. -Ijansson/src -Ihttp-parser -llibrary -o jansson/src/load.o jansson/src/load.c cc -c -O0 -ggdb -Wall -Wextra -I. -Ijansson/src -Ihttp-parser -llibrary -o jansson/src/strbuffer.o jansson/src/strbuffer.c cc -c -O0 -ggdb -Wall -Wextra -I. -Ijansson/src -Ihttp-parser -llibrary -o jansson/src/utf.o jansson/src/utf.c cc -c -O0 -ggdb -Wall -Wextra -I. -Ijansson/src -Ihttp-parser -llibrary -o jansson/src/value.o jansson/src/value.c cc -c -O0 -ggdb -Wall -Wextra -I. -Ijansson/src -Ihttp-parser -llibrary -o jansson/src/variadic.o jansson/src/variadic.c cc -c -O0 -ggdb -Wall -Wextra -I. -Ijansson/src -Ihttp-parser -llibrary -o http-parser/http_parser.o http-parser/http_parser.c cc -o webdis webdis.o cmd.o worker.o slog.o server.o libb64/cencode.o acl.o md5/md5.o sha1/sha1.o http.o client.o websocket.o pool.o conf.o formats/json.o formats/raw.o formats/common.o formats/custom-type.o hiredis/hiredis.o hiredis/sds.o hiredis/net.o hiredis/async.o jansson/src/dump.o jansson/src/error.o jansson/src/hashtable.o jansson/src/load.o jansson/src/strbuffer.o jansson/src/utf.o jansson/src/value.o jansson/src/variadic.o http-parser/http_parser.o -levent -pthread worker.o: In function worker_can_read': /home/esight/webdis/worker.c:51: undefined reference tohttp_send_error' /home/esight/webdis/worker.c:65: undefined reference to http_send_error' /home/esight/webdis/worker.c:79: undefined reference tohttp_send_error' /home/esight/webdis/worker.c:82: undefined reference to http_send_error' worker.o: In functionworker_process_client': /home/esight/webdis/worker.c:191: undefined reference to http_crossdomain' /home/esight/webdis/worker.c:210: undefined reference tohttp_send_options' /home/esight/webdis/worker.c:214: undefined reference to http_send_error' /home/esight/webdis/worker.c:222: undefined reference tohttp_send_error' /home/esight/webdis/worker.c:227: undefined reference to http_send_error' websocket.o: In functionws_reply': /home/esight/webdis/websocket.c:366: undefined reference to http_response_init' /home/esight/webdis/websocket.c:377: undefined reference tohttp_schedule_write' formats/common.o: In function format_send_error': /home/esight/webdis/formats/common.c:43: undefined reference tohttp_response_init' /home/esight/webdis/formats/common.c:45: undefined reference to http_response_set_keep_alive' /home/esight/webdis/formats/common.c:46: undefined reference tohttp_response_write' formats/common.o: In function format_send_reply': /home/esight/webdis/formats/common.c:79: undefined reference tohttp_response_init' /home/esight/webdis/formats/common.c:82: undefined reference to http_response_set_header' /home/esight/webdis/formats/common.c:84: undefined reference tohttp_response_set_header' /home/esight/webdis/formats/common.c:85: undefined reference to http_response_set_keep_alive' /home/esight/webdis/formats/common.c:86: undefined reference tohttp_response_set_header' /home/esight/webdis/formats/common.c:87: undefined reference to http_response_set_body' /home/esight/webdis/formats/common.c:88: undefined reference tohttp_response_write' /home/esight/webdis/formats/common.c:91: undefined reference to http_response_write_chunk' /home/esight/webdis/formats/common.c:102: undefined reference tohttp_response_init' /home/esight/webdis/formats/common.c:104: undefined reference to http_response_init' /home/esight/webdis/formats/common.c:106: undefined reference tohttp_response_set_header' /home/esight/webdis/formats/common.c:108: undefined reference to http_response_set_header' /home/esight/webdis/formats/common.c:109: undefined reference tohttp_response_set_header' /home/esight/webdis/formats/common.c:110: undefined reference to http_response_set_body' /home/esight/webdis/formats/common.c:113: undefined reference tohttp_response_set_keep_alive' /home/esight/webdis/formats/common.c:114: undefined reference to http_response_write' formats/custom-type.o: In functioncustom_type_reply': /home/esight/webdis/formats/custom-type.c:65: undefined reference to http_response_init' /home/esight/webdis/formats/custom-type.c:66: undefined reference tohttp_response_set_header' /home/esight/webdis/formats/custom-type.c:67: undefined reference to http_response_set_keep_alive' /home/esight/webdis/formats/custom-type.c:68: undefined reference tohttp_response_write' collect2: ld returned 1 exit status make: *\ [webdis] Error 1

I keep getting this error when trying to make webdis, anyone know the fix?

nicolasff commented 11 years ago

Hi,

Which OS/distribution/compiler are you trying to build webdis with? Also, which version of webdis are you using?

Thanks!

djonesesight commented 11 years ago

I’m running Ubuntu 12.04, I'm using whatever compiler comes standard with Ubuntu, and I'm using the latest version of webdis I believe (I pulled it on Friday).

djonesesight commented 11 years ago

I was also initially having trouble with the link to libevent, and had to put the source files right into the webdis folder to avoid getting the issues that result from webdis not seeing libevent, now I have this problem.

nicolasff commented 11 years ago

The issue is probably related to the way you installed libevent. You should use the package manager to install it, using sudo apt-get install libevent-dev.

djonesesight commented 11 years ago

That is how I have it installed, and I have tried re-installing it a few times, which hasn't helped. I don't think that this issue is a problem with libevent any more though, it was giving me different errors before about not being able to see event.h and what not, so I'm assuming that the libevent stuff sorted itself out when I put the source files into the webdis folder.

djonesesight commented 11 years ago

By the way, thank you for helping me try to figure this out Nicolas!

nicolasff commented 11 years ago

@djonesesight I tried to reproduce your scenario, without encountering the issue myself:

$ git clone https://github.com/nicolasff/webdis.git
Cloning into 'webdis'...
remote: Counting objects: 1766, done.
remote: Compressing objects: 100% (835/835), done.
remote: Total 1766 (delta 969), reused 1713 (delta 924)
Receiving objects: 100% (1766/1766), 651.21 KiB | 516 KiB/s, done.
Resolving deltas: 100% (969/969), done.
$ cd webdis/
$ sudo apt-get install libevent-dev
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following NEW packages will be installed
  libevent-dev
0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
Need to get 0 B/272 kB of archives.
After this operation, 1,411 kB of additional disk space will be used.
Selecting previously unselected package libevent-dev.
(Reading database ... 62357 files and directories currently installed.)
Unpacking libevent-dev (from .../libevent-dev_2.0.19-stable-3_amd64.deb) ...
Setting up libevent-dev (2.0.19-stable-3) ...
$ make
cc -c -O0 -ggdb -Wall -Wextra -I. -Ijansson/src -Ihttp-parser -o webdis.o webdis.c
cc -c -O0 -ggdb -Wall -Wextra -I. -Ijansson/src -Ihttp-parser -o cmd.o cmd.c
cc -c -O0 -ggdb -Wall -Wextra -I. -Ijansson/src -Ihttp-parser -o worker.o worker.c
cc -c -O0 -ggdb -Wall -Wextra -I. -Ijansson/src -Ihttp-parser -o slog.o slog.c
cc -c -O0 -ggdb -Wall -Wextra -I. -Ijansson/src -Ihttp-parser -o server.o server.c
cc -c -O0 -ggdb -Wall -Wextra -I. -Ijansson/src -Ihttp-parser -o libb64/cencode.o libb64/cencode.c
cc -c -O0 -ggdb -Wall -Wextra -I. -Ijansson/src -Ihttp-parser -o acl.o acl.c
cc -c -O0 -ggdb -Wall -Wextra -I. -Ijansson/src -Ihttp-parser -o md5/md5.o md5/md5.c
cc -c -O0 -ggdb -Wall -Wextra -I. -Ijansson/src -Ihttp-parser -o sha1/sha1.o sha1/sha1.c
cc -c -O0 -ggdb -Wall -Wextra -I. -Ijansson/src -Ihttp-parser -o http.o http.c
cc -c -O0 -ggdb -Wall -Wextra -I. -Ijansson/src -Ihttp-parser -o client.o client.c
cc -c -O0 -ggdb -Wall -Wextra -I. -Ijansson/src -Ihttp-parser -o websocket.o websocket.c
cc -c -O0 -ggdb -Wall -Wextra -I. -Ijansson/src -Ihttp-parser -o pool.o pool.c
cc -c -O0 -ggdb -Wall -Wextra -I. -Ijansson/src -Ihttp-parser -o conf.o conf.c
cc -c -O0 -ggdb -Wall -Wextra -I. -Ijansson/src -Ihttp-parser -o formats/json.o formats/json.c
cc -c -O0 -ggdb -Wall -Wextra -I. -Ijansson/src -Ihttp-parser -o formats/raw.o formats/raw.c
cc -c -O0 -ggdb -Wall -Wextra -I. -Ijansson/src -Ihttp-parser -o formats/common.o formats/common.c
cc -c -O0 -ggdb -Wall -Wextra -I. -Ijansson/src -Ihttp-parser -o formats/custom-type.o formats/custom-type.c
cc -c -O0 -ggdb -Wall -Wextra -I. -Ijansson/src -Ihttp-parser -o hiredis/hiredis.o hiredis/hiredis.c
cc -c -O0 -ggdb -Wall -Wextra -I. -Ijansson/src -Ihttp-parser -o hiredis/sds.o hiredis/sds.c
cc -c -O0 -ggdb -Wall -Wextra -I. -Ijansson/src -Ihttp-parser -o hiredis/net.o hiredis/net.c
cc -c -O0 -ggdb -Wall -Wextra -I. -Ijansson/src -Ihttp-parser -o hiredis/async.o hiredis/async.c
cc -c -O0 -ggdb -Wall -Wextra -I. -Ijansson/src -Ihttp-parser -o jansson/src/dump.o jansson/src/dump.c
cc -c -O0 -ggdb -Wall -Wextra -I. -Ijansson/src -Ihttp-parser -o jansson/src/error.o jansson/src/error.c
cc -c -O0 -ggdb -Wall -Wextra -I. -Ijansson/src -Ihttp-parser -o jansson/src/hashtable.o jansson/src/hashtable.c
cc -c -O0 -ggdb -Wall -Wextra -I. -Ijansson/src -Ihttp-parser -o jansson/src/load.o jansson/src/load.c
cc -c -O0 -ggdb -Wall -Wextra -I. -Ijansson/src -Ihttp-parser -o jansson/src/strbuffer.o jansson/src/strbuffer.c
cc -c -O0 -ggdb -Wall -Wextra -I. -Ijansson/src -Ihttp-parser -o jansson/src/utf.o jansson/src/utf.c
cc -c -O0 -ggdb -Wall -Wextra -I. -Ijansson/src -Ihttp-parser -o jansson/src/value.o jansson/src/value.c
cc -c -O0 -ggdb -Wall -Wextra -I. -Ijansson/src -Ihttp-parser -o jansson/src/variadic.o jansson/src/variadic.c
cc -c -O0 -ggdb -Wall -Wextra -I. -Ijansson/src -Ihttp-parser -o http-parser/http_parser.o http-parser/http_parser.c
cc -o webdis webdis.o cmd.o worker.o slog.o server.o libb64/cencode.o acl.o md5/md5.o sha1/sha1.o http.o client.o websocket.o pool.o conf.o formats/json.o formats/raw.o formats/common.o formats/custom-type.o hiredis/hiredis.o hiredis/sds.o hiredis/net.o hiredis/async.o jansson/src/dump.o jansson/src/error.o jansson/src/hashtable.o jansson/src/load.o jansson/src/strbuffer.o jansson/src/utf.o jansson/src/value.o jansson/src/variadic.o http-parser/http_parser.o -levent -pthread

Could you post a similar dump that would show your steps? Could you also try to run make clean before running make again?

Thanks.

djonesesight commented 11 years ago

esight@esight-MS-7588:~$ pwd /home/esight esight@esight-MS-7588:~$ sudo apt-get install libevent-dev [sudo] password for esight: Reading package lists... Done Building dependency tree
Reading state information... Done The following NEW packages will be installed: libevent-dev 0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded. Need to get 0 B/281 kB of archives. After this operation, 1,127 kB of additional disk space will be used. Selecting previously unselected package libevent-dev. (Reading database ... 196664 files and directories currently installed.) Unpacking libevent-dev (from .../libevent-dev_2.0.16-stable-1_i386.deb) ... Setting up libevent-dev (2.0.16-stable-1) ... esight@esight-MS-7588:~$ git clone https://github.com/nicolasff/webdis.git Cloning into 'webdis'... remote: Counting objects: 1766, done. remote: Compressing objects: 100% (835/835), done. remote: Total 1766 (delta 969), reused 1713 (delta 924) Receiving objects: 100% (1766/1766), 651.21 KiB | 592 KiB/s, done. Resolving deltas: 100% (969/969), done. esight@esight-MS-7588:~$ cd webdis esight@esight-MS-7588:~/webdis$ make cc -c -O0 -ggdb -Wall -Wextra -I. -Ijansson/src -Ihttp-parser -o webdis.o webdis.c In file included from webdis.c:1:0: server.h:14:15: error: field ‘ev’ has incomplete type make: * [webdis.o] Error 1 esight@esight-MS-7588:~/webdis$ make clean rm -f webdis.o cmd.o worker.o slog.o server.o libb64/cencode.o acl.o md5/md5.o sha1/sha1.o http.o client.o websocket.o pool.o conf.o formats/json.o formats/raw.o formats/common.o formats/custom-type.o hiredis/hiredis.o hiredis/sds.o hiredis/net.o hiredis/async.o jansson/src/dump.o jansson/src/error.o jansson/src/hashtable.o jansson/src/load.o jansson/src/strbuffer.o jansson/src/utf.o jansson/src/value.o jansson/src/variadic.o http-parser/http_parser.o webdis esight@esight-MS-7588:~/webdis$ make cc -c -O0 -ggdb -Wall -Wextra -I. -Ijansson/src -Ihttp-parser -o webdis.o webdis.c In file included from webdis.c:1:0: server.h:14:15: error: field ‘ev’ has incomplete type make: * [webdis.o] Error 1 esight@esight-MS-7588:~/webdis$

djonesesight commented 11 years ago

@nicolasff Before I did this in the terminal I deleted my previous webdis folder and uninstalled libevent so I could start fresh for the purposes of demonstrating this to you. From here what I did last time was played around with the -levent tag in the makefile, trying to get it to recognise libevent, and when that didn't work I put the libevent source files into the webdis folder and tried another make which produced the output that is found in the original post.

nicolasff commented 11 years ago

Thanks. I'll try with a fresh Ubuntu 12.04 VM and will report back.

djonesesight commented 11 years ago

Ok, thanks. I had a colleague who just did that and webdis installed fine for him, he also has Ubuntu 12.04, so I don't think that it is an environment related issue, but never the less I'm interested to see your findings.

nicolasff commented 11 years ago

Could this be the same error as https://github.com/darkk/redsocks/issues/9#issuecomment-792034? If you've installed libevent headers by hand, it is possible that GCC is still picking those up.

I tried installing libevent-dev and then running make on a new Ubuntu 12.04 VM and did not encounter this issue.

djonesesight commented 11 years ago

It doesn't look like the same issue to me, and I have never installed headers by hand, Ubuntu is new to this machine and I encountered this problem as the OS was pretty much freshly installed when I encountered this issue. If for some reason there were some other headers that GCC is picking up, how would I go about finding an deleting them?

djonesesight commented 11 years ago

I solved the problem! Here is what I did: I did a fresh clone of webdis, downloaded libevent from here: libevent.org, and then put the contents of the libevent directory into the webdis directory, when it asks if you want to replace "http.c" I said no, whereas before I said yes. In the terminal I navigated to my webdis directory and did a make, the webdis code recognised the libevent source and it worked! I still have no idea why It couldn’t recognise the libevent that I have installed but this works if you have to resort to it.

nicolasff commented 11 years ago

Great, I'm glad you managed to solve the issue.

Nicolas

On 22 May 2013, at 15:32, djonesesight notifications@github.com wrote:

I solved the problem! Here is what I did: I did a fresh clone of webdis, downloaded libevent from here libevent.org, and then put the contents of the libevent directory into the webdis directory, when it asks if you want to replace "http.c" I said no, whereas before I said yes. In the terminal I navigated to my webdis directory and did a make, the webdis code recognised the libevent source and it worked! I still have no idea why It couldn’t recognise the libevent that I have installed but this works if you have to resort to it.

— Reply to this email directly or view it on GitHub.