Hopson97 / MineCraft-One-Week-Challenge

I challenged myself to see if I could create a voxel game (Minecraft-like) in just one week using C++ and OpenGL, and here is the result
https://www.youtube.com/watch?v=Xq3isov6mZ8
MIT License
2.65k stars 379 forks source link

Compiling help wanted #127

Closed hammerhai closed 2 years ago

hammerhai commented 5 years ago

Can someone help me compile on Windows 10 on Visual Studio 2017? Explaining every step as simply as possible.

kennyrkun commented 5 years ago

create an empty visual studio solution.

link SFML dependencies

download this repository's files

put them in the solution/projectname folder

add them to the project

compile

resolve any errors

hammerhai commented 5 years ago

link SFML dependencies

How?

Hopson97 commented 5 years ago

https://www.sfml-dev.org/tutorials/2.5/start-vc.php you can use this guide for a step-by-step setting up sfml with visual studio

Hopson97 commented 5 years ago

you will also need to have glm headers as additional dependancies

hammerhai commented 5 years ago

I'll try this all and see if it works, I did already follow the SFML Tutorial last night, it just wasn't working by itself, or it's just not working 😂

hammerhai commented 5 years ago

I have a question, can you maybe send a video that you did to set this up? It's confusing to me in words and no matter what video on YouTube I try, I can't figure this out.

kennyrkun commented 5 years ago

how is the SFML tutorial not working?

hammerhai commented 5 years ago

Whatever nothing's working.

kennyrkun commented 5 years ago

We can still help you, but we need to know exactly what's going on. When I first tried to set up this project I couldn't do it and gave up as well, I just needed someone to help me out with it.

hammerhai commented 5 years ago

OK 😞... I followed the tutorial from SFML but, whenever I open a new blank solution in C++ it doesn't seem to show the C++ option from the properties menu. Then I can't do anything. That's why I asked for a video so I could know if I'm doing everything right even after doing everything. Whenever I go to build, I get errors after already adding everything that's needed. I'm too confused.

kennyrkun commented 5 years ago

if you create a blank solution, it won't show c++ options because Visual Studio will not know what language you're using. I know that it says Blank C++ solution, but Visual Studio shows it's options to you based on the language it detects in the project. create a *.cpp file and put a main function in it, and then try opening the settings. it should show you the C++ options now.

hammerhai commented 5 years ago

OK, do I do a Blank Solution or Blank C++ Solution?

kennyrkun commented 5 years ago

either one will work.

I think blank solution creates only a solution, while blank C++ solution also creates a blank project.

hammerhai commented 5 years ago

OK, I'm gonna try this and see what happens... Btw, sorry for the late response 😅, learning PHP and doing a Project with it, it's very fun.

P.S @kennyrkun, if that's your dog in your Profile Pic, he/she is very adorable.

hammerhai commented 5 years ago

I did what you said, this time I got this error:

1>------ Build started: Project: Minecraft, Configuration: Debug Win32 ------ 1>sfml-graphics-s-d.lib(RenderStates.cpp.obj) : fatal error LNK1112: module machine type 'x64' conflicts with target machine type 'x86' 1>Done building project "Minecraft.vcxproj" -- FAILED. ========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

Now if I change the Machine Type to x64 I get a lot of errors in my code: screenshot 50

However when it's x86, I get: screenshot 51

hammerhai commented 5 years ago

Im so close, when I change it to release for x86, and it runs, I just get that sfml-window-2.lib, sfml-system-2.lib, and sfml-graphics-2.lib was not found, but I defined then with the -2 in the Linker>Input area. It also then says, reinstalling the program may fix it.

hammerhai commented 5 years ago

I GOT IT I GOT IT I GOT IT!!!!

screenshot 52

I simply followed these last steps and I figured it out, yayy!

Credit to https://stackoverflow.com/questions/29242013/sfml-2-1-and-codeblocks-error-sfml-graphics-2-dll-is-missing-from-your-computer and @kennyrkun and @Hopson97 for helping!

