Giter Club home page Giter Club logo

Comments (9)

mmatyas avatar mmatyas commented on May 17, 2024

It seems MSVC doesn't support creating arrays like this... I've replaced them with vectors for now, and also fixed some other Visual Studio compile errors. It might work now, though I still have some linker errors, which may or may not occur to you too.

from supermariowar.

hu9o avatar hu9o commented on May 17, 2024

I always thought this kind of declaration was forbidden in C++. I replaced them with std::strings, but, like you, I get linker errors.

I spent hours trying to figure it out, to no avail:
I get LINK : fatal error LNK1104: cannot open file 'SDL_image.lib', even though I used SDL2_image.lib.
I never entered SDL_image.lib once in cmake, and it's not anywhere in my project options.
I have no clue where MSVC finds this name, so I can't change it.

Can you help me?

EDIT: I found a series of pragma directives as such: #pragma comment(lib, "SDL_image.lib") in the source. Even though I don't know why they're needed, I changed the occurrences of SDL to SDL2.
Now I get unresolved external symbols (zlib functions), and a host of errors that look like SDL1.X code not working with SDL2.

EDIT2: BTW I found this: http://stackoverflow.com/questions/5424549/unresolved-externals-despite-linking-in-zlib-lib. Is it true, in your experience, that I must recompile zlib?

from supermariowar.

mmatyas avatar mmatyas commented on May 17, 2024

I've just pushed some more MSVC patches, it should build and link correctly now. I've set up automated build testing on Appveyor too, but only for SDL1 at the moment.

#pragma comment can be used to add additional linker parameters to the generated object file. I guess it was easier for the original developers to add dependencies like this, but such tasks are now handled by the build system (CMake).

You won't need to recompile the dependencies; zlib works perfectly, only SDL1 had some problems due to certain internal changes between the Visual Studio version. I've added a workaround which should work, but I haven't done too much testing on Windows yet.

Building with SDL2 should work too, just set the USE_SDL2_LIBS CMake flag to ON. Note that only SMW itself has been converted to SDL2, the Level and World Editors won't compile.

from supermariowar.

hu9o avatar hu9o commented on May 17, 2024

I'm sorry, but even with your updates, I still get:
Error LNK2019 unresolved external symbol compress referenced in function (...)
I tried linking to zlib\lib\zdll.lib without success, then I downloaded "zlib 1.2.3 for Windows 9x/NT (DLL and static version)" and tried linking to zlib-1.2.3-lib\lib\zlib.lib, to no avail.

I only tried with SDL2 and USE_SDL2_LIBS enabled, if that's of any consequence.

Maybe you could provide me with a copy of your Zlib .lib/.dll file(s) for Windows x64 ?

from supermariowar.

mmatyas avatar mmatyas commented on May 17, 2024

I'm using "zlib compiled DLL, version 1.2.8" from zlib.net, and it seems to be working on both x86 and x64. Also I've added the SDL2 build to Appveyor, so I can confirm that SDL2 works too on x86. I have some troubles linking the x64-specific libs of SDL1/2, but zlib itself seems to work correctly (probably SDL too if you use its x86 libs even on x64).

from supermariowar.

mmatyas avatar mmatyas commented on May 17, 2024

In case you want to try it, here is the smw.exe for x86 using SDL2.

from supermariowar.

mmatyas avatar mmatyas commented on May 17, 2024

Have you managed to build it?

from supermariowar.

hu9o avatar hu9o commented on May 17, 2024

No I haven't, couldn't get it to work :/

from supermariowar.

mmatyas avatar mmatyas commented on May 17, 2024

Since the original issue, there have been quite some changes in the configuration and testing system; the build are tested with Visual Studio, with SDL1 and 2, so not sure if the issue is still valid. I'm closing this for now, but if it turns out to be still an issue, feel free to report it!

from supermariowar.

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.