Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
Urkman opened this issue Jun 19, 2024 · 6 comments
Open

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

Urkman opened this issue Jun 19, 2024 · 6 comments

Comments

@Urkman
Copy link

Urkman commented Jun 19, 2024

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
Copy link
Member

0xTim commented Jun 19, 2024

Do you have libcurl-dev installed?

@Urkman
Copy link
Author

Urkman commented Jun 19, 2024

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
Copy link
Contributor

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

@ayush-yadav001
Copy link

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

@0xTim
Copy link
Member

0xTim commented Nov 20, 2024

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

@FranzBusch
Copy link
Contributor

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants