简体   繁体   English

“emcc”命令无法识别

[英]"emcc" command does not recognized

I'm having issue with building this demo.我在构建此演示时遇到问题。 https://github.com/kakukogou/opencvjs_demo_segmentation https://github.com/kakukogou/opencvjs_demo_segmentation

When i cd into this folder and run make command i get this error message:当我 cd 进入此文件夹并运行 make 命令时,我收到此错误消息:

/bin/sh: 1: emcc: not found  
make: *** [segmentation] Error 127

This is how make file looks like.这就是make文件的样子。

segmentation: ../src/segmentation.cpp ../src/export.cpp  
    mkdir -p $(OBJDIR)  
    emcc \  
    ../src/segmentation.cpp \  
    ../src/export.cpp \  
    -I $(OPENCV_INSTALL_DIR)/include \  
    $(OPENCV_INSTALL_DIR)/lib/libopencv_core.so \   
    $(OPENCV_INSTALL_DIR)/lib/libopencv_imgproc.so \  
    -s EXPORTED_FUNCTIONS="['_on_mouse', '_on_init', '_on_process']" \  
    -O3 \  
    --llvm-lto 1 \  
    --closure 1 \  
    -s PRECISE_F32=1 \  
    -s FORCE_ALIGNED_MEMORY=1 \  
    -s TOTAL_MEMORY=306777216 \  
    -o ./bin/segmentation.js  

clean:  
    rm ./bin/*.js ./bin/*.mem  

Is there any issue with my environment variables.我的环境变量有什么问题吗? What is the proper way to compile this ?编译这个的正确方法是什么?

For whatever reason default path configurations in .emscripten does not enable emcc in terminal.无论出于何种原因, .emscripten中的默认路径配置都不会在终端中启用 emcc。 so i manually set the EMSCRIPTEN_ROOT in /etc/environment and now it recognizes the emcc command in terminal.所以我在/etc/environment中手动设置了 EMSCRIPTEN_ROOT,现在它可以识别终端中的 emcc 命令。

对于 Windows,在“emsdk”文件夹(从“git clone https://github.com/emscripten-core/emsdk.git ”下载)运行:

./emsdk activate latest --permanent

this works for me这对我有用
adding添加
source ./emsdk_env.sh to .bashrc or .zshrc file source ./emsdk_env.sh.bashrc.zshrc文件

Encounter same problem in window 11窗口 11中遇到同样的问题

In my case there was problem with path of EMSDK就我而言, EMSDK的路径存在问题

After running emsdk_env.bat运行emsdk_env.bat

I have check path in environment variable and I found it was E:/emsdk我检查了环境变量中的路径,发现它是E:/emsdk

Then I have changed it to E:\emsdk然后我把它改成了E:\emsdk

Now working fine for me现在对我来说很好

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM