emscripten-core / emscripten-core/emscripten

emcc: error: undefined exported symbol: "_logBuffer" [-Wundefined] [-Werror]

Open
#19,710 3 comments 1 reaction 0 assignees View on GitHub
Dominant language
C++
Stars
27.6k
Forks
3.6k
Avg merge
1d 1h
Merged PRs (30d)
105

Description

I try to export some C++ function into wasm so that I can use it in web
any tips to troubleshoot this problem

**Version of emscripten/emsdk:**

emcc -v
emcc (Emscripten gcc/clang-like replacement + linker emulating GNU ld) 3.1.37 (d02c29f95e9e68f2f50c2b0432c56a671814d5c8)
clang version 17.0.0 (https://github.com/llvm/llvm-project 86339ef088e9aac6cf52cf9022d7a5bd144d4c42)
Target: wasm32-unknown-emscripten
Thread model: posix

**Failing command line in full:**

emcc libiscrypt.a -s EXPORTED_FUNCTIONS="['_logBuffer']" -o test.html
emcc: warning: libiscrypt.a: archive is missing an index; Use emar when creating libraries to ensure an index is created [-Wemcc]
emcc: warning: libiscrypt.a: adding index [-Wemcc]
cache:INFO: generating system asset: symbol_lists/e4e80e56fde68f702424e267726dc300ef1ab1fa.json... (this will be cached in "/Users/yujie_wu/Documents/study/emsdk/upstream/emscripten/cache/symbol_lists/e4e80e56fde68f702424e267726dc300ef1ab1fa.json" for subsequent builds)
cache:INFO: - ok
emcc: error: undefined exported symbol: "_logBuffer" [-Wundefined] [-Werror]

when I use nm to check the whole symbol_list
nm libiscrypt.a
I can find __logBuffer
I have tried _logBuffer __logBuffer logBuffer
none succeed!

**Full link command and output with `-v` appended:**

I try to export some C++ function into wasm so that I can use it in web
any tips to troubleshoot this problem

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.