hammerhai commented 5 years ago

Now I need help with how to do the GLM Headers and how to fix the glad.h errors and stuff.

hammerhai commented 5 years ago

OK, I have done the GLM Headers correctly, I am now on to the OpenGL part, and it seems to be going well.

hammerhai commented 5 years ago

So I have everything done right, but now it is still telling me it can not find glad.h when its in the header folder.

I keep getting:

1>------ Build started: Project: MinecraftChallenge, Configuration: Debug Win32 ------ 1>Application.cpp 1>c:\users\natha\downloads\minecraft-one-week-challenge-master\minecraft-one-week-challenge-master\source\gl\glfunctions.h(4): fatal error C1083: Cannot open include file: 'glad.h': No such file or directory 1>Camera.cpp 1>Context.cpp 1>c:\users\natha\downloads\minecraft-one-week-challenge-master\minecraft-one-week-challenge-master\source\context.cpp(3): fatal error C1083: Cannot open include file: 'glad.h': No such file or directory 1>Controller.cpp 1>GLFunctions.cpp 1>c:\users\natha\downloads\minecraft-one-week-challenge-master\minecraft-one-week-challenge-master\source\gl\glfunctions.h(4): fatal error C1083: Cannot open include file: 'glad.h': No such file or directory 1>ItemStack.cpp 1>Main.cpp 1>c:\users\natha\downloads\minecraft-one-week-challenge-master\minecraft-one-week-challenge-master\source\gl\glfunctions.h(4): fatal error C1083: Cannot open include file: 'glad.h': No such file or directory 1>Frustum.cpp 1>Model.cpp 1>c:\users\natha\downloads\minecraft-one-week-challenge-master\minecraft-one-week-challenge-master\source\mesh.h(5): fatal error C1083: Cannot open include file: 'glad.h': No such file or directory 1>AABB.cpp 1>Player.cpp 1>c:\users\natha\downloads\minecraft-one-week-challenge-master\minecraft-one-week-challenge-master\source\mesh.h(5): fatal error C1083: Cannot open include file: 'glad.h': No such file or directory 1>ChunkRenderer.cpp 1>c:\users\natha\downloads\minecraft-one-week-challenge-master\minecraft-one-week-challenge-master\source\gl\glfunctions.h(4): fatal error C1083: Cannot open include file: 'glad.h': No such file or directory 1>FloraRenderer.cpp 1>c:\users\natha\downloads\minecraft-one-week-challenge-master\minecraft-one-week-challenge-master\source\gl\glfunctions.h(4): fatal error C1083: Cannot open include file: 'glad.h': No such file or directory 1>RenderMaster.cpp 1>c:\users\natha\downloads\minecraft-one-week-challenge-master\minecraft-one-week-challenge-master\source\gl\glfunctions.h(4): fatal error C1083: Cannot open include file: 'glad.h': No such file or directory 1>SFMLRenderer.cpp 1>c:\users\natha\downloads\minecraft-one-week-challenge-master\minecraft-one-week-challenge-master\source\renderer\sfmlrenderer.cpp(3): fatal error C1083: Cannot open include file: 'glad.h': No such file or directory 1>SkyboxRenderer.cpp 1>c:\users\natha\downloads\minecraft-one-week-challenge-master\minecraft-one-week-challenge-master\source\gl\glfunctions.h(4): fatal error C1083: Cannot open include file: 'glad.h': No such file or directory 1>WaterRenderer.cpp 1>c:\users\natha\downloads\minecraft-one-week-challenge-master\minecraft-one-week-challenge-master\source\gl\glfunctions.h(4): fatal error C1083: Cannot open include file: 'glad.h': No such file or directory 1>BasicShader.cpp 1>c:\users\natha\downloads\minecraft-one-week-challenge-master\minecraft-one-week-challenge-master\source\gl\glfunctions.h(4): fatal error C1083: Cannot open include file: 'glad.h': No such file or directory 1>ChunkShader.cpp 1>c:\users\natha\downloads\minecraft-one-week-challenge-master\minecraft-one-week-challenge-master\source\gl\glfunctions.h(4): fatal error C1083: Cannot open include file: 'glad.h': No such file or directory 1>FloraShader.cpp 1>c:\users\natha\downloads\minecraft-one-week-challenge-master\minecraft-one-week-challenge-master\source\gl\glfunctions.h(4): fatal error C1083: Cannot open include file: 'glad.h': No such file or directory 1>Generating Code... 1>Compiling... 1>Shader.cpp 1>c:\users\natha\downloads\minecraft-one-week-challenge-master\minecraft-one-week-challenge-master\source\gl\glfunctions.h(4): fatal error C1083: Cannot open include file: 'glad.h': No such file or directory 1>ShaderLoader.cpp 1>c:\users\natha\downloads\minecraft-one-week-challenge-master\minecraft-one-week-challenge-master\source\shaders\shaderloader.h(5): fatal error C1083: Cannot open include file: 'glad.h': No such file or directory 1>SkyboxShader.cpp 1>c:\users\natha\downloads\minecraft-one-week-challenge-master\minecraft-one-week-challenge-master\source\gl\glfunctions.h(4): fatal error C1083: Cannot open include file: 'glad.h': No such file or directory 1>WaterShader.cpp 1>c:\users\natha\downloads\minecraft-one-week-challenge-master\minecraft-one-week-challenge-master\source\gl\glfunctions.h(4): fatal error C1083: Cannot open include file: 'glad.h': No such file or directory 1>PlayingState.cpp 1>c:\users\natha\downloads\minecraft-one-week-challenge-master\minecraft-one-week-challenge-master\source\mesh.h(5): fatal error C1083: Cannot open include file: 'glad.h': No such file or directory 1>BasicTexture.cpp 1>c:\users\natha\downloads\minecraft-one-week-challenge-master\minecraft-one-week-challenge-master\source\texture\basictexture.h(4): fatal error C1083: Cannot open include file: 'glad.h': No such file or directory 1>CubeTexture.cpp 1>c:\users\natha\downloads\minecraft-one-week-challenge-master\minecraft-one-week-challenge-master\source\texture\cubetexture.h(4): fatal error C1083: Cannot open include file: 'glad.h': No such file or directory 1>TextureAtlas.cpp 1>c:\users\natha\downloads\minecraft-one-week-challenge-master\minecraft-one-week-challenge-master\source\texture\basictexture.h(4): fatal error C1083: Cannot open include file: 'glad.h': No such file or directory 1>ToggleKey.cpp 1>FPSCounter.cpp 1>c:\users\natha\downloads\minecraft-one-week-challenge-master\minecraft-one-week-challenge-master\source\gl\glfunctions.h(4): fatal error C1083: Cannot open include file: 'glad.h': No such file or directory 1>Random.cpp 1>c:\users\natha\downloads\minecraft-one-week-challenge-master\minecraft-one-week-challenge-master\source\util\random.cpp(11): warning C4244: 'argument': conversion from 'time_t' to 'unsigned int', possible loss of data 1>BlockDatabase.cpp 1>c:\users\natha\downloads\minecraft-one-week-challenge-master\minecraft-one-week-challenge-master\source\texture\basictexture.h(4): fatal error C1083: Cannot open include file: 'glad.h': No such file or directory 1>ChunkBlock.cpp 1>c:\users\natha\downloads\minecraft-one-week-challenge-master\minecraft-one-week-challenge-master\source\texture\basictexture.h(4): fatal error C1083: Cannot open include file: 'glad.h': No such file or directory 1>Chunk.cpp 1>c:\users\natha\downloads\minecraft-one-week-challenge-master\minecraft-one-week-challenge-master\source\mesh.h(5): fatal error C1083: Cannot open include file: 'glad.h': No such file or directory 1>ChunkManager.cpp 1>c:\users\natha\downloads\minecraft-one-week-challenge-master\minecraft-one-week-challenge-master\source\mesh.h(5): fatal error C1083: Cannot open include file: 'glad.h': No such file or directory 1>ChunkMesh.cpp 1>c:\users\natha\downloads\minecraft-one-week-challenge-master\minecraft-one-week-challenge-master\source\mesh.h(5): fatal error C1083: Cannot open include file: 'glad.h': No such file or directory 1>ChunkMeshBuilder.cpp 1>c:\users\natha\downloads\minecraft-one-week-challenge-master\minecraft-one-week-challenge-master\source\world\chunk\chunkmeshbuilder.h(6): fatal error C1083: Cannot open include file: 'glad.h': No such file or directory 1>ChunkSection.cpp 1>c:\users\natha\downloads\minecraft-one-week-challenge-master\minecraft-one-week-challenge-master\source\mesh.h(5): fatal error C1083: Cannot open include file: 'glad.h': No such file or directory 1>PlayerDigEvent.cpp 1>c:\users\natha\downloads\minecraft-one-week-challenge-master\minecraft-one-week-challenge-master\source\mesh.h(5): fatal error C1083: Cannot open include file: 'glad.h': No such file or directory 1>StructureBuilder.cpp 1>c:\users\natha\downloads\minecraft-one-week-challenge-master\minecraft-one-week-challenge-master\source\mesh.h(5): fatal error C1083: Cannot open include file: 'glad.h': No such file or directory 1>Generating Code... 1>Compiling... 1>TreeGenerator.cpp 1>c:\users\natha\downloads\minecraft-one-week-challenge-master\minecraft-one-week-challenge-master\source\mesh.h(5): fatal error C1083: Cannot open include file: 'glad.h': No such file or directory 1>ClassicOverWorldGenerator.cpp 1>c:\users\natha\downloads\minecraft-one-week-challenge-master\minecraft-one-week-challenge-master\source\mesh.h(5): fatal error C1083: Cannot open include file: 'glad.h': No such file or directory 1>SuperFlatGenerator.cpp 1>c:\users\natha\downloads\minecraft-one-week-challenge-master\minecraft-one-week-challenge-master\source\mesh.h(5): fatal error C1083: Cannot open include file: 'glad.h': No such file or directory 1>World.cpp 1>c:\users\natha\downloads\minecraft-one-week-challenge-master\minecraft-one-week-challenge-master\source\mesh.h(5): fatal error C1083: Cannot open include file: 'glad.h': No such file or directory 1>Generating Code... 1>Done building project "MinecraftChallenge.vcxproj" -- FAILED. ========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

Hopson97 commented 5 years ago

Same thing you did for SFML, you need to set the GLAD folder as an additional include directory

hammerhai commented 5 years ago

I set everything as this: C:\SFML-2.5.1\include;$(SolutionDir)/MinecraftChallenge/glm;$(SolutionDir)/MinecraftChallenge/glad Because I added the glad and include folder into my project, and Im still getting that it cant open glad.h, do I have to do something with linker? I have this for linker: opengl32.lib;glfw3.lib;sfml-system-s-d.lib;sfml-graphics-s-d.lib;sfml-window.libkernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies)

hammerhai commented 5 years ago

OK, I set the right variable now I get this: c:\users\natha\source\repos\minecraftchallenge\minecraftchallenge\glad\include\glad\glad.h(38): fatal error C1083: Cannot open include file: 'windows.h': No such file or directory

hammerhai commented 5 years ago

I did something and I got to this: 1>------ Build started: Project: MinecraftChallenge, Configuration: Debug Win32 ------ 1>glad.c 1>c:\users\natha\source\repos\minecraftchallenge\minecraftchallenge\glad\include\glad\glad.h(38): fatal error C1083: Cannot open include file: 'windows.h': No such file or directory 1>Done building project "MinecraftChallenge.vcxproj" -- FAILED. ========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

