Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Errors cross-compiling Lubuntu 16.04 -> Windows #2225

Closed
SDLBugzilla opened this issue Feb 11, 2021 · 0 comments
Closed

Errors cross-compiling Lubuntu 16.04 -> Windows #2225

SDLBugzilla opened this issue Feb 11, 2021 · 0 comments
Labels
duplicate This issue or pull request already exists

Comments

@SDLBugzilla
Copy link
Collaborator

This bug report was migrated from our old Bugzilla tracker.

These attachments are available in the static archive:

Reported in version: HG 2.0
Reported for operating system, platform: Windows (All), x86

Comments on the original bug report:

On 2016-07-27 14:15:19 +0000, Rainer Deyke wrote:

Created attachment 2533
patch fixing both errors

I'm unable to cross-compile SDL2, neither 2.0.4 nor the latest hg, under amd64 Lubuntu 16.04. My compiler is i686-w64-mingw32-gcc (GCC) 5.3.1 20160211. I suspect that this problem affects all gcc 5.x builds of mingw on all platforms, although I haven't tested any others.

There are two errors. The first is that SDL defines static versions of IID_IDXGIFactory2 and co, which conflicts with the non-static versions of the same GUIDs, as declared in the Direct3D11 header files. The other is that SDL uses the pattern FUNCTION ", text here" to generate string literals containing the function name, which doesn't work because FUNCTION is a variable, not a preprocessor token.

I have attached a patch that fixes both errors.

On 2016-07-27 14:17:01 +0000, Rainer Deyke wrote:

Created attachment 2534
build log showing the error messages

On 2016-09-12 17:48:58 +0000, Kai Sterker wrote:

The attached patch is slightly wrong.

The new method with two char* arguments is invoked as WIN_SetErrorfromHRESULT,
but declared/defined as WIN_SetErrorFromHRESULT2, which means it does not compile without changing one or the other. Also, gcc spits a warning about passing const char* "" as non-const in the call.

In general, this patch does look much nicer than the external patches linked here https://bugzilla.libsdl.org/show_bug.cgi?id=3336#c2

Would really love to see this issue fixed in time for SDL 2.0.5. Cross-compiling or resorting to Mingw64 on Windows seems quite common practice when primarily developing for Linux.

On 2016-10-01 17:29:53 +0000, Sam Lantinga wrote:

This is fixed in https://hg.libsdl.org/SDL/rev/6cf7d55773b3

*** This bug has been marked as a duplicate of bug 3336 ***

@SDLBugzilla SDLBugzilla added bug duplicate This issue or pull request already exists labels Feb 11, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
duplicate This issue or pull request already exists
Projects
None yet
Development

No branches or pull requests

1 participant