swift-server / swift-kafka-client

Apache License 2.0
83 stars 23 forks source link

Error while building on an Ubuntu Server within a vapor project #168

Open Urkman opened 5 months ago

Urkman commented 5 months ago

My project works fine on my Mac ()M2 MacBook. But when I try to build it on an Ubuntu Server I get this error:

In file included from /home/vapor/app/.build/checkouts/swift-kafka-client/Sources/Crdkafka/librdkafka/src/rdkafka_sasl_oauthbearer_oidc.c:35:
/home/vapor/app/.build/checkouts/swift-kafka-client/Sources/Crdkafka/librdkafka/src/rdkafka_int.h:34:9: warning: '_GNU_SOURCE' macro redefined [-Wmacro-redefined]
#define _GNU_SOURCE /* for strndup() */
        ^
<command line>:2:9: note: previous definition is here
#define _GNU_SOURCE 1
        ^
/home/vapor/app/.build/checkouts/swift-kafka-client/Sources/Crdkafka/librdkafka/src/rdkafka_sasl_oauthbearer_oidc.c:39:10: fatal error: 'curl/curl.h' file not found
#include <curl/curl.h>
         ^~~~~~~~~~~~~
1 warning and 1 error generated.
[3/670] Compiling rdkafka_sasl_oauthbearer_oidc.c

Any idea?

0xTim commented 5 months ago

Do you have libcurl-dev installed?

Urkman commented 5 months ago

Yes, that was missing. I also needed to install libsasl2-dev But now I get this:

Building for production...
error: link command failed with exit code 1 (use -v to see invocation)
/usr/bin/ld.gold: error: cannot find -lstdc++
/home/vapor/server-dev/.build/x86_64-unknown-linux-gnu/release/CNIOBoringSSL.build/ssl/d1_both.cc.o:d1_both.cc:function __clang_call_terminate: error: undefined reference to '__cxa_begin_catch'
/home/vapor/server-dev/.build/x86_64-unknown-linux-gnu/release/CNIOBoringSSL.build/ssl/d1_both.cc.o:d1_both.cc:function __clang_call_terminate: error: undefined reference to 'std::terminate()'
/home/vapor/server-dev/.build/x86_64-unknown-linux-gnu/release/CNIOBoringSSL.build/ssl/d1_both.cc.o:d1_both.cc:DW.ref.__gxx_personality_v0: error: undefined reference to '__gxx_personality_v0'
/home/vapor/server-dev/.build/x86_64-unknown-linux-gnu/release/CNIOBoringSSL.build/ssl/ssl_key_share.cc.o:ssl_key_share.cc:typeinfo for bssl::CNIOBoringSSL::(anonymous namespace)::ECKeyShare: error: undefined reference to 'vtable for __cxxabiv1::__si_class_type_info'
/usr/bin/ld.gold: the vtable symbol may be undefined because the class is missing its key function
/home/vapor/server-dev/.build/x86_64-unknown-linux-gnu/release/CNIOBoringSSL.build/ssl/ssl_key_share.cc.o:ssl_key_share.cc:typeinfo for bssl::CNIOBoringSSL::(anonymous namespace)::X25519KeyShare: error: undefined reference to 'vtable for __cxxabiv1::__si_class_type_info'
/usr/bin/ld.gold: the vtable symbol may be undefined because the class is missing its key function
/home/vaporserver-dev/.build/x86_64-unknown-linux-gnu/release/CNIOBoringSSL.build/ssl/ssl_key_share.cc.o:ssl_key_share.cc:typeinfo for bssl::CNIOBoringSSL::(anonymous namespace)::X25519Kyber768KeyShare: error: undefined reference to 'vtable for __cxxabiv1::__si_class_type_info'
/usr/bin/ld.gold: the vtable symbol may be undefined because the class is missing its key function
/home/vapor/server-dev/.build/x86_64-unknown-linux-gnu/release/CNIOBoringSSL.build/ssl/ssl_key_share.cc.o:ssl_key_share.cc:typeinfo for bssl::CNIOBoringSSL::SSLKeyShare: error: undefined reference to 'vtable for __cxxabiv1::__class_type_info'
/usr/bin/ld.gold: the vtable symbol may be undefined because the class is missing its key function
clang-13: error: linker command failed with exit code 1 (use -v to see invocation)
[1/2] Linking Run

Until adding this lib everything was working fine :(

FranzBusch commented 5 months ago

Are you building in a docker image? If so could you share your docker file?

ayush-yadav001 commented 2 days ago

@Urkman can you please post a solution for this , i am facing almost similar problem

0xTim commented 2 days ago

@ayush-yadav001 what's the error message? The above error looks like a memory issue

FranzBusch commented 2 days ago

@ayush-yadav001 could you also share how your are building?