I added the glad.h file to the headers folder.

hammerhai commented 5 years ago

After I looked in the logs and removed the include to c:\users\natha\source\repos\minecraftchallenge\minecraftchallenge\glad\include\glad\ I got: Severity Code Description Project File Line Suppression State Error (active) E0020 identifier "GLuint" is undefined MinecraftChallenge C:\Users\natha\Downloads\MineCraft-One-Week-Challenge-master\MineCraft-One-Week-Challenge-master\Source\GL\GLFunctions.h 9
Error C1083 Cannot open include file: 'windows.h': No such file or directory MinecraftChallenge c:\users\natha\source\repos\minecraftchallenge\minecraftchallenge\glad\include\glad\glad.h 38
Error (active) E1696 cannot open source file "glad.h" MinecraftChallenge C:\Users\natha\Downloads\MineCraft-One-Week-Challenge-master\MineCraft-One-Week-Challenge-master\Source\GL\GLFunctions.h 4
Error (active) E1696 cannot open source file "glad.h" MinecraftChallenge C:\Users\natha\Downloads\MineCraft-One-Week-Challenge-master\MineCraft-One-Week-Challenge-master\Source\Mesh.h 5
Error (active) E1696 cannot open source file "glad.h" MinecraftChallenge C:\Users\natha\Downloads\MineCraft-One-Week-Challenge-master\MineCraft-One-Week-Challenge-master\Source\Mesh.h 6
Error (active) E1696 cannot open source file "glad.h" MinecraftChallenge C:\Users\natha\Downloads\MineCraft-One-Week-Challenge-master\MineCraft-One-Week-Challenge-master\Source\Texture\CubeTexture.h 4
Error (active) E0020 identifier "GLfloat" is undefined MinecraftChallenge C:\Users\natha\Downloads\MineCraft-One-Week-Challenge-master\MineCraft-One-Week-Challenge-master\Source\Model.h 26
Error (active) E0020 identifier "GLuint" is undefined MinecraftChallenge C:\Users\natha\Downloads\MineCraft-One-Week-Challenge-master\MineCraft-One-Week-Challenge-master\Source\GL\GLFunctions.h 8
Error (active) E0020 identifier "GLuint" is undefined MinecraftChallenge C:\Users\natha\Downloads\MineCraft-One-Week-Challenge-master\MineCraft-One-Week-Challenge-master\Source\Model.h 25
Error (active) E0020 identifier "GLuint" is undefined MinecraftChallenge C:\Users\natha\Downloads\MineCraft-One-Week-Challenge-master\MineCraft-One-Week-Challenge-master\Source\Model.h 37
Error (active) E0020 identifier "GLuint" is undefined MinecraftChallenge C:\Users\natha\Downloads\MineCraft-One-Week-Challenge-master\MineCraft-One-Week-Challenge-master\Source\Renderer\RenderInfo.h 6
Error (active) E0020 identifier "GLuint" is undefined MinecraftChallenge C:\Users\natha\Downloads\MineCraft-One-Week-Challenge-master\MineCraft-One-Week-Challenge-master\Source\Renderer\RenderInfo.h 7
Error (active) E0020 identifier "GLuint" is undefined MinecraftChallenge C:\Users\natha\Downloads\MineCraft-One-Week-Challenge-master\MineCraft-One-Week-Challenge-master\Source\Shaders\BasicShader.h 19
Error (active) E0020 identifier "GLuint" is undefined MinecraftChallenge C:\Users\natha\Downloads\MineCraft-One-Week-Challenge-master\MineCraft-One-Week-Challenge-master\Source\Shaders\BasicShader.h 20
Error (active) E0020 identifier "GLuint" is undefined MinecraftChallenge C:\Users\natha\Downloads\MineCraft-One-Week-Challenge-master\MineCraft-One-Week-Challenge-master\Source\Shaders\FloraShader.h 13
Error (active) E0020 identifier "GLuint" is undefined MinecraftChallenge C:\Users\natha\Downloads\MineCraft-One-Week-Challenge-master\MineCraft-One-Week-Challenge-master\Source\Shaders\Shader.h 18
Error (active) E0020 identifier "GLuint" is undefined MinecraftChallenge C:\Users\natha\Downloads\MineCraft-One-Week-Challenge-master\MineCraft-One-Week-Challenge-master\Source\Shaders\Shader.h 19
Error (active) E0020 identifier "GLuint" is undefined MinecraftChallenge C:\Users\natha\Downloads\MineCraft-One-Week-Challenge-master\MineCraft-One-Week-Challenge-master\Source\Shaders\Shader.h 21
Error (active) E0020 identifier "GLuint" is undefined MinecraftChallenge C:\Users\natha\Downloads\MineCraft-One-Week-Challenge-master\MineCraft-One-Week-Challenge-master\Source\Shaders\Shader.h 22
Error (active) E0020 identifier "GLuint" is undefined MinecraftChallenge C:\Users\natha\Downloads\MineCraft-One-Week-Challenge-master\MineCraft-One-Week-Challenge-master\Source\Shaders\Shader.h 23
Error (active) E0020 identifier "GLuint" is undefined MinecraftChallenge C:\Users\natha\Downloads\MineCraft-One-Week-Challenge-master\MineCraft-One-Week-Challenge-master\Source\Shaders\Shader.h 25
Error (active) E0020 identifier "GLuint" is undefined MinecraftChallenge C:\Users\natha\Downloads\MineCraft-One-Week-Challenge-master\MineCraft-One-Week-Challenge-master\Source\Shaders\Shader.h 29
Error (active) E0020 identifier "GLuint" is undefined MinecraftChallenge C:\Users\natha\Downloads\MineCraft-One-Week-Challenge-master\MineCraft-One-Week-Challenge-master\Source\Shaders\SkyboxShader.h 17
Error (active) E0020 identifier "GLuint" is undefined MinecraftChallenge C:\Users\natha\Downloads\MineCraft-One-Week-Challenge-master\MineCraft-One-Week-Challenge-master\Source\Shaders\SkyboxShader.h 18
Error (active) E0020 identifier "GLuint" is undefined MinecraftChallenge C:\Users\natha\Downloads\MineCraft-One-Week-Challenge-master\MineCraft-One-Week-Challenge-master\Source\Shaders\WaterShader.h 13
Error (active) E0020 identifier "GLuint" is undefined MinecraftChallenge C:\Users\natha\Downloads\MineCraft-One-Week-Challenge-master\MineCraft-One-Week-Challenge-master\Source\Texture\CubeTexture.h 35
Error (active) E0020 identifier "GL_TEXTURE_2D" is undefined MinecraftChallenge C:\Users\natha\Downloads\MineCraft-One-Week-Challenge-master\MineCraft-One-Week-Challenge-master\Source\GL\GLFunctions.h 15
Error (active) E0020 identifier "GL_TEXTURE_CUBE_MAP" is undefined MinecraftChallenge C:\Users\natha\Downloads\MineCraft-One-Week-Challenge-master\MineCraft-One-Week-Challenge-master\Source\GL\GLFunctions.h 16

