cesanta / v7

Embedded JavaScript engine for C/C++
Other
1.42k stars 177 forks source link

Compiling v7 + mongoose #566

Closed grodansparadis closed 7 years ago

grodansparadis commented 7 years ago

I would like to use v7 together with mongoose (and frozen) in a setup I have but get a lot of multiple defined functions as of below. Is there a way to make them compile together?

../../../common/v7.o: In function mbuf_init': v7.c:(.text+0x0): multiple definition ofmbuf_init' ../../../common/mongoose.o:mongoose.c:(.text+0x195f): first defined here ../../../common/v7.o: In function mbuf_resize': v7.c:(.text+0x86): multiple definition ofmbuf_resize' ../../../common/mongoose.o:mongoose.c:(.text+0x19e5): first defined here ../../../common/v7.o: In function mbuf_free': v7.c:(.text+0x4c): multiple definition ofmbuf_free' ../../../common/mongoose.o:mongoose.c:(.text+0x19ab): first defined here ../../../common/v7.o: In function mbuf_trim': v7.c:(.text+0x103): multiple definition ofmbuf_trim' ../../../common/mongoose.o:mongoose.c:(.text+0x1a62): first defined here ../../../common/v7.o: In function mbuf_insert': v7.c:(.text+0x128): multiple definition ofmbuf_insert' ../../../common/mongoose.o:mongoose.c:(.text+0x1a87): first defined here ../../../common/v7.o: In function mbuf_append': v7.c:(.text+0x3c2): multiple definition ofmbuf_append' ../../../common/mongoose.o:mongoose.c:(.text+0x1d21): first defined here ../../../common/v7.o: In function mbuf_remove': v7.c:(.text+0x3f4): multiple definition ofmbuf_remove' ../../../common/mongoose.o:mongoose.c:(.text+0x1d53): first defined here ../../../common/v7.o: In function c_strnlen': v7.c:(.text+0x461): multiple definition ofc_strnlen' ../../../common/mongoose.o:mongoose.c:(.text+0x3993): first defined here ../../../common/v7.o: In function c_vsnprintf': v7.c:(.text+0x5b1): multiple definition ofc_vsnprintf' ../../../common/mongoose.o:mongoose.c:(.text+0x3ae3): first defined here ../../../common/v7.o: In function c_snprintf': v7.c:(.text+0xf10): multiple definition ofc_snprintf' ../../../common/mongoose.o:mongoose.c:(.text+0x4442): first defined here ../../../common/v7.o: In function c_strnstr': v7.c:(.text+0xfc8): multiple definition ofc_strnstr' ../../../common/mongoose.o:mongoose.c:(.text+0x44fa): first defined here ../../../common/v7.o: In function cs_base64_init': v7.c:(.text+0x19b5): multiple definition ofcs_base64_init' ../../../common/mongoose.o:mongoose.c:(.text+0x2a5): first defined here ../../../common/v7.o: In function cs_base64_update': v7.c:(.text+0x19e9): multiple definition ofcs_base64_update' ../../../common/mongoose.o:mongoose.c:(.text+0x2d9): first defined here ../../../common/v7.o: In function cs_base64_finish': v7.c:(.text+0x1a6c): multiple definition ofcs_base64_finish' ../../../common/mongoose.o:mongoose.c:(.text+0x35c): first defined here ../../../common/v7.o: In function cs_base64_encode': v7.c:(.text+0x1b03): multiple definition ofcs_base64_encode' ../../../common/mongoose.o:mongoose.c:(.text+0x3f3): first defined here ../../../common/v7.o: In function cs_fprint_base64': v7.c:(.text+0x1cb5): multiple definition ofcs_fprint_base64' ../../../common/mongoose.o:mongoose.c:(.text+0x5a5): first defined here ../../../common/v7.o: In function cs_base64_decode': v7.c:(.text+0x1e6f): multiple definition ofcs_base64_decode' ../../../common/mongoose.o:mongoose.c:(.text+0x75f): first defined here ../../../common/v7.o: In function MD5_Init': v7.c:(.text+0x201b): multiple definition ofMD5_Init' ../../../common/mongoose.o:mongoose.c:(.text+0x971): first defined here ../../../common/v7.o: In function MD5_Update': v7.c:(.text+0x2afc): multiple definition ofMD5_Update' ../../../common/mongoose.o:mongoose.c:(.text+0x1452): first defined here ../../../common/v7.o: In function MD5_Final': v7.c:(.text+0x2c89): multiple definition ofMD5_Final' ../../../common/mongoose.o:mongoose.c:(.text+0x15df): first defined here ../../../common/v7.o: In function cs_to_hex': v7.c:(.text+0x2def): multiple definition ofcs_to_hex' ../../../common/mongoose.o:mongoose.c:(.text+0x1745): first defined here ../../../common/v7.o: In function cs_md5': v7.c:(.text+0x2e70): multiple definition ofcs_md5' ../../../common/mongoose.o:mongoose.c:(.text+0x17c6): first defined here ../../../common/v7.o: In function cs_sha1_transform': v7.c:(.text+0x305e): multiple definition ofcs_sha1_transform' ../../../common/mongoose.o:mongoose.c:(.text+0x2092): first defined here ../../../common/v7.o: In function cs_sha1_init': v7.c:(.text+0x449c): multiple definition ofcs_sha1_init' ../../../common/mongoose.o:mongoose.c:(.text+0x34d0): first defined here ../../../common/v7.o: In function cs_sha1_update': v7.c:(.text+0x44f5): multiple definition ofcs_sha1_update' ../../../common/mongoose.o:mongoose.c:(.text+0x3529): first defined here ../../../common/v7.o: In function cs_sha1_final': v7.c:(.text+0x4629): multiple definition ofcs_sha1_final' ../../../common/mongoose.o:mongoose.c:(.text+0x365d): first defined here ../../../common/v7.o: In function cs_hmac_sha1': v7.c:(.text+0x474d): multiple definition ofcs_hmac_sha1' ../../../common/mongoose.o:mongoose.c:(.text+0x3781): first defined here ../../../common/slre.o: In function slre_match': slre.c:(.text+0x156c): multiple definition ofslre_match' ../../../common/v7.o:v7.c:(.text+0x2b8e0): first defined here

grodansparadis commented 7 years ago

Anyone that succeeded with this?

cpq commented 7 years ago

When compiling mongoose, specify -DEXCLUDE_COMMON flag.

grodansparadis commented 7 years ago

Thanks!