lpereira / lwan

Experimental, scalable, high performance HTTP server
https://lwan.ws
GNU General Public License v2.0
5.92k stars 549 forks source link

ld: error: undefined symbol: hash_int_new hash_add hash_find hash_free #363

Closed yonas closed 8 months ago

yonas commented 8 months ago
$ mkdir build ; cd build ; cmake .. -DCMAKE_BUILD_TYPE=Release -G Ninja ; ninja
...
[1/5] Linking C executable src/samples/asyncawait/asyncawait
cc: warning: argument unused during compilation: '-no-pie' [-Wunused-command-line-argument]
[2/5] Linking C executable src/samples/clock/clock
cc: warning: argument unused during compilation: '-no-pie' [-Wunused-command-line-argument]
[3/5] Linking C executable src/bin/tools/configdump
FAILED: src/bin/tools/configdump 
: && /usr/bin/cc -fno-plt -no-pie -Warray-bounds -Wdouble-promotion -Wno-unused-parameter -Wunsequenced -Wvla -Wno-override-init -Wno-free-nonheap-object -Wall -Wextra -Wshadow -Wconversion -std=gnu11 -O3 -DNDEBUG  -mtune=native -march=native -falign-functions=32 -fno-semantic-interposition -fno-asynchronous-unwind-tables -mcrc32 -Wl,-z,now -Wl,-z,relro -Wl,-z,noexecstack src/bin/tools/CMakeFiles/configdump.dir/configdump.c.o src/bin/tools/CMakeFiles/configdump.dir/__/__/lib/lwan-config.c.o src/bin/tools/CMakeFiles/configdump.dir/__/__/lib/lwan-status.c.o src/bin/tools/CMakeFiles/configdump.dir/__/__/lib/lwan-strbuf.c.o src/bin/tools/CMakeFiles/configdump.dir/__/__/lib/missing.c.o -o src/bin/tools/configdump   && :
cc: warning: argument unused during compilation: '-no-pie' [-Wunused-command-line-argument]
ld: error: undefined symbol: hash_int_new
>>> referenced by missing.c
>>>               src/bin/tools/CMakeFiles/configdump.dir/__/__/lib/missing.c.o:(epoll_wait)

ld: error: undefined symbol: hash_add
>>> referenced by missing.c
>>>               src/bin/tools/CMakeFiles/configdump.dir/__/__/lib/missing.c.o:(epoll_wait)

ld: error: undefined symbol: hash_find
>>> referenced by missing.c
>>>               src/bin/tools/CMakeFiles/configdump.dir/__/__/lib/missing.c.o:(epoll_wait)
>>> referenced by missing.c
>>>               src/bin/tools/CMakeFiles/configdump.dir/__/__/lib/missing.c.o:(epoll_wait)

ld: error: undefined symbol: hash_free
>>> referenced by missing.c
>>>               src/bin/tools/CMakeFiles/configdump.dir/__/__/lib/missing.c.o:(epoll_wait)
>>> referenced by missing.c
>>>               src/bin/tools/CMakeFiles/configdump.dir/__/__/lib/missing.c.o:(epoll_wait)
cc: error: linker command failed with exit code 1 (use -v to see invocation)
[4/5] Linking C executable src/samples/websocket/websocket
cc: warning: argument unused during compilation: '-no-pie' [-Wunused-command-line-argument]
[5/5] Linking C executable src/samples/pastebin/pastebin
cc: warning: argument unused during compilation: '-no-pie' [-Wunused-command-line-argument]
ninja: build stopped: subcommand failed.

OS: FreeBSD 14.0 lwan: 88ade5f

lpereira commented 8 months ago

I think this has been fixed in 1ccbed74, could you please try building and report back?

yonas commented 8 months ago

Fixed, thanks!

I've opened #364 for the next build error.