hammerhai commented 5 years ago

So I fixed one thing, from this: opengl32.lib;glfw3.lib;sfml-system-s-d.lib;sfml-graphics-s-d.lib; sfml-window.libkernel32.lib; user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies) To: opengl32.lib;glfw3.lib;sfml-system-s-d.lib;sfml-graphics-s-d.lib; sfml-window-s-d.lib;kernel32.lib; user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies)

kennyrkun commented 5 years ago

this is good. unfortunately, I don't remember exactly where I put the GLM folder. I think it was outside the project directory, where the solution file would be stored. that should be that same place you put the SFML folder. I could be wrong though, and it might go in the project directory with the rest of the files in the glm folder, however I'm not sure.

are the missing GLM includes #include "glm.hpp" or #include <glm.hpp> ?

hammerhai commented 5 years ago

that should be that same place you put the SFML folder

I linked mine from C:\

Im missing glm.hpp

Edit: I am not missing that, how do I include it as a header?

Another Edit: I've already included it here: C:\SFML-2.5.1\include;C:\Users\natha\source\repos\MinecraftChallenge\MinecraftChallenge\glm;C:\OpenGL\include\GLFW\include;C:\Users\natha\source\repos\MinecraftChallenge\MinecraftChallenge\glad\include;%(AdditionalIncludeDirectories)

