错误:未定义符号:gzclose opencv脚本

时间:2019-12-07 12:39:30

标签: c++ opencv emscripten

当我尝试使用以下命令编译OpenCV代码时,出现错误。

命令 sudo /home/xyz/emsdk/upstream/emscripten/em++ ./test_wasm.cpp -s WASM=1 -I/usr/local/include/opencv4/ -L/home/xyz/opencv/build_wasm/lib -llibopencv_core -llibopencv_calib3d -llibopencv_imgproc -llibopencv_photo -llibopencv_flann -llibopencv_features2d -o test_wasm/test_wasm.html -s ALLOW_MEMORY_GROWTH=1 -s EXPORTED_FUNCTIONS='["_image_input"]' -s "EXTRA_EXPORTED_RUNTIME_METHODS=['ccall', 'cwrap']" -std=c++11 -s DISABLE_EXCEPTION_CATCHING=0

错误

error: undefined symbol: gzclose
warning: To disable errors for undefined symbols use `-s ERROR_ON_UNDEFINED_SYMBOLS=0`
error: undefined symbol: gzeof
error: undefined symbol: gzgets
error: undefined symbol: gzopen
error: undefined symbol: gzputs
error: undefined symbol: gzrewind
Error: Aborting compilation due to previous errors
shared:ERROR: '/home/xyz/emsdk/node/12.9.1_64bit/bin/node /home/xyz/emsdk/upstream/emscripten/src/compiler.js /tmp/tmptCnzix.txt' failed (1)

其他信息 Ubuntu 18.4,Opencv 4.1

1 个答案:

答案 0 :(得分:0)

添加zlib后,它可以正常工作。

-s USE_ZLIB=1