Open thegame4craft opened 2 years ago
Remove the first _ in _CLOCK_MONOTONIC_RAW
in Libemu.c, line 10
now i getting this big error: https://pastebin.com/8FrU7HeF
C:/Users/Robin/Programme/gcc/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/8.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: cannot find -lsdl2main
C:/Users/Robin/Programme/gcc/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/8.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: cannot find -lsdl2
You're missing SDL2. I'm not sure how to fix this on Windows, but try checking out the SDL website or building on WSL.
iirc on MSYS2, there's SDL2 packages
i think i fixed it. but now i got a other error:
/usr/lib/gcc/x86_64-pc-msys/10.2.0/../../../../x86_64-pc-msys/bin/ld: cannot find -lmingw32
ok searching a bit on google helps
but now i got an other error. i tryed a bit with include paths and libpaths but it didn't work.
gcc -o bin/emu -LC:/Users/Robin/AppData/Local/MSYS2/mingw64/lib -lmingw32 -lsdl2main -lsdl2 -lws2_32 emu/emu.o emu/kb.o emu/libemu.o emu/mod.o emu/screen.o
C:/Users/Robin/AppData/Local/MSYS2/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/11.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: emu/emu.o: in function `main':
C:\Users\Robin\projects\jdh-8\jdh-8-master/emu/emu.c:244: multiple definition of `main'; C:/Users/Robin/AppData/Local/MSYS2/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/11.2.0/../../../../x86_64-w64-mingw32/lib/../lib/libmingw32.a(lib64_libmingw32_a-crt0_c.o):C:/_/M/mingw-w64-crt-git/src/mingw-w64/mingw-w64-crt/crt/crt0_c.c:17: first defined here
C:/Users/Robin/AppData/Local/MSYS2/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/11.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:/Users/Robin/AppData/Local/MSYS2/mingw64/lib/libsdl2main.a(SDL_windows_main.c.obj):SDL_windows_ma:(.text+0x15d): undefined reference to `SDL_main'
C:/Users/Robin/AppData/Local/MSYS2/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/11.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: emu/emu.o: in function `stop_simulation':
C:\Users\Robin\projects\jdh-8\jdh-8-master/emu/emu.c:23: undefined reference to `poll'
C:/Users/Robin/AppData/Local/MSYS2/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/11.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: emu/emu.o: in function `command':
C:\Users\Robin\projects\jdh-8\jdh-8-master/emu/emu.c:99: undefined reference to `strlcpy'
C:/Users/Robin/AppData/Local/MSYS2/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/11.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:\Users\Robin\projects\jdh-8\jdh-8-master/emu/emu.c:170: undefined reference to `fmemopen'
C:/Users/Robin/AppData/Local/MSYS2/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/11.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: emu/emu.o: in function `main':
C:\Users\Robin\projects\jdh-8\jdh-8-master/emu/emu.c:287: undefined reference to `readline'
C:/Users/Robin/AppData/Local/MSYS2/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/11.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:\Users\Robin\projects\jdh-8\jdh-8-master/emu/emu.c:295: undefined reference to `add_history'
C:/Users/Robin/AppData/Local/MSYS2/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/11.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: emu/screen.o: in function `screen_destroy':
C:\Users\Robin\projects\jdh-8\jdh-8-master/emu/screen.c:35: undefined reference to `SDL_DestroyTexture'
C:/Users/Robin/AppData/Local/MSYS2/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/11.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:\Users\Robin\projects\jdh-8\jdh-8-master/emu/screen.c:36: undefined reference to `SDL_DestroyRenderer'
C:/Users/Robin/AppData/Local/MSYS2/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/11.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:\Users\Robin\projects\jdh-8\jdh-8-master/emu/screen.c:37: undefined reference to `SDL_DestroyWindow'
C:/Users/Robin/AppData/Local/MSYS2/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/11.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:\Users\Robin\projects\jdh-8\jdh-8-master/emu/screen.c:38: undefined reference to `SDL_Quit'
C:/Users/Robin/AppData/Local/MSYS2/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/11.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: emu/screen.o: in function `screen_tick':
C:\Users\Robin\projects\jdh-8\jdh-8-master/emu/screen.c:55: undefined reference to `SDL_PollEvent'
C:/Users/Robin/AppData/Local/MSYS2/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/11.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: emu/screen.o: in function `fchild':
C:\Users\Robin\projects\jdh-8\jdh-8-master/emu/screen.c:96: undefined reference to `SDL_SetRenderDrawColor'
C:/Users/Robin/AppData/Local/MSYS2/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/11.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:\Users\Robin\projects\jdh-8\jdh-8-master/emu/screen.c:97: undefined reference to `SDL_RenderClear'
C:/Users/Robin/AppData/Local/MSYS2/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/11.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:\Users\Robin\projects\jdh-8\jdh-8-master/emu/screen.c:98: undefined reference to `SDL_UpdateTexture'
C:/Users/Robin/AppData/Local/MSYS2/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/11.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:\Users\Robin\projects\jdh-8\jdh-8-master/emu/screen.c:99: undefined reference to `SDL_RenderCopy'
C:/Users/Robin/AppData/Local/MSYS2/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/11.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:\Users\Robin\projects\jdh-8\jdh-8-master/emu/screen.c:104: undefined reference to `SDL_RenderPresent'
C:/Users/Robin/AppData/Local/MSYS2/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/11.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:\Users\Robin\projects\jdh-8\jdh-8-master/emu/screen.c:105: undefined reference to `SDL_UpdateWindowSurface'
C:/Users/Robin/AppData/Local/MSYS2/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/11.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: emu/screen.o: in function `screen_init':
C:\Users\Robin\projects\jdh-8\jdh-8-master/emu/screen.c:123: undefined reference to `SDL_Init'
C:/Users/Robin/AppData/Local/MSYS2/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/11.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:\Users\Robin\projects\jdh-8\jdh-8-master/emu/screen.c:125: undefined reference to `SDL_CreateWindow'
C:/Users/Robin/AppData/Local/MSYS2/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/11.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:\Users\Robin\projects\jdh-8\jdh-8-master/emu/screen.c:132: undefined reference to `SDL_CreateRenderer'
C:/Users/Robin/AppData/Local/MSYS2/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/11.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:\Users\Robin\projects\jdh-8\jdh-8-master/emu/screen.c:136: undefined reference to `SDL_CreateTexture'
collect2.exe: error: ld returned 1 exit status
make: *** [Makefile:63: emu] Error 1
Yes, you're missing both SDL (still, not sure why) and some of the POSIX functions (poll, strlcpy, readline). Try building under WSL.
i installed sdl 3 times.i installed it (sdl and sdl2) in msys2 2 times and one time in windows with path.
The problem is why i cant use wsl is, i cant install it because im not the pc admin
Try with the newest commit :-) make sure you make clean
first.
with the newest commit it gives me:
gcc -o bin/emu emu/emu.o emu/kb.o emu/libemu.o emu/mod.o emu/screen.o emu/win/mman.o emu/win/win.o -lsdl2main -lsdl2 -LC:/Users/Robin/AppData/Local/MSYS2/mingw64/lib/ -Lws2_32
emu/win/win.o: In function `poll':
C:\Users\Robin\AppData\Local\cygwin\home\Robin\projects\jdh-8\jdh-8-master/emu/win/win.c:59: undefined reference to `__imp_select'
C:\Users\Robin\AppData\Local\cygwin\home\Robin\projects\jdh-8\jdh-8-master/emu/win/win.c:64: undefined reference to `__WSAFDIsSet'
C:\Users\Robin\AppData\Local\cygwin\home\Robin\projects\jdh-8\jdh-8-master/emu/win/win.c:65: undefined reference to `__WSAFDIsSet'
C:\Users\Robin\AppData\Local\cygwin\home\Robin\projects\jdh-8\jdh-8-master/emu/win/win.c:66: undefined reference to `__WSAFDIsSet'
C:/Users/Robin/Programme/gcc/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/8.1.0/../../../../x86_64-w64-mingw32/lib/../lib/libmingw32.a(lib64_libmingw32_a-crt0_c.o):crt0_c.c:(.text.startup+0x2e): undefined reference to `WinMain'
collect2.exe: error: ld returned 1 exit status
make: *** [emu] Fehler 1
when i look on this line i see:
so after some tries i got:
C:/Users/Robin/AppData/Local/MSYS2/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/11.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:\Users\Robin\projects\jdh-8\jdh-8-master/emu/win/win.c:37: undefined reference to `__WSAFDIsSet'
C:/Users/Robin/AppData/Local/MSYS2/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/11.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:\Users\Robin\projects\jdh-8\jdh-8-master/emu/win/win.c:38: undefined reference to `__WSAFDIsSet'
C:/Users/Robin/AppData/Local/MSYS2/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/11.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:\Users\Robin\projects\jdh-8\jdh-8-master/emu/win/win.c:39: undefined reference to `__WSAFDIsSet'
collect2.exe: error: ld returned 1 exit status
The problem is why i cant use wsl is, i cant install it because im not the pc admin
Try using something like azure or google cloud servers.
That sounds good, but i need it for windows, not linux
now after a few tries today i made it complete. i needed just to rename builtin_macros.c in builtin_macros.h, add #pragma once
before code and need to include it in asm.h
I cloned the repo today and started compiling on windows. i use MSYS2-MinGW64 and followed the instructions in the readme. but i get some syntax errors. The full log
What should i do?