I'm just having trouble with glad.h which I have in the includes.

hammerhai commented 5 years ago

I'm getting this now in Debug: Severity Code Description Project File Line Suppression State Error (active) E0059 function call is not allowed in a constant expression MinecraftChallenge C:\Users\natha\Downloads\glad\src\glad.c 48
Error C1083 Cannot open include file: 'glad/glad.h': No such file or directory MinecraftChallenge c:\users\natha\downloads\glad\src\glad.c 25
Error (active) E1696 cannot open source file "winapifamily.h" MinecraftChallenge C:\Users\natha\Downloads\glad\src\glad.c 47
Error (active) E1696 cannot open source file "windows.h" MinecraftChallenge C:\Users\natha\Downloads\glad\src\glad.c 30
Error (active) E1696 cannot open source file "windows.h" MinecraftChallenge C:\Users\natha\source\repos\MinecraftChallenge\MinecraftChallenge\glad\include\glad\glad.h 38
Error (active) E0018 expected a ')' MinecraftChallenge C:\Users\natha\Downloads\glad\src\glad.c 71
Error (active) E0018 expected a ')' MinecraftChallenge C:\Users\natha\Downloads\glad\src\glad.c 136 Error (active) E0028 expression must have a constant value MinecraftChallenge C:\Users\natha\Downloads\glad\src\glad.c 48
Error (active) E0059 function call is not allowed in a constant expression MinecraftChallenge C:\Users\natha\Downloads\glad\src\glad.c 48
Error (active) E0020 identifier "HMODULE" is undefined MinecraftChallenge C:\Users\natha\Downloads\glad\src\glad.c 31
Error (active) E0020 identifier "HMODULE" is undefined MinecraftChallenge C:\Users\natha\Downloads\glad\src\glad.c 71
Error (active) E0020 identifier "HMODULE" is undefined MinecraftChallenge C:\Users\natha\Downloads\glad\src\glad.c 136

