jdah / jdh-8

An 8-bit minicomputer with a fully custom architecture
MIT License
1.29k stars 89 forks source link

Error compiling on Windows #10

Closed hdfsyu closed 3 years ago

hdfsyu commented 3 years ago

ok now WHY do I get so many errors on WSL I use clang and some more stuff and when I type "make" this happens:

mkdir -p bin clang -o emu/libemu.o -c emu/libemu.c -std=c11 -O0 -g -Wall -Wextra -Wpedantic -Wstrict-aliasing -Wno-pointer-arith -Wno-unused-parameter -Wno-gnu-zero-variadic-macro-arguments emu/libemu.c:39:17: warning: implicit declaration of function 'clock_gettime' is invalid in C99 [-Wimplicit-function-declaration] u64 start = NOW(), ^ emu/libemu.c:9:17: note: expanded from macro 'NOW' assert(!clock_gettime(_CLOCK_MONOTONIC_RAW, &ts)); \ ^ emu/libemu.c:39:17: error: use of undeclared identifier '_CLOCK_MONOTONIC_RAW' emu/libemu.c:9:31: note: expanded from macro 'NOW' assert(!clock_gettime(_CLOCK_MONOTONIC_RAW, &ts)); \ ^ emu/libemu.c:45:15: warning: implicit declaration of function 'clock_gettime' is invalid in C99 [-Wimplicit-function-declaration] now = NOW(); ^ emu/libemu.c:9:17: note: expanded from macro 'NOW' assert(!clock_gettime(_CLOCK_MONOTONIC_RAW, &ts)); \ ^ emu/libemu.c:45:15: error: use of undeclared identifier '_CLOCK_MONOTONIC_RAW' emu/libemu.c:9:31: note: expanded from macro 'NOW' assert(!clock_gettime(_CLOCK_MONOTONIC_RAW, &ts)); \ ^ emu/libemu.c:76:41: warning: implicit declaration of function 'clock_gettime' is invalid in C99 [-Wimplicit-function-declaration] u64 sleep_time = ns_per_step - (NOW() - now); ^ emu/libemu.c:9:17: note: expanded from macro 'NOW' assert(!clock_gettime(_CLOCK_MONOTONIC_RAW, &ts)); \ ^ emu/libemu.c:76:41: error: use of undeclared identifier '_CLOCK_MONOTONIC_RAW' emu/libemu.c:9:31: note: expanded from macro 'NOW' assert(!clock_gettime(_CLOCK_MONOTONIC_RAW, &ts)); \ ^ emu/libemu.c:80:9: warning: implicit declaration of function 'nanosleep' is invalid in C99 [-Wimplicit-function-declaration] SLEEP(sleep_time); ^ emu/libemu.c:19:13: note: expanded from macro 'SLEEP' nanosleep(&req, &rem); \ ^ 4 warnings and 3 errors generated. make: *** [Makefile:38: emu/libemu.o] Error 1 yeahhhhhhhhhhhhhhh can u help?

Kylogias commented 3 years ago

With my windows compatibility patch, #4 (pretty sure you're using windows, right?), it compiles just fine on my machine, try using it. This is pretty much a duplicate of #1 by the looks of things. Make sure to follow the instructions in the readme in my patch. I didn't get the nanosleep error though

hdfsyu commented 3 years ago

With my windows compatibility patch, #4 (pretty sure you're using windows, right?), it compiles just fine on my machine, try using it. This is pretty much a duplicate of #1 by the looks of things. Make sure to follow the instructions in the readme in my patch. I didn't get the nanosleep error though

thanks for the help I created a fork and applied ur changes but it gives me this on windows (without WSL): /bin/sh: -c: line 2: syntax error: unexpected end of file make: [Makefile:44: dirs] Error 2 and on WSL with the windows patch: /bin/sh: 1: Syntax error: end of file unexpected (expecting "then") make: [Makefile:44: dirs] Error 2

Kylogias commented 3 years ago

makefile.zip I'll apply a patch to my branch, here's a new makefile that should work

jdah commented 3 years ago

Fixed in cd6cf42a3e0e333939255c5fdbc5202d122e727e. Can you confirm that latest master works @hdfsyu?

hdfsyu commented 3 years ago

Fixed in cd6cf42. Can you confirm that latest master works @hdfsyu?

