Hello Floh,
My C++ files are in different packages like some files are inside folder1,
folder2, folder3 and folder4 and some are in parent directory (like abc.cpp
& def.cpp .......) as you can see in below screenshot. So when I ran the
emcc command I think emscripten compiler is confuse with C++ file path. So
how I specify C++ files name with respective folder.
*emcc -O3 --bind folder1/aa1.cpp aa2.cpp aa3.cpp aa4.cpp folder2/bb1.cpp
folder3/cc1.cpp folder4/dd4.cpp abc.cpp def.cpp -o script.js -s
ALLOW_MEMORY_GROWTH=1*
*when i ran the above command got issue -> **emcc: error: aa2.cpp: No such
file or directory ("aa2.cpp" was expected to be an input file, based on the
commandline arguments provided)*
[image: emscriptenDemo.png]
On Wednesday, 14 July 2021 at 19:45:22 UTC+5:30 Floh wrote:
> > but this technique is not working .
>
> That's strange, what errors are you seeing?
>
> On Wednesday, 14 July 2021 at 15:05:04 UTC+2 [email protected] wrote:
>
>> Thanks for you reply but this technique is not working .
>>
>> On Wednesday, 14 July 2021 at 17:31:00 UTC+5:30 Floh wrote:
>>
>>> The easiest way is to simply place all cpp files into one emcc call:
>>>
>>> emcc -O3 --bind filename1.cpp filename2.cpp ... -o script.js -s
>>> ALLOW_MEMORY_GROWTH=1
>>>
>>> The next step from this would be using a build tool like cmake or GNU
>>> Make, but that's probably overkill for your use case (unless you have
>>> dozens of source file).
>>>
>>> On Wednesday, 14 July 2021 at 12:21:42 UTC+2 [email protected] wrote:
>>>
>>>> Hello Guys,
>>>> I have multiple c++ classes in my android project. I successfully
>>>> converted these file in .wasm file with the help of emscripten so that i
>>>> can use it, one of my java script project . But to get WASM file, I used
>>>> to
>>>> compile one class at a time one by one then after create the webassembly
>>>> file through command (emcmdprompt). So i want to generate this Webassembly
>>>> file in one go. So please sugget that how i can generate.
>>>>
>>>> I have more that 10 CPP classes, and the Command which i used to
>>>> compile cpp class through "emcmdprompt" terminal one by one is
>>>>
>>>> *emcc -O3 --bind -c fileName1.cpp*
>>>> *emcc -O3 --bind -c fileName2.cpp*
>>>> *emcc -O3 --bind -c fileName3.cpp*
>>>> *.......*
>>>> *......*
>>>>
>>>> and once the object file created then again i run one more command on
>>>> "emcmdprompt" terminal to generate* .wasm* file
>>>>
>>>> *emcc -O3 --bind fileName1.o fileName2.o
>>>> fileName3.o -o script.js -s ALLOW_MEMORY_GROWTH=1*
>>>>
>>>> so please suggest how i can write all these command in single file and
>>>> run in one go, instead of manually running one by one.
>>>>
>>>> Thanks
>>>>
>>>>
--
You received this message because you are subscribed to the Google Groups
"emscripten-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/emscripten-discuss/12ec9eff-c28b-4864-bf3b-350c48e11580n%40googlegroups.com.