In Release, I get over 500 errors.

SuperUserDone commented 5 years ago

Ok I'll try and help, but I'll take another route.

  1. Download and install cmake from: https://cmake.org/download/ (Select windows x64 installer)

  2. Make a fresh clone of the repo.

  3. Open file manager and go to the location of the clone.

  4. Click on the bar at the top and copy the path.

  5. Hold the windows key and press 'R'.

  6. Type cmd and press enter At this point a black box should appear.

  7. Type cd and paste the path you just copied and press enter.

  8. Type mkdir build and press enter.

  9. Type 'cd build' and press enter.

  10. Type cmake-gui .. and press enter. A window that looks kinda like this should appear: image

  11. Click on configure in the bottom left corner.

  12. Select Vs 2017 from the list and select finish.

  13. Post a screenshot when the text has stopped moving in the small console and paste the console's text.

hammerhai commented 5 years ago

Selecting Windows SDK version 10.0.17763.0 to target Windows 10.0.17758. The C compiler identification is MSVC 19.16.27025.1 The CXX compiler identification is MSVC 19.16.27025.1 Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio/2017/Community/VC/Tools/MSVC/14.16.27023/bin/Hostx86/x86/cl.exe Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio/2017/Community/VC/Tools/MSVC/14.16.27023/bin/Hostx86/x86/cl.exe -- works Detecting C compiler ABI info Detecting C compiler ABI info - done Detecting C compile features Detecting C compile features - done Check for working CXX compiler: C:/Program Files (x86)/Microsoft Visual Studio/2017/Community/VC/Tools/MSVC/14.16.27023/bin/Hostx86/x86/cl.exe Check for working CXX compiler: C:/Program Files (x86)/Microsoft Visual Studio/2017/Community/VC/Tools/MSVC/14.16.27023/bin/Hostx86/x86/cl.exe -- works Detecting CXX compiler ABI info Detecting CXX compiler ABI info - done Detecting CXX compile features Detecting CXX compile features - done CMake Error at cmake_modules/FindSFML.cmake:358 (message): Could NOT find SFML (missing: SFML_GRAPHICS_LIBRARY SFML_NETWORK_LIBRARY SFML_AUDIO_LIBRARY SFML_WINDOW_LIBRARY SFML_SYSTEM_LIBRARY) Call Stack (most recent call first): CMakeLists.txt:22 (find_package)

Configuring incomplete, errors occurred! See also "C:/Users/natha/Downloads/MineCraft-One-Week-Challenge-master/MineCraft-One-Week-Challenge-master/build/CMakeFiles/CMakeOutput.log".

CMakeOutput.log

SuperUserDone commented 5 years ago

Ok now You need to do this.

  1. Download sfml 32-bit for vs C++14 2015 https://www.sfml-dev.org/download/sfml/2.4.0/
  2. Extract it to the root directory of the repo.
  3. Open cmake-gui again and create or set the entry SFML_ROOT to the root directory of sfml.
  4. Click configure again and then send screenshot and logs.
hammerhai commented 5 years ago

Sorry for the late reply 😅


CMake Warning (dev) at CMakeLists.txt:22 (find_package):
  Policy CMP0074 is not set: find_package uses <PackageName>_ROOT variables.
  Run "cmake --help-policy CMP0074" for policy details.  Use the cmake_policy
  command to set the policy and suppress this warning.

  CMake variable SFML_ROOT is set to:

    C:/Users/natha/Downloads/MineCraft-One-Week-Challenge-master/MineCraft-One-Week-Challenge-master/SFML-2.4.0

  For compatibility, CMake is ignoring the variable.
This warning is for project developers.  Use -Wno-dev to suppress it.

Found SFML .. in C:/Users/natha/Downloads/MineCraft-One-Week-Challenge-master/MineCraft-One-Week-Challenge-master/SFML-2.4.0/include
Could NOT find GLM (missing: GLM_INCLUDE_DIR) 
Looking for pthread.h
Looking for pthread.h - not found
Found Threads: TRUE  
Configuring done```
SuperUserDone commented 5 years ago

Ok you're almost done.

Click on generate and check if you can open and build the vs project if not:

  1. Download glm from https://github.com/g-truc/glm/releases (glm-0.9.9.3.zip)
  2. Extract to root of repo.
  3. Set GLM_INCLUDE_DIR to the glm folder of glm. (Keep going into glm folder until you cant anymore)
  4. Click configure and genrerate in order.
  5. Everything should now be correct. Try it out :1st_place_medal: :-)
hammerhai commented 5 years ago

Im highly confused. Can you take me through all of what I have to do in Visual Studio now?

SuperUserDone commented 5 years ago

Ok so open cmake again and click on generate. Then check the build folder in the repo there should be a vs solution file open it and click build.

hammerhai commented 5 years ago

I got a path of this: C:\Users\natha\Downloads\MineCraft-One-Week-Challenge-master\MineCraft-One-Week-Challenge-master\build\Debug and inside are glad.lib and glad.pdb

hammerhai commented 5 years ago

Ohhh, ok I see now what I have to do. Gotta add GLM since it didn't work.

SuperUserDone commented 5 years ago

Check to make sure you are building everything. Select the all targets on all projects and build.

hammerhai commented 5 years ago

Do I press Build ALL_BUILD? Or Build Solution at the top.

SuperUserDone commented 5 years ago

Double click on ALL_BUILD and then press build at the top.