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

Undefined C++ API symbols #3754

Open
ashtonmeuser opened this issue Apr 7, 2023 · 5 comments
Open

Undefined C++ API symbols #3754

ashtonmeuser opened this issue Apr 7, 2023 · 5 comments
Labels
📦 lib-c-api About wasmer-c-api 🕵️ needs investigation The issue/PR needs further investigation priority-medium Medium priority issue

Comments

@ashtonmeuser
Copy link
Contributor

Describe the bug

Wasmer static lib does not seem to contain C++ symbols.

#include "wasm.hh"

inf main() {
  auto engine = wasm::Engine::make();
}
g++ -o src/mylib.os -c -std=c++17 -arch x86_64 -g -O3 -fPIC -I. -Iwasmer/include src/mylib.cpp
g++ -o mylib.dylib -arch x86_64 -framework Security -dynamiclib src/mylib.os wasmer/lib/libwasmer.a

Produces the following error.

Undefined symbols for architecture x86_64:
  "wasm::Config::make()", referenced from:
      ... in mylib.os
  "wasm::Config::~Config()", referenced from:
      ... in mylib.os
  "wasm::Config::operator delete(void*)", referenced from:
      ... in mylib.os
  "wasm::Engine::make(std::__1::unique_ptr<wasm::Config, std::__1::default_delete<wasm::Config> >&&)", referenced from:
      ... in mylib.os
  "wasm::Engine::~Engine()", referenced from:
      ... in mylib.os
  "wasm::Engine::operator delete(void*)", referenced from:
      ... in mylib.os
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

Steps to reproduce

  1. Use Wasm C++ API e.g. wasm::Engine::make()
  2. Compile
  3. Link Wasmer lib

Expected behavior

Wasm C++ API is usable and symbols are defined in libwasmer.a.

Actual behavior

Wasm C++ symbols are undefined in libwasmer.a.

@Michael-F-Bryan
Copy link
Contributor

Thanks for letting us know about this @ashtonmeuser! This seems like a regression in what goes into our libwasmer.a. For the meantime, you should be able to use the C API.

@Michael-F-Bryan Michael-F-Bryan added 🕵️ needs investigation The issue/PR needs further investigation 📦 lib-c-api About wasmer-c-api priority-medium Medium priority issue labels Apr 11, 2023
Copy link

stale bot commented Apr 11, 2024

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the 🏚 stale Inactive issues or PR label Apr 11, 2024
@pterror
Copy link

pterror commented Apr 15, 2024

(this is still an issue over one year later btw)

@stale stale bot removed the 🏚 stale Inactive issues or PR label Apr 15, 2024
@benrussell
Copy link

+1

@jecluis
Copy link

jecluis commented Aug 17, 2024

I'd love this fixed too.

Alternatively, any chance someone could give me the gist of how these symbols should be produced? I'm happy to attempt a fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
📦 lib-c-api About wasmer-c-api 🕵️ needs investigation The issue/PR needs further investigation priority-medium Medium priority issue
Projects
None yet
Development

No branches or pull requests

5 participants