GithubHelp home page GithubHelp logo

Comments (12)

y2k04 avatar y2k04 commented on June 3, 2024

looks like a missing c library

from doomenstein-3d.

morpheuslord avatar morpheuslord commented on June 3, 2024

i am having issues in make this is the error

Access denied - SRC
File not found - -NAME
Access denied - SRC
File not found - -NAME
rsync -a --include '*/' --exclude '*' "src" "bin"
process_begin: CreateProcess(NULL, rsync -a --include */ --exclude * src bin, ...) failed.
make (e=2): The system cannot find the file specified.
make: *** [Makefile:57: dirs] Error 2

from doomenstein-3d.

y2k04 avatar y2k04 commented on June 3, 2024

try resetting permissions on the src and bin folder

from doomenstein-3d.

fxundplxgg avatar fxundplxgg commented on June 3, 2024

@Andreas711 You are missing the "stdbool.h" library
Add the line #include <stdbool.h> to the top of "main_doom.c"

from doomenstein-3d.

Andreas711 avatar Andreas711 commented on June 3, 2024

image
I got a bit further but i think i am having problems with other things by the looks of it.

from doomenstein-3d.

y2k04 avatar y2k04 commented on June 3, 2024

image I got a bit further but i think i am having problems with other things by the looks of it.

You are now missing the SDL library

from doomenstein-3d.

Andreas711 avatar Andreas711 commented on June 3, 2024

is sdl2 backwards compatible with sdl1?? because i can only find downloads for sdl2

from doomenstein-3d.

Andreas711 avatar Andreas711 commented on June 3, 2024

image
i have everything in place, i honestly dont really know what to do know tbh ...
image

from doomenstein-3d.

y2k04 avatar y2k04 commented on June 3, 2024

is sdl2 backwards compatible with sdl1?? because i can only find downloads for sdl2

I am not sure.

from doomenstein-3d.

morpheuslord avatar morpheuslord commented on June 3, 2024

try resetting permissions on the src and bin folder

What permissions like 666 or 700

from doomenstein-3d.

backendiain avatar backendiain commented on June 3, 2024

Hopefully @y2k04 and @Andreas711 have gotten you to where things are working.

If not, here's some notes on getting things compiling and linking on Windows.

Based on my tinkerings in the WSL here:
#5 (comment)

For what it's worth - it might be easier for you to just spool up a VM or Docker instance of a Linux machine (Ubuntu or Debian) and just compile things as intended there. The comment linked above should just work.

https://ubuntu.com/tutorials/how-to-run-ubuntu-desktop-on-a-virtual-machine-using-virtualbox#1-overview

Not for you? Read on.

==============================

First, get the GCC GNU Compiler installed on your machine

Microsoft has a pretty good guide here:
https://code.visualstudio.com/docs/languages/cpp

You can stop when you hit the Hello World part of that article but it's worth doing to make sure everything is working.

If that doesn't work then the CodeBlocks route might work for you:
https://www.digitalocean.com/community/tutorials/c-compiler-windows-gcc

Install some dependencies
Namely, rsync, find and a few others.

MySys is probably the easiest way to go for most.
https://www.msys2.org/wiki/MSYS2-installation/

Open the MySys MinGWx64 exe.

Then install rsync via Pacman:
https://packages.msys2.org/package/rsync

Saves you copy-pasta'ing stuff into bin/src and gets the Makefile working.

Hacky uname fix
If the uname command in Makefile throws an error this hack worked for me.

Create a file in your $PATH somewhere, like C:\Windows\uname.ps1

Then add:
Write-Output "Windows"

Again, this is hacky but it stops it throwing an error.

Ensure you've got SDL2 and SDL2_image somewhere you can include
You can either go the .gitmodules route (preferred) or download the SDL2 source yourself and store it somewhere on your system.

Whatever works, if the latter then this is a good guide:
https://www.matsson.com/prog/sdl2-mingw-w64-tutorial.php

Compile error for ssize_t being undefined
If you're not on a POSIX system like Windows then you might not have ssize_t defined.

This sorts that:

// because ssize_t is only on POSIX systems and not windows
// see: https://github.com/ycm-core/YouCompleteMe/issues/3949
#if defined(_MSC_VER)
#include <BaseTsd.h>
typedef SSIZE_T ssize_t;
#endif

In context, the top of my file looks like:

#include <stdio.h>
#include <stdint.h>
#include <stdbool.h>
#include <ctype.h>
#include <string.h>
#include <sys/types.h>
#include <math.h>
#include <SDL.h>

// because ssize_t is only on POSIX systems and not windows
// see: https://github.com/ycm-core/YouCompleteMe/issues/3949
#if defined(_MSC_VER)
#include <BaseTsd.h>
typedef SSIZE_T ssize_t;
#endif

#define ASSERT(_e, ...) if (!(_e)) { fprintf(stderr, __VA_ARGS__); exit(1); }

typedef float    f32;
typedef double   f64;
typedef uint8_t  u8;
typedef uint16_t u16;
typedef uint32_t u32;
typedef uint64_t u64;
typedef int8_t   i8;
typedef int16_t  i16;
typedef int32_t  i32;
typedef int64_t  i64;
typedef size_t   usize;
typedef ssize_t  isize;

#define PI 3.14159265359f
...

Compile
I haven't amended the Makefile yet but this command worked for me after storing the SDL source on my system.

I used the same flags as what the Makefile commands would use if you're wondering where all that comes from.

SDL SOURCE STORED OUTWITH THIS REPO (What I did):
gcc --verbose -o bin/src/main_doom_win.o -MMD -c -std=c1x -O2 -g -ftemplate-backtrace-limit=0 -Wall -Wextra -Wpedantic -Wfloat-equal -Wstrict-aliasing -Wswitch-default -Wformat=2 -Wno-newline-eof -Wno-unused-parameter -Wno-strict-prototypes -Wno-fixed-enum-extension -Wno-int-to-void-pointer-cast -Wno-gnu-statement-expression -Wno-gnu-compound-literal-initializer -Wno-gnu-zero-variadic-macro-arguments -Wno-gnu-empty-struct -Wno-gnu-auto-type -Wno-gnu-empty-initializer -Wno-gnu-pointer-arith -Wno-c99-extensions -Wno-c11-extensions -iquotesrc -IC:\sdl\x86_64-w64-mingw32\include\SDL2 -IC:\sdl\x86_64-w64-mingw32\bin\sdl2-config -IC:\sdl-image\x86_64-w64-mingw32\include\SDL2 src/main_doom.c

SDL SOURCE FROM GITMODULES (you might need to source the sdl2-config file yourself or make it from source):
gcc --verbose -o bin/src/main_doom_win.o -MMD -c -std=c1x -O2 -g -ftemplate-backtrace-limit=0 -Wall -Wextra -Wpedantic -Wfloat-equal -Wstrict-aliasing -Wswitch-default -Wformat=2 -Wno-newline-eof -Wno-unused-parameter -Wno-strict-prototypes -Wno-fixed-enum-extension -Wno-int-to-void-pointer-cast -Wno-gnu-statement-expression -Wno-gnu-compound-literal-initializer -Wno-gnu-zero-variadic-macro-arguments -Wno-gnu-empty-struct -Wno-gnu-auto-type -Wno-gnu-empty-initializer -Wno-gnu-pointer-arith -Wno-c99-extensions -Wno-c11-extensions -iquotesrc -Ilib/SDL/include -Ilib/SDL/sdl2-config -Ilib/SDL_image src/main_doom.c

Without the -W flags you can see the most important bits:
gcc --verbose -o bin/src/main_doom_win.o -MMD -c -std=c1x -O2 -g -iquotesrc -IC:\sdl\x86_64-w64-mingw32\include\SDL2 -IC:\sdl\x86_64-w64-mingw32\bin\sdl2-config -IC:\sdl-image\x86_64-w64-mingw32\include\SDL2 src/main_doom.c

Link

SDL SOURCE STORED OUTWITH THIS REPO (What I did):
gcc .\bin\src\main_doom_win.o -o .\bin\main_doom_win.exe -L C:\sdl\x86_64-w64-mingw32\lib -L C:\sdl-image\x86_64-w64-mingw32\lib -lmingw32 -lSDL2main -lSDL2 -lSDL2_image

SDL SOURCE FROM GITMODULES:

I think the gitmodules build route relies on you being on Linux and having the library somewhere on your system.

Like when you link with the -lSDL2 flag it'll work if you've got the libsdl2-dev package installed somewhere.

Basically when you link it'll look for .a files in the directory passed with the -L flag.

When you then do -lSDL2 what it's really saying is in that directory or somewhere gcc knows to look, find:
SDL2.a

So if you do the make libs make command in bin/lib you'll get a file in there called SDL2.a.

I'm not sure if that includes SDL2_image, it very likely doesn't.

So you'll probably have to get a hold of SDL2_image.a from making/building the SDL2_image library in your gitmodules lib directory or source it elsewhere.

gcc .\bin\src\main_doom_win.o -o .\bin\main_doom_win.exe -L .\bin\lib -lmingw32 -lSDL2main -lSDL2 -lSDL2_image

So to recap, this worked for me

Compile:
gcc --verbose -o bin/src/main_doom_win.o -MMD -c -std=c1x -O2 -g -ftemplate-backtrace-limit=0 -Wall -Wextra -Wpedantic -Wfloat-equal -Wstrict-aliasing -Wswitch-default -Wformat=2 -Wno-newline-eof -Wno-unused-parameter -Wno-strict-prototypes -Wno-fixed-enum-extension -Wno-int-to-void-pointer-cast -Wno-gnu-statement-expression -Wno-gnu-compound-literal-initializer -Wno-gnu-zero-variadic-macro-arguments -Wno-gnu-empty-struct -Wno-gnu-auto-type -Wno-gnu-empty-initializer -Wno-gnu-pointer-arith -Wno-c99-extensions -Wno-c11-extensions -iquotesrc -IC:\sdl\x86_64-w64-mingw32\include\SDL2 -IC:\sdl\x86_64-w64-mingw32\bin\sdl2-config -IC:\sdl-image\x86_64-w64-mingw32\include\SDL2 src/main_doom.c

Link:
gcc .\bin\src\main_doom_win.o -o .\bin\main_doom_win.exe -L C:\sdl\x86_64-w64-mingw32\lib -L C:\sdl-image\x86_64-w64-mingw32\lib -lmingw32 -lSDL2main -lSDL2 -lSDL2_image

This spat out a main_doom_win.exe.

Booting that I got a render similar to the stuff seen in the github example image and YouTube video.

Just with no guns! Will be fun to add that.

https://www.youtube.com/watch?v=fSjc8vLMg8c&t=8s

from doomenstein-3d.

ZGuardianTV avatar ZGuardianTV commented on June 3, 2024

why are you using gcc in windows? use msvc

from doomenstein-3d.

Related Issues (6)

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.