Giter VIP home page Giter VIP logo

Comments (4)

pezcode avatar pezcode commented on May 20, 2024

Try adding the compile flag to MagnumImGuiIntegration, but you'll need CMake 3.13 to modify targets created in a different directory.

Something like the following could work with older CMake versions:

set_source_files_properties("${IMGUI_DIR}/imgui.cpp"
    TARGET_DIRECTORY MagnumImGuiIntegration
    PROPERTIES COMPILE_DEFINITIONS $<$<CXX_COMPILER_ID:GNU>:__USE_MINGW_ANSI_STDIO=1>
)

from magnum-integration.

Xeverous avatar Xeverous commented on May 20, 2024

I'm using CMake 3.18 (and willing to upgrade whenever needed). This works: target_compile_options(MagnumImGuiIntegration PUBLIC $<$<CXX_COMPILER_ID:GNU>:-D__USE_MINGW_ANSI_STDIO=1>) but I still get the warning. The problem lies in Dear ImGui's #define IM_FMTARGS(FMT) __attribute__((format(printf, FMT, FMT+1))) which might not be correct for MinGW (which has ms_printf and gnu_printf formats).

from magnum-integration.

Xeverous avatar Xeverous commented on May 20, 2024

I don't get the warning when using printf even without __USE_MINGW_ANSI_STDIO, it only happens for ImGui's functions.

from magnum-integration.

Xeverous avatar Xeverous commented on May 20, 2024

I think it's Dear ImGui's fault in this case: ocornut/imgui#3592. I don't get these warnings for standard printf and ImGui uses them in their implementation - ImGui's text functions are just incorrectly labeled for MinGW.

from magnum-integration.

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.