Comments (6)
Can you share a little more about what is contained in main.cpp
? What files are being included in what order?
from emscripten.
It looks like maybe you have your own copy of stddef.h
in the include
directory which conflicts with emscripten's version.
include\stddef.h:437:3: error: typedef redefinition with different types ('struct max_align_t' vs 'struct max_align_t')
437 | } max_align_t;
Any idea why include\stddef.h
exists or where it comes from?
from emscripten.
Thanks for your answers. I don't include stddef.h directly from main.cpp but there appear some include statements in some of the files that are themselves directly or indirectly included in main.cpp. I'm just puzzled at the error message that says "('struct max_align_t' vs 'struct max_align_t')" because for me these two type definitions are identical and therefore they should not pose a problem.
from emscripten.
Apparently the includes appear in these files:
In file included from C:\Projects\levasoft\emsdk\upstream\emscripten\cache\sysroot/include/c++/v1\fstream:182:
In file included from C:\Projects\levasoft\emsdk\upstream\emscripten\cache\sysroot/include/c++/v1__algorithm/max.h:14:
In file included from C:\Projects\levasoft\emsdk\upstream\emscripten\cache\sysroot/include/c++/v1__algorithm/max_element.h:15:
In file included from C:\Projects\levasoft\emsdk\upstream\emscripten\cache\sysroot/include/c++/v1__iterator/iterator_traits.h:14:
In file included from C:\Projects\levasoft\emsdk\upstream\emscripten\cache\sysroot/include/c++/v1__concepts/constructible.h:12:
In file included from C:\Projects\levasoft\emsdk\upstream\emscripten\cache\sysroot/include/c++/v1__concepts/convertible_to.h:13:
In file included from C:\Projects\levasoft\emsdk\upstream\emscripten\cache\sysroot/include/c++/v1__type_traits/is_convertible.h:14:
In file included from C:\Projects\levasoft\emsdk\upstream\emscripten\cache\sysroot/include/c++/v1__type_traits/is_array.h:14:
In file included from C:\Projects\levasoft\emsdk\upstream\emscripten\cache\sysroot/include/c++/v1\cstddef:43:
So all of these files are files that come along with emscripten, that's why my problem is related to emscripten. It's really strange IMHO and I wonder whether maybe some compiler flags have to be set to solve it.
from emscripten.
The error message says that you have a typedef of max_align_t
in your include\stddef.h
that is different to emscripten's typedef.
It almost impossible to avoiding including stddef.h
so that problem is not that its being included but that the wrong copy is being include (i.e. the one from your project).
Can you see what the definition on line 437 of your include\stddef.h
file says?
My advice you would remove that include\stddef.h
completely, or the remove the -Iinclude
flag which causes it to be included.
from emscripten.
OK, I noticed that indeed I made copies of the include files, which I have now removed and now I no longer get the error message. Thanks!
from emscripten.
Related Issues (20)
- Any example to compile a project via emscripten and use it in wasmtime? HOT 10
- In `-sMODULARIZE` mode the `moduleArg` should not be modified in place
- Bind error of getting a pointer property in class
- Make mimalloc headers accessible HOT 2
- lto2.test_embind_i64_val is failing
- evaluation of std::sin in C++ is slower than in JS directly HOT 3
- [CXX1429] error when building with cmake using HOT 1
- Bug: when compiling executable, emcc "forgets" provided needed library HOT 8
- [WASMFS] FileSystemHandle.move causes OPFS to fail in Chrome HOT 1
- NODEFS not compatible with Deno when used through Pyodide HOT 4
- Unification for async APIs for the header file emscripten.h
- Unification for async APIs for the header file HTML5.h
- Unification for async APIs for the header file proxying.h
- Unification for async APIs for the header file Val.h
- Unification for async APIs for the header file Fetch.h
- Unification for async APIs for the header file webaudio.h
- 256-bit AVX intrinsics support HOT 1
- 'emcc' is not recognized as an internal or external command, operable program or batch file. HOT 2
- Multiple main function definitions can cause runtime error in chrome and crash renderer process in electron HOT 8
- Cannot convert 1698917542 to a BigInt HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from emscripten.