Giter Club home page Giter Club logo

Comments (7)

madebr avatar madebr commented on September 13, 2024

How come HAVE_MALLOC is not defined on your system?

SDL/CMakeLists.txt

Lines 920 to 921 in 4728325

if(MSVC)
check_include_file("malloc.h" "HAVE_MALLOC")

What does the log say in CMakeFiles/CMakeConfigureLog.yaml?
If it's not present in the log, it's because we default it to enabled.

from sdl.

Windings-Lab avatar Windings-Lab commented on September 13, 2024

Forgot to mention. I have those variables

        "SDL_STATIC": "ON",
        "SDL_SHARED": "OFF",
        "SDL_HIDAPI_LIBUSB": "OFF",
        "SDL_DUMMYVIDEO": "OFF",
        "SDL_HIDAPI_LIBUSB_SHARED": "OFF",
        "SDL_DIRECTX": "OFF",
        "SDL_VULKAN": "OFF",
        "SDL_HIDAPI": "OFF",
        "SDL_AVX": "OFF",
        "SDL_ASSEMBLY": "OFF",
        "SDL_POWER": "OFF",
        "SDL_LIBUDEV": "OFF",
        "SDL_VIRTUAL_JOYSTICK": "OFF",
        "SDL_OFFSCREEN": "OFF",
        "SDL_XINPUT": "OFF",
        "SDL_VIDEO": "ON",
        "SDL_GCC_ATOMICS": "OFF",
        "SDL_CAMERA": "OFF",
        "SDL_HAPTIC": "OFF",
        "SDL_JOYSTICK": "OFF",
        "SDL_TEST_LIBRARY": "OFF",
        "SDL_HIDAPI_JOYSTICK": "OFF",
        "SDL_SENSOR": "OFF",
        "SDL_DISABLE_INSTALL": "ON",
        "SDL_AVX2": "OFF",
        "SDL_AUDIO": "OFF",
        "SDL_AVX512F": "OFF",
        "SDL_LIBC": "OFF",
        "SDL_RENDER_METAL": "OFF",
        "SDL_RENDER": "OFF",
        "SDL_DIALOG": "OFF"

Here's a CmakeConfigureLog
CMakeConfigureLog.txt

from sdl.

Windings-Lab avatar Windings-Lab commented on September 13, 2024

How come HAVE_MALLOC is not defined on your system?

I don't know. I recently fully reinstalled Windows 11. Installed Visual Studio Build Tools and used SDL3 for a month already until I've got this error.
CLang is from MSYS2 MINGW64. With this toolchain is working fine

While looking into RtlSetVolatileMemory, ReadPointerNoFence, ReadPointerNoFence, RtlFillVolatileMemory,
I found them in
D:\Windows Kits\10\Include\10.0.26100.0\um\winnt.h
And MapViewOfFile2 in
D:\Windows Kits\10\Include\10.0.26100.0\um\memoryapi.h
__imp_MapViewOfFileNuma2 - couldn't find at all

Found "malloc.h" in D:\Windows Kits\10\Include\10.0.26100.0\ucrt\malloc.h
#include <malloc.h> working fine. I don't know why CMake can't find it

from sdl.

Windings-Lab avatar Windings-Lab commented on September 13, 2024

Okay. Found what's happening then. It can find malloc.h. But it using another variable to check if it's enabled? Or I don't understand
image

from sdl.

madebr avatar madebr commented on September 13, 2024

Don't you need to use target_compile_definitions to define HAVE_MALLOC?

At the end of the configuration, a header is generated.
Something like include-config-debug/build_config/SDL_build_config.h.
If we would use compile definitions, the compile commands would become very long and unreadable.

from sdl.

Windings-Lab avatar Windings-Lab commented on September 13, 2024

image
SDL_build_config.h.intermediate has #define HAVE_MALLOC 1

Looking into other issue

from sdl.

Windings-Lab avatar Windings-Lab commented on September 13, 2024

Found it. Yeah. Thanks for the hints @madebr
I disabled "SDL_LIBC": "OFF" in a preset causing HAVE_LIBC to not be defined
image

I will now understand how to handle those problems properly. Sorry for panic)))

You can close it, if this issue not relevant and if SDL_LIBC need to be "ON" always

from sdl.

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.