magiblot / tvision

A modern port of Turbo Vision 2.0, the classical framework for text-based user interfaces. Now cross-platform and with Unicode support.
Other
2k stars 151 forks source link

Build failure on OpenBSD #13

Closed ghost closed 3 years ago

ghost commented 3 years ago

I wanted to test if this program worked on OpenBSD (and NetBSD too, but that is for later) and I got this error. I didn't have any issues with cmake, but both make and gmake failed on me.

make: make

gmake: gmake

What is the issue at hand? Can this please be fixed?

magiblot commented 3 years ago

Hi notepade!

For the time being, just change line 57 in source/platform/sighandl.cpp from this:

if (c == 'c' || c == '\n')
    context->uc_mcontext.IP++; // Increase instruction pointer.

To this:

if (c == 'c' || c == '\n')
    ;
magiblot commented 3 years ago

And line 83 from this:

"\r\n", (void*) context->uc_mcontext.IP);

To this:

"\r\n", (void*) 0);
magiblot commented 3 years ago

This issue is caused by a non-portable feature which I thought would be cool but actually has no real world use. It fails to compile every time someone tries to build Turbo Vision in a different BSD system. I think it will be best to remove it.

ghost commented 3 years ago

Okay. It worked making with the changes. A bunch of warnings, but that can be ignored for now. I tried to compile the hello example to see how it looked, but using -std=c++17 gave a strange error that it didn't recognize it. C++

And then another error when removing it. error1

Any further changes you recommend I make?

magiblot commented 3 years ago

If cmake and make already worked, then you do not need to compile hello manually. You should be able to find the demo applications (tvdemo, tvedit, etc.) already built in the same directory.

If you still want to build hello.cpp manually: the errors you got are not normal. Maybe try with clang++ instead of g++?

ghost commented 3 years ago

hello.cpp worked with clang++. It didn't like g++ for some reason. Gave a few warnings, but again, that can be ignored for now. It would be best to remove the non portable features if they have no real purpose. That way it can work on other BSD systems without issue.