emscripten-core / emscripten

Emscripten: An LLVM-to-WebAssembly Compiler
Other
25.76k stars 3.3k forks source link

shared:ERROR: Js/ExternPost_Compiled.js: Input file has an unknown suffix, don't know what to do with it! #11664

Closed Satancito closed 4 years ago

Satancito commented 4 years ago

Compile.ps1

em++.bat `
main.cpp `
Inse.bc `
-I ../CppInclude `
-I Include `
-o Libzz.js `
-std=c++17 `
--bind `
-s WASM=1 `
-s DISABLE_EXCEPTION_CATCHING=0 `
-s SINGLE_FILE=1 `
-s ASYNCIFY=1 `
-s VERBOSE=0 `
-O2 `
-s EXPORT_NAME=`'CreateModuleInstance`' `
-s MODULARIZE=1 `
-s ASYNCIFY_IMPORTS=[] `
-s EXPORTED_FUNCTIONS=[`'_main`'] `
-s EXTRA_EXPORTED_RUNTIME_METHODS=[`'ccall`',`'cwrap`',`'lengthBytesUTF8`',`'stringToUTF8`'] `
--pre-js "Js/Pre_Compiled.js" `
--post-js "Js/Post_Compiled.js" `
--extern-pre-js "Js/ExternPre_Compiled.js" `
--extern-post-js "Js/ExternPost_Compiled.js" `

When compile, it shows this error image shared:ERROR: Js/ExternPre_Compiled.js: Input file has an unknown suffix, don't know what to do with it!

The problem The compiler options --extern-post-js --extern-pre-js both have same error.

I changed js files to root directory of project. Same error. I change to lowercase filenames and without special chars, same error as: image image image

I checked the filenames, they are existing. image

sbc100 commented 4 years ago

What version of emscripten are you using (emcc --version)

Most likely you are using a version older than 1.39.15 where these flags are not supported.

Satancito commented 4 years ago
PS C:\Users\Megam> em++ --version
emcc (Emscripten gcc/clang-like replacement) 1.39.11
Copyright (C) 2014 the Emscripten authors (see AUTHORS.txt)
This is free and open source software under the MIT license.
There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
sbc100 commented 4 years ago

Yup, you need 1.39.15 or above to use those flags

Satancito commented 4 years ago

Updating...

Satancito commented 4 years ago

No errors. Thanks a lot @sbc100.