Code Monkey home page Code Monkey logo

Comments (13)

aplocher avatar aplocher commented on June 20, 2024 6

To get this to build (in Visual Studio) and run I did the following:

  1. Make sure you have the "Desktop development with C++" workload installed for Visual Studio (in the "Visual Studio Installer")
  2. Download / Extract latest SDL2-devel (SDL2-devel-2.24.0-VC.zip) - from https://github.com/libsdl-org/SDL/releases
  3. Open Zelda3 SLN in Visual Studio
  4. Go to "Project Properties" (right click "zelda3" in Solution Explorer and select "Properties")
  5. In Configuration Properties > C / C++ > General: Updated Additional Include Directories path to point to the extracted SDL files "include" directory
  6. In Configuration Properties > Linker > Input: Change Additional Dependencies path to point to: lib\x64\SDL2.lib and lib\x64\SDL2main.lib
  7. Build solution
  8. Copy lib\x64\SDL2.dll to output directory (x64\Release or x64\Debug)
  9. Run Zelda3.exe
  10. Rejoice!

Screenshots:

image

image

image

image

from zelda3.

aplocher avatar aplocher commented on June 20, 2024 3

@ReticentRobot the SLN file I referenced is for the Zelda3 project (I updated my post).

A better option might be to use kageurufu's fork of this project. He fixed all the SDL dependencies to use Nuget. Using his branch might be a better option since it doesn't require any setup of SDL and it "just works" (he has an open PR which will hopefully get merged into this repo).

git clone https://github.com/kageurufu/zelda3
cd zelda3
git checkout sdl_from_nuget

Then extract/compile rom stuff in the tables directory.

Open in VS, build, and run .exe

from zelda3.

ReticentRobot avatar ReticentRobot commented on June 20, 2024 1

I downloaded SDL2-devel-2.24.0-VC.zip from that project, but I seem to be missing some files in the zip? Like I don't see a .sln file in it at all:

image

EDIT: Oh wait, I missed your edit on step 3 :) Thank you!!

from zelda3.

nitrostemp avatar nitrostemp commented on June 20, 2024

Have the same issue, but i also have added the sdl include folder.

from zelda3.

Manurocker95 avatar Manurocker95 commented on June 20, 2024

Have the same issue, but i also have added the sdl include folder.

The linker also has a dependency of D:\Lib\SDL2-2.0.20\lib\x64\SDL2main.lib and D:\Lib\SDL2-2.0.20\lib\x64\SDL2.lib. After fixing those paths and running again VS, I face this:

image

from zelda3.

Manurocker95 avatar Manurocker95 commented on June 20, 2024

That didn't fix the issue, as compiling for x86 makes the application to run. There's something wrong with x64 :/

Edit: Linking the DLL instead worked for me.

from zelda3.

homebrewGT avatar homebrewGT commented on June 20, 2024

Got the same error, x86, x64, debug, release build. Nothing seems to work

Severity Code Description Project File Line Suppression State
Error C1083 Cannot open include file: 'SDL.h': No such file or directory zelda3 C:\Users\davis\source\repos\zelda3\main.cpp 8

EDIT: I fixed by checking the properties of the project, it has the SDL library on D: directory lol so i placed my files there :v and it worked!

from zelda3.

ReticentRobot avatar ReticentRobot commented on June 20, 2024

Which version of SDL should I install? I used SDL by Sam Lantinga 1.2.15.16 and I'm not longer getting the Can't find SDL.h error, but now I'm getting 16 new errors in the vein of 'device': undeclared identifier all in the file spc_player.cpp

from zelda3.

ReticentRobot avatar ReticentRobot commented on June 20, 2024

Perfect! Thank you so much, that way went way smoother. Success!!

from zelda3.

rdmcintee avatar rdmcintee commented on June 20, 2024

I tried doing this and am getting below errors:

Severity Code Description Project File Line Suppression State
Error NuGet Package restore failed for project zelda3: Unable to find version '2.0.5' of package 'sdl2'.
C:\Program Files (x86)\Microsoft SDKs\NuGetPackages: Package 'sdl2.2.0.5' is not found on source 'C:\Program Files (x86)\Microsoft SDKs\NuGetPackages'.
. Please see Error List window for detailed warnings and errors.

Severity Code Description Project File Line Suppression State
Error NuGet Package restore failed for project zelda3: Unable to find version '2.0.5' of package 'sdl2.redist'.
C:\Program Files (x86)\Microsoft SDKs\NuGetPackages: Package 'sdl2.redist.2.0.5' is not found on source 'C:\Program Files (x86)\Microsoft SDKs\NuGetPackages'.
. Please see Error List window for detailed warnings and errors.

Severity Code Description Project File Line Suppression State
Error This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is packages\sdl2.redist.2.0.5\build\native\sdl2.redist.targets. zelda3 C:\Users\rdmci\Desktop\zelda3\zelda3\zelda3.vcxproj 249

from zelda3.

keatongreve avatar keatongreve commented on June 20, 2024

@rdmcintee Looks like you need to manually restore NuGet packages for the project (see the error in the last paragraph). https://docs.microsoft.com/en-us/nuget/consume-packages/package-restore#restore-packages-manually-using-visual-studio

from zelda3.

njshockey avatar njshockey commented on June 20, 2024

@ReticentRobot the SLN file I referenced is for the Zelda3 project (I updated my post).

A better option might be to use kageurufu's fork of this project. He fixed all the SDL dependencies to use Nuget. Using his branch might be a better option since it doesn't require any setup of SDL and it "just works" (he has an open PR which will hopefully get merged into this repo).

git clone https://github.com/kageurufu/zelda3 cd zelda3 git checkout sdl_from_nuget

Then extract/compile rom stuff in the tables directory.

Open in VS, build, and run .exe

This worked much better for me. No SDL setup is needed. Visual Studio does everything for you when you build the project/solution. Thanks!

from zelda3.

snesrev avatar snesrev commented on June 20, 2024

NuGet is used now.

from zelda3.

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.