danoon2/Boxedwine

`'SDL.h' file not found` in "sdlcallback" when compiling in Xcode on Mac

Closed this issue · 10 comments

Despite building SDL2, Xcode cannot find SDL.h when compiling platform/sdl/sdlcallback.cpp on Mac.

EDIT: The error is on this line: https://github.com/danoon2/Boxedwine/blob/master/platform/sdl/sdlcallback.cpp#L4

Sorry about that, I really need to add this to the wiki. You need to fetch the dependencies for Mac, you can run fetchDepends.sh in project/mac-xcode.

https://github.com/danoon2/Boxedwine/blob/master/project/mac-xcode/fetchDepends.sh

That problem is now solved, but now there are a bunch of undeclared identifiers in source/ui/opengl/platformhelper.cpp:

.../BoxedWine/source/ui/opengl/platformhelper.cpp:45:9: error: unknown type name 'GLuint'; did you mean 'uint'?
        GLuint t = (GLuint)(U64)texture;
        ^~~~~~
        uint
[...]
.../BoxedWine/source/ui/opengl/platformhelper.cpp:45:21: error: unknown type name 'GLuint'; did you mean 'uint'?
        GLuint t = (GLuint)(U64)texture;
                    ^~~~~~
                    uint
[...]
.../BoxedWine/source/ui/opengl/platformhelper.cpp:46:9: error: use of undeclared identifier 'glDeleteTextures'
        glDeleteTextures(1, &t);
        ^
.../BoxedWine/source/ui/opengl/platformhelper.cpp:52:5: error: unknown type name 'GLuint'; did you mean 'uint'?
    GLuint image_texture = 0;
    ^~~~~~
    uint
[...]
.../BoxedWine/source/ui/opengl/platformhelper.cpp:53:5: error: use of undeclared identifier 'glGenTextures'
    glGenTextures(1, &image_texture);
    ^
.../BoxedWine/source/ui/opengl/platformhelper.cpp:54:19: error: use of undeclared identifier 'GL_TEXTURE_2D'
    glBindTexture(GL_TEXTURE_2D, image_texture);
                  ^
.../BoxedWine/source/ui/opengl/platformhelper.cpp:57:21: error: use of undeclared identifier 'GL_TEXTURE_2D'
    glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
                    ^
.../BoxedWine/source/ui/opengl/platformhelper.cpp:57:36: error: use of undeclared identifier 'GL_TEXTURE_MIN_FILTER'
    glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
                                   ^
.../BoxedWine/source/ui/opengl/platformhelper.cpp:57:59: error: use of undeclared identifier 'GL_LINEAR'
    glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
                                                          ^
.../BoxedWine/source/ui/opengl/platformhelper.cpp:58:21: error: use of undeclared identifier 'GL_TEXTURE_2D'
    glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
                    ^
.../BoxedWine/source/ui/opengl/platformhelper.cpp:58:36: error: use of undeclared identifier 'GL_TEXTURE_MAG_FILTER'
    glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
                                   ^
.../BoxedWine/source/ui/opengl/platformhelper.cpp:58:59: error: use of undeclared identifier 'GL_LINEAR'
    glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
                                                          ^
.../BoxedWine/source/ui/opengl/platformhelper.cpp:61:19: error: use of undeclared identifier 'GL_UNPACK_ROW_LENGTH'
    glPixelStorei(GL_UNPACK_ROW_LENGTH, 0);
                  ^
.../BoxedWine/source/ui/opengl/platformhelper.cpp:62:18: error: use of undeclared identifier 'GL_TEXTURE_2D'
    glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, width, height, 0, GL_RGBA, GL_UNSIGNED_BYTE, data);
                 ^
.../BoxedWine/source/ui/opengl/platformhelper.cpp:62:36: error: use of undeclared identifier 'GL_RGBA'
    glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, width, height, 0, GL_RGBA, GL_UNSIGNED_BYTE, data);
                                   ^
.../BoxedWine/source/ui/opengl/platformhelper.cpp:62:63: error: use of undeclared identifier 'GL_RGBA'
    glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, width, height, 0, GL_RGBA, GL_UNSIGNED_BYTE, data);
                                                              ^
.../BoxedWine/source/ui/opengl/platformhelper.cpp:62:72: error: use of undeclared identifier 'GL_UNSIGNED_BYTE'
    glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, width, height, 0, GL_RGBA, GL_UNSIGNED_BYTE, data);

The only thing I can think of is to clean the build folder, then exit XCode and try again. (in that order) OpenGL is a system framework, so you should have it. But I load it through SDL, so maybe XCode got confused when SDL didn't exist and cached something.

The only thing I can think of is to clean the build folder, then exit XCode and try again.

Is Xcode's Product -> Clean Build Folder... -> Clean sufficient?

Same issue.

Screenshot 2024-01-25 at 11 58 45 AM
I take it that didn't work? It works for me sometimes when I have a library issue caused by the file system getting updated while XCode was open.

Maybe check that the opengl library frame work is there and enabled, you can check the project (select top level boxedwine on the left) and scroll down on the general tab.

It seems to be there:

image

Could it be if my Mac is too old?

What XCode version are you using? I only recently updated one of my build machines from XCode 12 to 15, but if you are older than XCode 12 then that could be an issue. But it still seems weird how it presented itself about complaint over OpenGL.

If you just want to test it out, you can download a compiled version. On github.com/danoon/Boxedwine, at the top, is a green check mark. This indicates my build machine built and tested that checkin. If you click that green check, then click the details link, it will bring you to the jenkins. On the top right is "Artifacts". You will be able to download all the machines I test on from there.

The last build on master is build 67, http://208.113.165.28:8080/blue/organizations/jenkins/Boxedwine/detail/master/67/pipeline

What XCode version are you using? I only recently updated one of my build machines from XCode 12 to 15, but if you are older than XCode 12 then that could be an issue.

I believe it's Xcode 15.1. It's definitely not older than that. My Mac is way older, though.

If you just want to test it out, you can download a compiled version.

I would like to build Boxedwine myself so that I can make changes and poke around locally.

Currently the Mac status is

  1. x64 binary translator works well
  2. Armv8 binary translator still has some bug, especially when running 16-bit code
  3. OpenGL does not work well, Mac OpenGL doesn't support some things required by Wine. Wine works around this and I would have to port that same work around. But since OpenGL is deprecated, I'm hoping to get Vulkan to work.

If your mac is new enough to support Xcode 15, it should be able to build Boxedwine. I only have access to one 7 year old x64 iMac, but I already installed stuff on it so I don't know if I did something and just forgot.