Closed tokumeiwokiboushimasu closed 4 years ago
Thanks!⭐ I fixed this.
Thunks. Now it compiles. But xnp2kai stops running immediately with Segmentation Fault. The backtrace is below.
at /lib64/libgobject-2.0.so.0
at /lib64/libgobject-2.0.so.0
at /lib64/libgobject-2.0.so.0
at /lib64/libgdk-x11-2.0.so.0
I checked working correctly on Ubuntu 20.04. (Work some games on MS-DOS 5.0A) How do you use environment?
My envionment is Fedora 32 (x86_64).
I could build and work xnp2kai on Fedora 32. (But keyboard works strangely...)
I wrote README.md to need yum packages when building NP2kai.
Yeah I have already installed these packages.
Actually, before you changed build system from auto tools to cmake, it worked perfectly.
I tested xnp21kai, and it also dies with segmentation fault...
By the way, Fedora's package tool is now dnf instead of yum.
Ah, yum changed!? I need to understand more computer environment. I'm sorry for my poor knowledge and inconvenience to you...😓
My Fedora 32 shows like follow fig.
Your backtrace is seem GLib/GObject's problem. There is some incorrect in my implementation maybe.
Anyway, the error with i286 building has been fixed. So I close this issue. Thanks.
Oh, I want ask one.
How about work on your environment with removing 'SUPPORT_VIDEOFILTER' from CMakeList.txt (line 236)? This is new function, and this may not have removed the bug. Sorry.
Sorry for the late reply. It still crashes after removing 'SUPPORT_VIDEOFILTER' from CMakeList.txt.
Thank you!
How do you use graphic HW/Driver?
I'm using a normal laptop with Skylake's internal GPU. I'm not using Wayland. Just using Fedora's X11 driver.
How work build option '-D USE_SDL2=OFF'? (SDL1 using)
xnp2kai_sdl1 also crashes with segmentation fault.
Can you compile and run follow code?
test.c
#include <gtk/gtk.h>
int main(int argc,char *argv[])
{
GtkWidget *window;
gtk_init(&argc, &argv);
window = gtk_window_new(GTK_WINDOW_TOPLEVEL);
gtk_widget_show(window);
gtk_main();
return 0;
}
Compile.
$ gcc test.c -o test `pkg-config --cflags --libs gtk+-2.0`
Run.
$ ./test
Running the code makes an empty window. No segmentation fault.
One note. When running cmake, there are warnings below.
CMake Warning (dev) at CMakeLists.txt:848: Syntax Warning in cmake code at column 54
Argument not separated from preceding token by whitespace. This warning is for project developers. Use -Wno-dev to suppress it.
CMake Warning (dev) at CMakeLists.txt:864: Syntax Warning in cmake code at column 56
Argument not separated from preceding token by whitespace. This warning is for project developers. Use -Wno-dev to suppress it.
CMake Warning (dev) at CMakeLists.txt:923: Syntax Warning in cmake code at column 54
Argument not separated from preceding token by whitespace. This warning is for project developers. Use -Wno-dev to suppress it.
CMake Warning (dev) at CMakeLists.txt:939: Syntax Warning in cmake code at column 56
Argument not separated from preceding token by whitespace. This warning is for project developers. Use -Wno-dev to suppress it.
CMake Warning (dev) at CMakeLists.txt:998: Syntax Warning in cmake code at column 54
Argument not separated from preceding token by whitespace. This warning is for project developers. Use -Wno-dev to suppress it.
CMake Warning (dev) at CMakeLists.txt:1014: Syntax Warning in cmake code at column 56
Argument not separated from preceding token by whitespace. This warning is for project developers. Use -Wno-dev to suppress it.
A windows should be displayed by this code...Umm. I thank Graphics Board matter.
Those syntax warnings are for OpenDingux building. (I fixed warnings.)
A windows should be displayed by this code...Umm.
Yes, a window which is empty (just white) is displayed. I think it is normal even on my environment.
I commentted out the lines from 151 to 156 of main.c and it still fails with segmentation fault on line 159. So, apparently something is wrong. But the program above runs normally, so I think if there is some mistake of linking libray for example linking a non-thread-safe libraly or something? If so, it makes sense why the configure script version was OK and the cmake version is problematic. What do you think?
I waybacked Autotools files. Please try.
./autogen.sh -> ./configure -> make
I found no writing about 'XF86VidMode extension' in CMakeList.txt. This maybe occur something wrong.
Edit: 'XF86VidMode extension' was handled in CMake correctly.
Seems there's no autogen.sh ...
I copied other project's autogen.sh, and editted configure.ac and Makefile.am a bit (Removed 'no-installinfo' from configure.ac, and removed about np2tool/np2tool.d88 from Makefile.am). Now, xnp2kai can build successfully, and it runs perfectly.
Ahh, doesn't run perfectly in fact. ROM BASIC boots (I can input a number when asked 'How many files'), but doesn't respond to any key inputs after it displays 'OK'. It doesn't display the cursor caret. Disk BASIC seems OK. I don't know since when this problem has been there.
Oh, sorry. I add it. Please try this.
Still I have to comment out the line 8 of Makefile.am. But other than that, building has no problem. And this time, both the ROM BASIC and disk BASIC do not respond to any input. Other games that I have seem to have no problem.
Oh, sorry. BASIC's problem is just my mistake. Specifying the right config file resolves the problem.
I add to Freetype and Fontconfig library link to CMakeLists.txt. How work this?
My purpose is to eliminate the difference between CMake and Autotools. After all, Autotools will be abolished.
I add to Freetype and Fontconfig library link to CMakeLists.txt. How work this?
Segmentation Fault. Same as the previous CMakeList.txt's case.
I compared Makefiles that generated by CMake and Autotools.
CMake one, link dynamic libraries. (/usr/lib/x86_64-linux-gnu/libglib-2.0.so) Autotools one, link by name (-lglib-2.0). Probably static libraries.
There shouldn't be difference...😣 But I changed CMakeLists.txt to glib-2.0 is static linked.
I'm sorry to you trying many times. Please check it.
Bingo! Now cmake version boots without segmentation fault.
CMake one, link dynamic libraries. (/usr/lib/x86_64-linux-gnu/libglib-2.0.so) Autotools one, link by name (-lglib-2.0). Probably static libraries.
I think using -lglib-2.0 links system's dynamic library, and the right way to do so.
Congratulations!!⭐
I'll make option about glib-2.0 linking. Default is '-lglib-2.0' of course.
It is long time battle. Thanks for your cooperation!
That's all for this problem.
Thank you!
$ cmake .. -D BUILD_X=ON -D BUILD_I286=ON $ make
causes the following error.
/home/hoge/NP2kai/vram/videofilter.c: In function 'VideoFilter_SetPalette': /home/hoge/NP2kai/vram/videofilter.c:638:15: error: 'NP2PAL_GRPHEX' undeclared (first use in this function); did you mean 'NP2PAL_GRPH'? 638 | u32Pallet = NP2PAL_GRPHEX; | ^
~~~~ | NP2PAL_GRPH /home/hoge/NP2kai/vram/videofilter.c:638:15: note: each undeclared identifier is reported only once for each function it appears in /home/hoge/NP2kai/vram/videofilter.c: In function 'VideoFilter_Import98': /home/hoge/NP2kai/vram/videofilter.c:666:22: error: 'NP2PAL_GRPHEX' undeclared (first use in this function); did you mean 'NP2PAL_GRPH'? 666 | ptMng->u32Pallet = NP2PAL_GRPHEX; | ^~~~~ | NP2PAL_GRPH make[2]: [CMakeFiles/xnp2kai.dir/build.make:2995: CMakeFiles/xnp2kai.dir/vram/videofilter.c.o] Error 1 make[1]: [CMakeFiles/Makefile2:243: CMakeFiles/xnp2kai.dir/all] Error 2 make: *** [Makefile:150: all] Error 2