TheGoodDoktor / 8BitAnalysers

MIT License
86 stars 13 forks source link

linux make fails on CPC branch #25

Closed YnotZer0 closed 10 months ago

YnotZer0 commented 10 months ago

Followed instructions, git clone recursive, when on last step for 'make' I get the following error. What am I missing?

tony@tony-magicbook:~/dev/amstrad/8BitAnalysers/Source/ZXSpectrum/build$ make [ 0%] Building C object glfw/src/CMakeFiles/glfw.dir/context.c.o [ 1%] Building C object glfw/src/CMakeFiles/glfw.dir/init.c.o [ 1%] Building C object glfw/src/CMakeFiles/glfw.dir/input.c.o [ 2%] Building C object glfw/src/CMakeFiles/glfw.dir/monitor.c.o [ 2%] Building C object glfw/src/CMakeFiles/glfw.dir/platform.c.o [ 3%] Building C object glfw/src/CMakeFiles/glfw.dir/vulkan.c.o [ 3%] Building C object glfw/src/CMakeFiles/glfw.dir/window.c.o [ 3%] Building C object glfw/src/CMakeFiles/glfw.dir/egl_context.c.o [ 4%] Building C object glfw/src/CMakeFiles/glfw.dir/osmesa_context.c.o [ 4%] Building C object glfw/src/CMakeFiles/glfw.dir/null_init.c.o [ 5%] Building C object glfw/src/CMakeFiles/glfw.dir/null_monitor.c.o [ 5%] Building C object glfw/src/CMakeFiles/glfw.dir/null_window.c.o [ 6%] Building C object glfw/src/CMakeFiles/glfw.dir/null_joystick.c.o [ 6%] Building C object glfw/src/CMakeFiles/glfw.dir/posix_module.c.o [ 7%] Building C object glfw/src/CMakeFiles/glfw.dir/posix_time.c.o [ 7%] Building C object glfw/src/CMakeFiles/glfw.dir/posix_thread.c.o [ 8%] Building C object glfw/src/CMakeFiles/glfw.dir/x11_init.c.o [ 8%] Building C object glfw/src/CMakeFiles/glfw.dir/x11_monitor.c.o [ 9%] Building C object glfw/src/CMakeFiles/glfw.dir/x11_window.c.o [ 9%] Building C object glfw/src/CMakeFiles/glfw.dir/xkb_unicode.c.o [ 10%] Building C object glfw/src/CMakeFiles/glfw.dir/glx_context.c.o [ 10%] Building C object glfw/src/CMakeFiles/glfw.dir/linux_joystick.c.o [ 11%] Building C object glfw/src/CMakeFiles/glfw.dir/posix_poll.c.o [ 11%] Linking C static library libglfw3.a [ 11%] Built target glfw [ 11%] Building CXX object CMakeFiles/SpectrumAnalyser.dir/home/tony/dev/amstrad/8BitAnalysers/Source/Shared/CodeAnalyser/6502/CodeAnalyser6502.cpp.o In file included from /home/tony/dev/amstrad/8BitAnalysers/Source/Shared/CodeAnalyser/6502/../CodeAnalyser.h:12, from /home/tony/dev/amstrad/8BitAnalysers/Source/Shared/CodeAnalyser/6502/CodeAnalyser6502.cpp:2: /home/tony/dev/amstrad/8BitAnalysers/Source/Shared/CodeAnalyser/6502/../Debugger.h:5:10: fatal error: chips/z80.h: No such file or directory 5 | #include <chips/z80.h> | ^~~~~~~~~~~~~ compilation terminated. make[2]: *** [CMakeFiles/SpectrumAnalyser.dir/build.make:76: CMakeFiles/SpectrumAnalyser.dir/home/tony/dev/amstrad/8BitAnalysers/Source/Shared/CodeAnalyser/6502/CodeAnalyser6502.cpp.o] Error 1 make[1]: *** [CMakeFiles/Makefile2:172: CMakeFiles/SpectrumAnalyser.dir/all] Error 2 make: *** [Makefile:136: all] Error 2

I initially attempted this under the CPC folder (as that is what I really wanted to compile/build/run), but that gave same error.

Colourclash commented 10 months ago

Hi,

I presume you are trying to build the cpc branch?

I think it can't find the chips code because I don't have the chips submodule setup correctly. There should be the chips source code in Source/Vendor/chips directory but for some reason it doesn't populate this directory with the chips code when you do git clone recursive.

I'll try to take a look at it. If you want a quick workaround then download the chips code from https://github.com/floooh/chips and put it in Source/Vendor/chips

I really struggled setting the chips submodule up and I've spent quite a bit of time looking into it. I've tried and given up a few times.

Let me know how you get on.

Cheers

YnotZer0 commented 10 months ago

yep - that did the trick. Now to repeat for the CPC.

image

YnotZer0 commented 10 months ago

I was a bit too happy, a bit too quickly. The CPC build failed differently:

[ 57%] Building CXX object CMakeFiles/CPCAnalyser.dir/home/tony/dev/amstrad/8BitAnalysers/Source/Shared/Util/Linux/FileUtil_Linux.cpp.o [ 58%] Building CXX object CMakeFiles/CPCAnalyser.dir/home/tony/dev/amstrad/8BitAnalysers/Source/Shared/ImGuiSupport/GLFW/ImGuiTexture_GLFW.cpp.o [ 59%] Building CXX object CMakeFiles/CPCAnalyser.dir/CPCEmu.cpp.o [ 60%] Building CXX object CMakeFiles/CPCAnalyser.dir/CPCScreen.cpp.o [ 61%] Building C object CMakeFiles/CPCAnalyser.dir/CpcChipsImpl.c.o /home/tony/dev/amstrad/8BitAnalysers/Source/CPC/CpcChipsImpl.c:8:10: error: conflicting types for ‘GetCpcColour’; have ‘uint32_t(unsigned int)’ {aka ‘unsigned int(unsigned int)’} 8 | uint32_t GetCpcColour(unsigned int index) | ^~~~~~~~~~~~ In file included from /home/tony/dev/amstrad/8BitAnalysers/Source/CPC/CpcChipsImpl.c:3: /home/tony/dev/amstrad/8BitAnalysers/Source/CPC/CpcChipsImpl.h:25:10: note: previous declaration of ‘GetCpcColour’ with type ‘uint32_t(int)’ {aka ‘unsigned int(int)’} 25 | uint32_t GetCpcColour(int index); | ^~~~~~~~~~~~ make[2]: *** [CMakeFiles/CPCAnalyser.dir/build.make:580: CMakeFiles/CPCAnalyser.dir/CpcChipsImpl.c.o] Error 1 make[1]: *** [CMakeFiles/Makefile2:116: CMakeFiles/CPCAnalyser.dir/all] Error 2 make: *** [Makefile:91: all] Error 2 tony@tony-magicbook:~/dev/amstrad/8BitAnalysers/Source/CPC/build$

Not sure if it was the right thing to do, but it seemed logical to make the 2 declarations match. I edited: CpcChipsImpl.c to just be (int index)

That seems to have gotten me further. However, the next issue comes further on: image

Is that just a missing reference in the CMakeList.txt file? as the file exists but it's within the Viewers directory?

Colourclash commented 10 months ago

I've fixed the GetCpcColour() issue now. If you get latest on the cpc branch it should build now.

Not sure what the CpcGraphicsView.h issue is. Are you still getting that?

I managed to build and run the linux version under linux for windows so I can verify it works here.

Hopefully will be merging back into master soon so look out for that!

Colourclash commented 10 months ago

When you grab latest you will need to run "cmake .." again because I've added and removed some source files.

YnotZer0 commented 10 months ago

hmmm.. okay, I'm running Ubuntu 22.04 linux, I did a fresh git clone -b cpc to get that branch, I copied the /Vendor/chips directory over and within the CPC directory I made a new /build directory, did a "cmake .." and then ran "make", it got past the GetCpcColour(), but still fell over at 74%: image

YnotZer0 commented 10 months ago

ah, I think I see the problem.... "FrameTraceViewer.cpp" #include "CpcGraphicsView.h". Linux is a bit pickier about upper / lower case usage, the file is actually "CPCGraphicsView.h" I modified "FrameTraceViewer.cpp" to be "CPCGraphicsView.h" "mkdir build" "cd build" "cmake .." "make" image

looking better!

and it works now too. image

Right, now I can load up a game I wrote back in 2009 and see if I can find out the "cheat code key press" that I know I coded into it, but for the life of me I cannot remember what it was.

Colourclash commented 10 months ago

Glad you got it working! Feel free to reach out if you need more help. Good luck with finding the cheat code. The Events view in the debugger might be useful. It has events for reading the keyboard, so you can see what keys it is reading.