Coder Social home page Coder Social logo

Comments (6)

sbc100 avatar sbc100 commented on May 31, 2024

Can you share a little more about what is contained in main.cpp? What files are being included in what order?

from emscripten.

sbc100 avatar sbc100 commented on May 31, 2024

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.

adokhugi avatar adokhugi commented on May 31, 2024

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.

adokhugi avatar adokhugi commented on May 31, 2024

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.

sbc100 avatar sbc100 commented on May 31, 2024

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.

adokhugi avatar adokhugi commented on May 31, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.