@jdah NOPE doesnt work and just says this: mkdir -p bin clang -o emu/libemu.o -c emu/libemu.c -std=c11 -O0 -g -Wall -Wextra -Wpedantic -Wstrict-aliasing -IC:/SDL2-w64/include/ -v -Wno-pointer-arith -Wno-unused-parameter -Wno-gnu-zero-variadic-macro-arguments Android (7155654, based on r399163b1) clang version 11.0.5 (https://android.googlesource.com/toolchain/llvm-project 87f1315dfbea7c137aa2e6d362dbb457e388158d) Target: armv7a-unknown-linux-android19 Thread model: posix InstalledDir: E:\viyaa\sdks\ndk\22.1.7171670\build\tools\toolchain\bin Found candidate GCC installation: E:\viyaa\sdks\ndk\22.1.7171670\build\tools\toolchain\bin/../lib/gcc/arm-linux-androideabi\4.9.x Selected GCC installation: E:\viyaa\sdks\ndk\22.1.7171670\build\tools\toolchain\bin/../lib/gcc/arm-linux-androideabi/4.9.x Candidate multilib: thumb;@mthumb Candidate multilib: armv7-a;@march=armv7-a Candidate multilib: armv7-a/thumb;@march=armv7-a@mthumb Candidate multilib: .; Selected multilib: armv7-a;@march=armv7-a (in-process) "E:\viyaa\sdks\ndk\22.1.7171670\build\tools\toolchain\bin\clang110.exe" -cc1 -triple armv7-unknown-linux-android19 -emit-obj -mrelax-all -mnoexecstack -disable-free -disable-llvm-verifier -discard-value-names -main-file-name libemu.c -mrelocation-model pic -pic-level 2 -pic-is-pie -mframe-pointer=all -fno-rounding-math -mconstructor-aliases -target-cpu generic -target-feature +soft-float-abi -target-feature +vfp2 -target-feature +vfp2sp -target-feature +vfp3 -target-feature +vfp3d16 -target-feature +vfp3d16sp -target-feature +vfp3sp -target-feature -fp16 -target-feature -vfp4 -target-feature -vfp4d16 -target-feature -vfp4d16sp -target-feature -vfp4sp -target-feature -fp-armv8 -target-feature -fp-armv8d16 -target-feature -fp-armv8d16sp -target-feature -fp-armv8sp -target-feature -fullfp16 -target-feature +fp64 -target-feature +d32 -target-feature +neon -target-feature -crypto -target-feature -fp16fml -target-abi aapcs-linux -mfloat-abi soft -fallow-half-arguments-and-returns -fno-split-dwarf-inlining -debug-info-kind=limited -dwarf-version=4 -debugger-tuning=gdb -v -resource-dir "E:\viyaa\sdks\ndk\22.1.7171670\build\tools\toolchain\lib64\clang\11.0.5" -I C:/SDL2-w64/include/ -internal-isystem "E:\viyaa\sdks\ndk\22.1.7171670\build\tools\toolchain\bin/../sysroot/usr/local/include" -internal-isystem "E:\viyaa\sdks\ndk\22.1.7171670\build\tools\toolchain\lib64\clang\11.0.5\include" -internal-externc-isystem "E:\viyaa\sdks\ndk\22.1.7171670\build\tools\toolchain\bin/../sysroot/usr/include/arm-linux-androideabi" -internal-externc-isystem "E:\viyaa\sdks\ndk\22.1.7171670\build\tools\toolchain\bin/../sysroot/include" -internal-externc-isystem "E:\viyaa\sdks\ndk\22.1.7171670\build\tools\toolchain\bin/../sysroot/usr/include" -O0 -Wall -Wextra -Wpedantic -Wstrict-aliasing -Wno-pointer-arith -Wno-unused-parameter -Wno-gnu-zero-variadic-macro-arguments -std=c11 -fdebug-compilation-dir "E:\jdh-8-master" -ferror-limit 19 -fmessage-length=237 -fno-signed-char -fgnuc-version=4.2.1 -fcolor-diagnostics -o emu/libemu.o -x c emu/libemu.c clang -cc1 version 11.0.5 based upon LLVM 11.0.5git default target x86_64-w64-windows-gnu ignoring nonexistent directory "E:\viyaa\sdks\ndk\22.1.7171670\build\tools\toolchain\bin/../sysroot/include"

include "..." search starts here:

include <...> search starts here:

C:/SDL2-w64/include E:\viyaa\sdks\ndk\22.1.7171670\build\tools\toolchain\bin/../sysroot/usr/local/include E:\viyaa\sdks\ndk\22.1.7171670\build\tools\toolchain\lib64\clang\11.0.5\include E:\viyaa\sdks\ndk\22.1.7171670\build\tools\toolchain\bin/../sysroot/usr/include/arm-linux-androideabi E:\viyaa\sdks\ndk\22.1.7171670\build\tools\toolchain\bin/../sysroot/usr/include End of search list. emu/libemu.c:45:17: error: use of undeclared identifier '_CLOCK_MONOTONIC_RAW' u64 start = NOW(), ^ emu/libemu.c:15:31: note: expanded from macro 'NOW' assert(!clock_gettime(MONO_CLOCK, &ts)); \ ^ emu/libemu.c:10:21: note: expanded from macro 'MONO_CLOCK'

define MONO_CLOCK _CLOCK_MONOTONIC_RAW

                       ^

emu/libemu.c:51:15: error: use of undeclared identifier '_CLOCK_MONOTONIC_RAW' now = NOW(); ^ emu/libemu.c:15:31: note: expanded from macro 'NOW' assert(!clock_gettime(MONO_CLOCK, &ts)); \ ^ emu/libemu.c:10:21: note: expanded from macro 'MONO_CLOCK'

define MONO_CLOCK _CLOCK_MONOTONIC_RAW

                       ^

emu/libemu.c:82:41: error: use of undeclared identifier '_CLOCK_MONOTONIC_RAW' u64 sleep_time = ns_per_step - (NOW() - now); ^ emu/libemu.c:15:31: note: expanded from macro 'NOW' assert(!clock_gettime(MONO_CLOCK, &ts)); \ ^ emu/libemu.c:10:21: note: expanded from macro 'MONO_CLOCK'

define MONO_CLOCK _CLOCK_MONOTONIC_RAW

                       ^

3 errors generated. make: *** [Makefile:51: emu/libemu.o] Error 1

jdah commented 3 years ago

Why are you building for armv7? Looks like you're using the android SDK clang.

jdah commented 3 years ago

Closing due to lack of response, this is not an issue with the project - will not support Android targets.