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

Can't compile the program #174

Open
NoobJsPerson opened this issue Jun 22, 2024 · 5 comments
Open

Can't compile the program #174

NoobJsPerson opened this issue Jun 22, 2024 · 5 comments

Comments

@NoobJsPerson
Copy link

when i run make i get this error

gcc -g -Wall -Wextra -Werror -I./include -c src/main.c -o obj/main.o
gcc -g -Wall -Wextra -Werror -I./include -c src/files.c -o obj/files.o
src/files.c: In function 'load_files':
src/files.c:155:22: error: implicit declaration of function 'scandir'; did you mean 'srand'? [-Werror=implicit-function-declaration]
  155 |     int ex_dirs_ct = scandir(DIR_PATH, &nmlist, NULL, alphasort);
      |                      ^~~~~~~
      |                      srand
src/files.c:167:27: error: 'struct dirent' has no member named 'd_type'
  167 |         int file_type = de->d_type;
      |                           ^~
src/files.c:194:32: error: 'struct dirent' has no member named 'd_type'
  194 |             int file_type = nde->d_type;
      |                                ^~
cc1.exe: all warnings being treated as errors
make: *** [makefile:19: obj/files.o] Error 1

btw I am on Windows 10.

@sleaper
Copy link
Contributor

sleaper commented Jun 23, 2024

The scandir function is part of the POSIX standard library, which I think is not natively supported by Windows. I recommend using WSL (Windows Subsystem for Linux), which is easy to download and use.

I want to focus on developing the actual content. However, if someone else wants to add support for Windows, they are welcome to do so.

@NoobJsPerson
Copy link
Author

I tried WSL and it worked wonders. However I started trying to add support for Windows and managed to reimplement scandir in a way that is sufficient for the program. I still have more functions i need to implement as well. I will make a PR when I am done.

@danwritecode
Copy link
Owner

The scandir function is part of the POSIX standard library, which I think is not natively supported by Windows. I recommend using WSL (Windows Subsystem for Linux), which is easy to download and use.

I want to focus on developing the actual content. However, if someone else wants to add support for Windows, they are welcome to do so.

yup this is exactly why!

@NoobJsPerson thanks for taking the time to implement that, i'll take a look at your PR as soon as it's ready.

@NoobJsPerson
Copy link
Author

Hey! I worked on implementing clings for Windows for a while and i finally got it to compile. it took so much effort and it doesn't even work (it cant read directory contents even when i change paths to Windows style paths). I could make a draft PR if you guys wanna help. but I personally think its not worth it and it will atmost make the codebase incredibly hard to work with.

@danwritecode
Copy link
Owner

Hey! I worked on implementing clings for Windows for a while and i finally got it to compile. it took so much effort and it doesn't even work (it cant read directory contents even when i change paths to Windows style paths). I could make a draft PR if you guys wanna help. but I personally think its not worth it and it will atmost make the codebase incredibly hard to work with.

why don't you go ahead and make a draft PR so that we can at least see the code. I don't want your hard work to be for nothing!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants