Closed Traveller23 closed 7 months ago
After I updated Emscripten to the latest version, there are more errors:
$ make
em++ -Wall -Wformat -Os -I../ -c -o imgui.o ../imgui.cpp
shared:INFO: (Emscripten: Running sanity checks)
em++ -Wall -Wformat -Os -I../ -c -o imgui_draw.o ../imgui_draw.cpp
em++ -Wall -Wformat -Os -I../ -c -o imgui_tables.o ../imgui_tables.cpp
em++ -Wall -Wformat -Os -I../ -c -o imgui_widgets.o ../imgui_widgets.cpp
em++ -Wall -Wformat -Os -I../ -c -o bind-imgui.o bind-imgui.cpp
bind-imgui.cpp:2420:30: error: no viable overloaded '='
2420 | _out_text[0] = emscripten::val(ctx->_ImGui_Combo_text);
| ~~~~~~~~~~~~ ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
bind-imgui.cpp:18:52: note: expanded from macro 'FUNCTION'
18 | emscripten::optional_override([] ARGS -> RET { CODE })
| ^~~~
bind-imgui.cpp:18:52: note: expanded from macro 'FUNCTION'
18 | emscripten::optional_override([] ARGS -> RET { CODE })
| ^~~~
C:\Libraries\emsdk\upstream\emscripten\cache\sysroot/include\emscripten/val.h:415:8: note: candidate function not viable: expects an lvalue for object argument
415 | val& operator=(val&& v) & {
| ^
C:\Libraries\emsdk\upstream\emscripten\cache\sysroot/include\emscripten/val.h:425:8: note: candidate function not viable: expects an lvalue for object argument
425 | val& operator=(const val& v) & {
| ^
bind-imgui.cpp:2825:30: error: no viable overloaded '='
2825 | _out_text[0] = emscripten::val(ctx->_ImGui_ListBox_B_text);
| ~~~~~~~~~~~~ ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
bind-imgui.cpp:18:52: note: expanded from macro 'FUNCTION'
18 | emscripten::optional_override([] ARGS -> RET { CODE })
| ^~~~
bind-imgui.cpp:18:52: note: expanded from macro 'FUNCTION'
18 | emscripten::optional_override([] ARGS -> RET { CODE })
| ^~~~
C:\Libraries\emsdk\upstream\emscripten\cache\sysroot/include\emscripten/val.h:415:8: note: candidate function not viable: expects an lvalue for object argument
415 | val& operator=(val&& v) & {
| ^
C:\Libraries\emsdk\upstream\emscripten\cache\sysroot/include\emscripten/val.h:425:8: note: candidate function not viable: expects an lvalue for object argument
425 | val& operator=(const val& v) & {
| ^
C:\Libraries\emsdk\upstream\emscripten\cache\sysroot/include\emscripten/val.h:226:20: error: assigning to 'void *' from 'const ImVec2 *' discards qualifiers
226 | cursor->w[0].p = wt;
| ^~
C:\Libraries\emsdk\upstream\emscripten\cache\sysroot/include\emscripten/val.h:248:3: note: in instantiation of function template specialization 'emscripten::internal::writeGenericWireType<const ImVec2>'
requested here
248 | writeGenericWireType(cursor, BindingType<First>::toWireType(std::forward<First>(first)));
| ^
C:\Libraries\emsdk\upstream\emscripten\cache\sysroot/include\emscripten/val.h:256:5: note: in instantiation of function template specialization 'emscripten::internal::writeGenericWireTypes<const ImVec2 *&>'
requested here
256 | writeGenericWireTypes(cursor, std::forward<Args>(args)...);
| ^
C:\Libraries\emsdk\upstream\emscripten\cache\sysroot/include\emscripten/val.h:389:21: note: in instantiation of member function 'emscripten::internal::WireTypePack<const ImVec2 *&>::WireTypePack' requested here
389 | WireTypePack<T> argv(std::forward<T>(value));
| ^
bind-imgui.cpp:625:9: note: in instantiation of function template specialization 'emscripten::val::val<const ImVec2 *&>' requested here
625 | CLASS_MEMBER_GET_RAW_REFERENCE(ImGuiSizeCallbackData, Pos)
| ^
bind-imgui.cpp:48:39: note: expanded from macro 'CLASS_MEMBER_GET_RAW_REFERENCE'
48 | auto p = &that.MEMBER; return emscripten::val(p); \
| ^
In file included from bind-imgui.cpp:15:
In file included from C:\Libraries\emsdk\upstream\emscripten\cache\sysroot/include\emscripten/bind.h:23:
C:\Libraries\emsdk\upstream\emscripten\cache\sysroot/include\emscripten/val.h:226:20: error: assigning to 'void *' from 'const ImGuiTableColumnSortSpecs *' discards qualifiers
226 | cursor->w[0].p = wt;
| ^~
C:\Libraries\emsdk\upstream\emscripten\cache\sysroot/include\emscripten/val.h:248:3: note: in instantiation of function template specialization 'emscripten::internal::writeGenericWireType<const
ImGuiTableColumnSortSpecs>' requested here
248 | writeGenericWireType(cursor, BindingType<First>::toWireType(std::forward<First>(first)));
| ^
C:\Libraries\emsdk\upstream\emscripten\cache\sysroot/include\emscripten/val.h:256:5: note: in instantiation of function template specialization 'emscripten::internal::writeGenericWireTypes<const
ImGuiTableColumnSortSpecs *&>' requested here
256 | writeGenericWireTypes(cursor, std::forward<Args>(args)...);
| ^
C:\Libraries\emsdk\upstream\emscripten\cache\sysroot/include\emscripten/val.h:389:21: note: in instantiation of member function 'emscripten::internal::WireTypePack<const ImGuiTableColumnSortSpecs
*&>::WireTypePack' requested here
389 | WireTypePack<T> argv(std::forward<T>(value));
| ^
bind-imgui.cpp:667:20: note: in instantiation of function template specialization 'emscripten::val::val<const ImGuiTableColumnSortSpecs *&>' requested here
667 | return emscripten::val(spec);
| ^
In file included from bind-imgui.cpp:15:
In file included from C:\Libraries\emsdk\upstream\emscripten\cache\sysroot/include\emscripten/bind.h:23:
C:\Libraries\emsdk\upstream\emscripten\cache\sysroot/include\emscripten/val.h:226:20: error: assigning to 'void *' from 'const ImVec4 *' discards qualifiers
226 | cursor->w[0].p = wt;
| ^~
C:\Libraries\emsdk\upstream\emscripten\cache\sysroot/include\emscripten/val.h:248:3: note: in instantiation of function template specialization 'emscripten::internal::writeGenericWireType<const ImVec4>'
requested here
248 | writeGenericWireType(cursor, BindingType<First>::toWireType(std::forward<First>(first)));
| ^
C:\Libraries\emsdk\upstream\emscripten\cache\sysroot/include\emscripten/val.h:256:5: note: in instantiation of function template specialization 'emscripten::internal::writeGenericWireTypes<const ImVec4 *&>'
requested here
256 | writeGenericWireTypes(cursor, std::forward<Args>(args)...);
| ^
C:\Libraries\emsdk\upstream\emscripten\cache\sysroot/include\emscripten/val.h:389:21: note: in instantiation of member function 'emscripten::internal::WireTypePack<const ImVec4 *&>::WireTypePack' requested here
389 | WireTypePack<T> argv(std::forward<T>(value));
| ^
bind-imgui.cpp:682:9: note: in instantiation of function template specialization 'emscripten::val::val<const ImVec4 *&>' requested here
682 | CLASS_MEMBER_GET_RAW_REFERENCE(ImDrawCmd, ClipRect)
| ^
bind-imgui.cpp:48:39: note: expanded from macro 'CLASS_MEMBER_GET_RAW_REFERENCE'
48 | auto p = &that.MEMBER; return emscripten::val(p); \
| ^
In file included from bind-imgui.cpp:15:
In file included from C:\Libraries\emsdk\upstream\emscripten\cache\sysroot/include\emscripten/bind.h:23:
C:\Libraries\emsdk\upstream\emscripten\cache\sysroot/include\emscripten/val.h:226:20: error: assigning to 'void *' from 'const ImDrawCmd *' discards qualifiers
226 | cursor->w[0].p = wt;
| ^~
C:\Libraries\emsdk\upstream\emscripten\cache\sysroot/include\emscripten/val.h:248:3: note: in instantiation of function template specialization 'emscripten::internal::writeGenericWireType<const ImDrawCmd>'
requested here
248 | writeGenericWireType(cursor, BindingType<First>::toWireType(std::forward<First>(first)));
| ^
C:\Libraries\emsdk\upstream\emscripten\cache\sysroot/include\emscripten/val.h:256:5: note: in instantiation of function template specialization 'emscripten::internal::writeGenericWireTypes<const ImDrawCmd *&>'
requested here
256 | writeGenericWireTypes(cursor, std::forward<Args>(args)...);
| ^
C:\Libraries\emsdk\upstream\emscripten\cache\sysroot/include\emscripten/val.h:389:21: note: in instantiation of member function 'emscripten::internal::WireTypePack<const ImDrawCmd *&>::WireTypePack' requested
here
389 | WireTypePack<T> argv(std::forward<T>(value));
| ^
bind-imgui.cpp:694:26: note: in instantiation of function template specialization 'emscripten::val::val<const ImDrawCmd *&>' requested here
694 | callback(emscripten::val(pcmd), emscripten::val(ElemStart));
| ^
In file included from bind-imgui.cpp:15:
In file included from C:\Libraries\emsdk\upstream\emscripten\cache\sysroot/include\emscripten/bind.h:23:
C:\Libraries\emsdk\upstream\emscripten\cache\sysroot/include\emscripten/val.h:226:20: error: assigning to 'void *' from 'const ImDrawList *' discards qualifiers
226 | cursor->w[0].p = wt;
| ^~
C:\Libraries\emsdk\upstream\emscripten\cache\sysroot/include\emscripten/val.h:248:3: note: in instantiation of function template specialization 'emscripten::internal::writeGenericWireType<const ImDrawList>'
requested here
248 | writeGenericWireType(cursor, BindingType<First>::toWireType(std::forward<First>(first)));
| ^
C:\Libraries\emsdk\upstream\emscripten\cache\sysroot/include\emscripten/val.h:256:5: note: in instantiation of function template specialization 'emscripten::internal::writeGenericWireTypes<const ImDrawList *&>'
requested here
256 | writeGenericWireTypes(cursor, std::forward<Args>(args)...);
| ^
C:\Libraries\emsdk\upstream\emscripten\cache\sysroot/include\emscripten/val.h:389:21: note: in instantiation of member function 'emscripten::internal::WireTypePack<const ImDrawList *&>::WireTypePack' requested
here
389 | WireTypePack<T> argv(std::forward<T>(value));
| ^
bind-imgui.cpp:953:26: note: in instantiation of function template specialization 'emscripten::val::val<const ImDrawList *&>' requested here
953 | callback(emscripten::val(cmd_list));
| ^
In file included from bind-imgui.cpp:15:
In file included from C:\Libraries\emsdk\upstream\emscripten\cache\sysroot/include\emscripten/bind.h:23:
C:\Libraries\emsdk\upstream\emscripten\cache\sysroot/include\emscripten/val.h:226:20: error: assigning to 'void *' from 'const ImFontGlyph *' discards qualifiers
226 | cursor->w[0].p = wt;
| ^~
C:\Libraries\emsdk\upstream\emscripten\cache\sysroot/include\emscripten/val.h:248:3: note: in instantiation of function template specialization 'emscripten::internal::writeGenericWireType<const ImFontGlyph>'
requested here
248 | writeGenericWireType(cursor, BindingType<First>::toWireType(std::forward<First>(first)));
| ^
C:\Libraries\emsdk\upstream\emscripten\cache\sysroot/include\emscripten/val.h:256:5: note: in instantiation of function template specialization 'emscripten::internal::writeGenericWireTypes<const ImFontGlyph *&>'
requested here
256 | writeGenericWireTypes(cursor, std::forward<Args>(args)...);
| ^
C:\Libraries\emsdk\upstream\emscripten\cache\sysroot/include\emscripten/val.h:389:21: note: in instantiation of member function 'emscripten::internal::WireTypePack<const ImFontGlyph *&>::WireTypePack' requested
here
389 | WireTypePack<T> argv(std::forward<T>(value));
| ^
bind-imgui.cpp:1216:62: note: in instantiation of function template specialization 'emscripten::val::val<const ImFontGlyph *&>' requested here
1216 | return glyph == NULL ? emscripten::val::null() : emscripten::val(glyph);
| ^
In file included from bind-imgui.cpp:15:
In file included from C:\Libraries\emsdk\upstream\emscripten\cache\sysroot/include\emscripten/bind.h:23:
C:\Libraries\emsdk\upstream\emscripten\cache\sysroot/include\emscripten/val.h:239:20: error: static_cast from 'const ImVec2 *' to 'unsigned int' is not allowed
239 | cursor->w[0].u = static_cast<unsigned>(wt);
| ^~~~~~~~~~~~~~~~~~~~~~~~~
C:\Libraries\emsdk\upstream\emscripten\cache\sysroot/include\emscripten/val.h:248:3: note: in instantiation of function template specialization 'emscripten::internal::writeGenericWireType<const ImVec2 *>'
requested here
248 | writeGenericWireType(cursor, BindingType<First>::toWireType(std::forward<First>(first)));
| ^
C:\Libraries\emsdk\upstream\emscripten\cache\sysroot/include\emscripten/val.h:256:5: note: in instantiation of function template specialization
'emscripten::internal::writeGenericWireTypes<const ImVec2 *const &>' requested here
256 | writeGenericWireTypes(cursor, std::forward<Args>(args)...);
| ^
C:\Libraries\emsdk\upstream\emscripten\cache\sysroot/include\emscripten/val.h:389:21: note: in instantiation of member function 'emscripten::internal::WireTypePack<const ImVec2 *const &>::WireTypePack' requested
here
389 | WireTypePack<T> argv(std::forward<T>(value));
| ^
bind-imgui.cpp:1825:70: note: in instantiation of function template specialization 'emscripten::val::val<const ImVec2 *const &>' requested here
1825 | const auto p = &that->MouseClickedPos[index]; return emscripten::val(p);
| ^
In file included from bind-imgui.cpp:15:
In file included from C:\Libraries\emsdk\upstream\emscripten\cache\sysroot/include\emscripten/bind.h:23:
C:\Libraries\emsdk\upstream\emscripten\cache\sysroot/include\emscripten/val.h:226:20: error: assigning to 'void *' from 'const ImRect *' discards qualifiers
226 | cursor->w[0].p = wt;
| ^~
C:\Libraries\emsdk\upstream\emscripten\cache\sysroot/include\emscripten/val.h:248:3: note: in instantiation of function template specialization 'emscripten::internal::writeGenericWireType<const ImRect>'
requested here
248 | writeGenericWireType(cursor, BindingType<First>::toWireType(std::forward<First>(first)));
| ^
C:\Libraries\emsdk\upstream\emscripten\cache\sysroot/include\emscripten/val.h:256:5: note: in instantiation of function template specialization 'emscripten::internal::writeGenericWireTypes<const ImRect *&>'
requested here
256 | writeGenericWireTypes(cursor, std::forward<Args>(args)...);
| ^
C:\Libraries\emsdk\upstream\emscripten\cache\sysroot/include\emscripten/val.h:389:21: note: in instantiation of member function 'emscripten::internal::WireTypePack<const ImRect *&>::WireTypePack' requested here
389 | WireTypePack<T> argv(std::forward<T>(value));
| ^
bind-imgui.cpp:3315:5: note: in instantiation of function template specialization 'emscripten::val::val<const ImRect *&>' requested here
3315 | CLASS_MEMBER_GET_RAW_REFERENCE(ImGuiInputTextState, FrameBB)
| ^
bind-imgui.cpp:48:39: note: expanded from macro 'CLASS_MEMBER_GET_RAW_REFERENCE'
48 | auto p = &that.MEMBER; return emscripten::val(p); \
| ^
In file included from bind-imgui.cpp:15:
In file included from C:\Libraries\emsdk\upstream\emscripten\cache\sysroot/include\emscripten/bind.h:23:
C:\Libraries\emsdk\upstream\emscripten\cache\sysroot/include\emscripten/val.h:226:20: error: assigning to 'void *' from 'ImGuiWindow *const *' discards qualifiers
226 | cursor->w[0].p = wt;
| ^~
C:\Libraries\emsdk\upstream\emscripten\cache\sysroot/include\emscripten/val.h:248:3: note: in instantiation of function template specialization 'emscripten::internal::writeGenericWireType<ImGuiWindow *const>'
requested here
248 | writeGenericWireType(cursor, BindingType<First>::toWireType(std::forward<First>(first)));
| ^
C:\Libraries\emsdk\upstream\emscripten\cache\sysroot/include\emscripten/val.h:256:5: note: in instantiation of function template specialization
'emscripten::internal::writeGenericWireTypes<ImGuiWindow *const *&>' requested here
256 | writeGenericWireTypes(cursor, std::forward<Args>(args)...);
| ^
C:\Libraries\emsdk\upstream\emscripten\cache\sysroot/include\emscripten/val.h:389:21: note: in instantiation of member function 'emscripten::internal::WireTypePack<ImGuiWindow *const *&>::WireTypePack' requested
here
389 | WireTypePack<T> argv(std::forward<T>(value));
| ^
bind-imgui.cpp:3362:5: note: in instantiation of function template specialization 'emscripten::val::val<ImGuiWindow *const *&>' requested here
3362 | CLASS_MEMBER_GET_RAW_REFERENCE(ImGuiWindow, ParentWindow)
| ^
bind-imgui.cpp:48:39: note: expanded from macro 'CLASS_MEMBER_GET_RAW_REFERENCE'
48 | auto p = &that.MEMBER; return emscripten::val(p); \
| ^
11 errors generated.
em++: error: 'C:/Libraries/emsdk/upstream/bin\clang++.exe -target wasm32-unknown-emscripten -fignore-exceptions -fvisibility=default -mllvm -combiner-global-alias-analysis=false -mllvm -enable-emscripten-sjlj -m
llvm -disable-lsr -DEMSCRIPTEN --sysroot=C:\Libraries\emsdk\upstream\emscripten\cache\sysroot -Xclang -iwithsysroot/include\fakesdl -Xclang -iwithsysroot/include\compat -Wall -Wformat -Os -I../ -c bind-imgui.cpp
-o bind-imgui.o' failed (returned 1)
make: *** [makefile:28: bind-imgui.o] Error 1
$ em++ --version
emcc (Emscripten gcc/clang-like replacement + linker emulating GNU ld) 3.1.45 (ef3e4e3b044de98e1811546e0bc605c65d3412f4)
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.
here is my environment: msys64
# em++ --version
emcc (Emscripten gcc/clang-like replacement + linker emulating GNU ld) 2.0.26 (5af6a110ee58ca4a6885fbcad830c92207fefea2)
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.
zho@P01247 MINGW64 /d/hg/imgui-ts/imgui/embind
# make
em++ -Wall -Wformat -Os -I../ -c -o imgui.o ../imgui.cpp
em++ -Wall -Wformat -Os -I../ -c -o imgui_draw.o ../imgui_draw.cpp
em++ -Wall -Wformat -Os -I../ -c -o imgui_tables.o ../imgui_tables.cpp
em++ -Wall -Wformat -Os -I../ -c -o imgui_widgets.o ../imgui_widgets.cpp
em++ -Wall -Wformat -Os -I../ -c -o bind-imgui.o bind-imgui.cpp
em++ -Wall -Wformat -Os -I../ -c -o imgui_user.o ../imgui_user.cpp
In file included from ../imgui_user.cpp:9:
../imgui_demo.cpp:5698:15: warning: address of array 'font->ConfigData' will always evaluate to
'true' [-Wpointer-bool-conversion]
font->ConfigData ? font->ConfigData[0].Name : "", font->FontSize, font->Glyphs.Size...
~~~~~~^~~~~~~~~~ ~
../imgui_demo.cpp:5719:19: warning: address of array 'font->ConfigData' will always evaluate to
'true' [-Wpointer-bool-conversion]
if (font->ConfigData)
~~ ~~~~~~^~~~~~~~~~
2 warnings generated.
emcc -I../ --bind -o ../../src/bind-imgui.js imgui.o imgui_draw.o imgui_tables.o imgui_widgets.o bind-imgui.o imgui_user.o -s ALLOW_MEMORY_GROWTH=1 -s WASM=1 -s DISABLE_EXCEPTION_CATCHING=1 -s NO_EXIT_RUNTIME=0 -s ASSERTIONS=1 -s FILESYSTEM=0 -DIMGUI_DISABLE_FILE_FUNCTIONS -s EMBIND_STD_STRING_IS_UTF8=1 -s SINGLE_FILE=1 -s MODULARIZE=1 -s ENVIRONMENT=web
@zhobo63 Thanks, I'll try again sometime.
Thanks, 2.0.26 emscripten worked.
I installed Emscripten and compiled the cpp files as follows:
The output is:
imgui-ts version:
em++ version: