Open subnetmarco opened 8 years ago
Never seen those linking errors before. What compiler and version are you using?
@thefosk ^
[ec2-user@ip-172-31-58-108 ~]$ gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/libexec/gcc/x86_64-amazon-linux/4.8.3/lto-wrapper
Target: x86_64-amazon-linux
Configured with: ../configure --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --with-bugurl=http://bugzilla.redhat.com/bugzilla --enable-bootstrap --enable-shared --enable-threads=posix --enable-checking=release --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --enable-gnu-unique-object --enable-linker-build-id --with-linker-hash-style=gnu --enable-languages=c,c++,fortran,ada,lto --enable-plugin --enable-initfini-array --disable-libgcj --with-isl=/builddir/build/BUILD/gcc-4.8.3-20140911/obj-x86_64-amazon-linux/isl-install --with-cloog=/builddir/build/BUILD/gcc-4.8.3-20140911/obj-x86_64-amazon-linux/cloog-install --enable-gnu-indirect-function --with-tune=generic --with-arch_32=x86-64 --build=x86_64-amazon-linux
Thread model: posix
gcc version 4.8.3 20140911 (Red Hat 4.8.3-9) (GCC)
I've tried building Lwan with gcc-4.8.4 (oldest I have available), and it works, albeit with a few warnings. Are you getting this error with a clean build?
@thefosk Had similar error on Centos 7 with GCC 4.8.5 while not all dependencies installed (zlib-devel)
Linking C static library liblwan-common.a
[ 93%] Built target lwan-common
[ 96%] Building C object lwan/CMakeFiles/lwan.dir/main.c.o
/lwan/lwan/main.c: In function 'parse_args':
/lwan/lwan/main.c:42:9: warning: missing initializer for field 'name' of 'const struct option' [-Wmissing-field-initializers]
{ }
^
In file included from /lwan/lwan/main.c:21:0:
/usr/include/getopt.h:107:15: note: 'name' declared here
const char *name;
^
/lwan/lwan/main.c: In function 'main':
/lwan/lwan/main.c:106:13: warning: missing initializer for field 'handler' of 'lwan_url_map_t' [-Wmissing-field-initializers]
{ }
^
In file included from /lwan/lwan/main.c:26:0:
/lwan/common/lwan.h:255:26: note: 'handler' declared here
lwan_http_status_t (*handler)(lwan_request_t *request, lwan_response_t *response, void *data);
^
Linking C executable lwan
/tmp/ccJEmjYe.ltrans0.ltrans.o:(.rodata+0x3340): undefined reference to `.L1'
/tmp/ccJEmjYe.ltrans0.ltrans.o:(.rodata+0x3348): undefined reference to `.L2'
/tmp/ccJEmjYe.ltrans0.ltrans.o:(.rodata+0x3350): undefined reference to `.L3'
/tmp/ccJEmjYe.ltrans0.ltrans.o:(.rodata+0x3358): undefined reference to `.L4'
/tmp/ccJEmjYe.ltrans0.ltrans.o:(.rodata+0x3360): undefined reference to `.L5'
/tmp/ccJEmjYe.ltrans0.ltrans.o:(.rodata+0x3368): undefined reference to `.L6'
/tmp/ccJEmjYe.ltrans0.ltrans.o:(.rodata+0x3370): undefined reference to `.L7'
/tmp/ccJEmjYe.ltrans0.ltrans.o:(.rodata+0x3378): undefined reference to `.L8'
/tmp/ccJEmjYe.ltrans0.ltrans.o:(.rodata+0x3380): undefined reference to `.L9'
/tmp/ccJEmjYe.ltrans0.ltrans.o:(.rodata+0x3388): undefined reference to `.L10'
/tmp/ccJEmjYe.ltrans0.ltrans.o:(.rodata+0x3390): undefined reference to `.L11'
collect2: error: ld returned 1 exit status
make[2]: *** [lwan/lwan] Error 1
make[1]: *** [lwan/CMakeFiles/lwan.dir/all] Error 2
make: *** [all] Error 2
Cleaning 'build' folder helped so solve the issue.
Is this still an issue?
I am experiencing the following compilation error on the latest Amazon Linux AMI: