Author Topic: Games with older SDL and FSLIB  (Read 3206 times)

Dave Yeo

  • Hero Member
  • *****
  • Posts: 5474
  • Karma: +132/-1
    • View Profile
Re: Games with older SDL and FSLIB
« Reply #30 on: July 01, 2025, 01:27:14 am »
Hi Martin, I've screwed around trying to get it to work from amoebax/ with no luck. Looking it likely needs the source patched which I don't have the knowledge to do.

Martin Iturbide

  • OS2World NewsMaster
  • Global Moderator
  • Hero Member
  • *****
  • Posts: 5370
  • Karma: +44/-1
  • Your Friend Wil Declares...
    • View Profile
    • Martin's Personal Blog
Re: Games with older SDL and FSLIB
« Reply #31 on: July 14, 2025, 10:15:06 pm »
Thanks a lot Dave for your time !!!

Abusing again of it  ;D Can you please check Cuyo to see if it compiles?
- https://download.savannah.gnu.org/releases/cuyo/cuyo-2.1.0.tar.gz

Regard
Martin Iturbide
OS2World NewsMaster
... just share the dream.

Dave Yeo

  • Hero Member
  • *****
  • Posts: 5474
  • Karma: +132/-1
    • View Profile
Re: Games with older SDL and FSLIB
« Reply #32 on: July 16, 2025, 05:59:44 pm »
Thanks a lot Dave for your time !!!

Abusing again of it  ;D Can you please check Cuyo to see if it compiles?
- https://download.savannah.gnu.org/releases/cuyo/cuyo-2.1.0.tar.gz

Regard

Hi Martin, ran into problems with getopt()
Code: [Select]
make[2]: Entering directory 'H:/tmp/cuyo-2.1.0/src'
g++ -DHAVE_CONFIG_H -I. -I..  -Ih:/tmp/SDL/h -Ih:/tmp/SDL/h/SDL -DPKGDATADIR=\"/usr/local/share/cuyo\" -DLOCALEDIR=\"/usr/local/share/locale\"   -Wall -W -ansi  -MT main.o -MD -MP -MF .deps/main.Tpo -c -o main.o main.cpp
main.cpp: In function 'void scanOptionen(int, char**)':
main.cpp:183:47: error: too many arguments to function 'int getopt()'
  183 |   while ((opt_chr = getopt(argc, argv, "dhg:f")) != -1) {
      |                                               ^
In file included from main.cpp:32:
W:/usr/include/getopt.h:166:12: note: declared here
  166 | extern int getopt ();
      |            ^~~~~~
make[2]: *** [Makefile:524: main.o] Error 1

For the hell of it I tried removing the "dhg:f" and it didn't get much further,
Code: [Select]
make[2]: Entering directory 'H:/tmp/cuyo-2.1.0/src'
g++ -DHAVE_CONFIG_H -I. -I..  -Ih:/tmp/SDL/h -Ih:/tmp/SDL/h/SDL -DPKGDATADIR=\"/usr/local/share/cuyo\" -DLOCALEDIR=\"/usr/local/share/locale\"   -Wall -W -ansi  -MT main.o -MD -MP -MF .deps/main.Tpo -c -o main.o main.cpp
main.cpp: In function 'void scanOptionen(int, char**)':
main.cpp:183:38: error: too many arguments to function 'int getopt()'
  183 |   while ((opt_chr = getopt(argc, argv)) != -1) {
      |                                      ^
In file included from main.cpp:32:
W:/usr/include/getopt.h:166:12: note: declared here
  166 | extern int getopt ();
      |            ^~~~~~
make[2]: *** [Makefile:524: main.o] Error 1

Unluckily I'm not knowledgeable enough to get past this.

Silvan Scherrer

  • Full Member
  • ***
  • Posts: 208
  • Karma: +4/-0
    • View Profile
Re: Games with older SDL and FSLIB
« Reply #33 on: July 16, 2025, 06:56:57 pm »
see https://github.com/bitwiseworks/libc/issues/44 for a possible explanation and solution
kind regards
Silvan
CTO bww bitwise works GmbH

Please help us with donations, so we can further work on OS/2 based projects. Our Shop is at https://www.bitwiseworks.com/shop/index.php

Rich Walsh

  • Sr. Member
  • ****
  • Posts: 409
  • Karma: +30/-0
  • ONU! (OS/2 is NOT Unix!)
    • View Profile
Re: Games with older SDL and FSLIB
« Reply #34 on: July 16, 2025, 07:03:19 pm »
Hi Martin, ran into problems with getopt()
Code: [Select]
In file included from main.cpp:32:
W:/usr/include/getopt.h:166:12: note: declared here
  166 | extern int getopt ();

Unluckily I'm not knowledgeable enough to get past this.

But you are (or will be)...

In cases like this it's a good idea to look at the header to see if there are any notes or #defines that might explain the problem. In this case, there are two different prototypes: one taking 3 args that you want, and one taking no args which is what you're getting. It depends on whether __GNU_LIBRARY__ is #defined (which it should be, AFAIK).

However... looking at the header reminded me of the _real_ problem. 'getopt()' used to be a standalone library with its own header. Nowadays it's part of the standard C library and is declared in 'unistd.h'. So, I think the solution here is to delete any '#include <getopt.h>' so the compiler finds the correct prototype.

Dave Yeo

  • Hero Member
  • *****
  • Posts: 5474
  • Karma: +132/-1
    • View Profile
Re: Games with older SDL and FSLIB
« Reply #35 on: July 16, 2025, 07:35:18 pm »
Ok, if I knew more German, the comment might have clued me in :) I uncommented the #include <unistd.h>, commented the #include <getopt.h> added a couple of LIBS and the compile finished.
Have to test later as have to go out.
There's still the problem of it wanting to be installed to an absolute location, /usr/local by default, to find its data.
German comment,
Code: [Select]
#if HAVE_GETOPT
/* Laut man-page muss man <unistd.h> includen, wenn man getopt() verwenden
   will. Laut gcc <getopt.h>. gcc sitzt am lõngeren Hebel... */
#include <unistd.h>
//#include <getopt.h>
#endif

I should have looked at the headers too, it's how I fixed the ngettext() problem I also had.

Dave Yeo

  • Hero Member
  • *****
  • Posts: 5474
  • Karma: +132/-1
    • View Profile
Re: Games with older SDL and FSLIB
« Reply #36 on: July 17, 2025, 02:55:19 am »
Here's the game installed to \usr\local. Still not sure how to install it so that it looks relatively for its data.
Edit: Removed zip
« Last Edit: July 17, 2025, 05:50:24 am by Dave Yeo »

Rich Walsh

  • Sr. Member
  • ****
  • Posts: 409
  • Karma: +30/-0
  • ONU! (OS/2 is NOT Unix!)
    • View Profile
Re: Games with older SDL and FSLIB
« Reply #37 on: July 17, 2025, 03:22:31 am »
Ok, if I knew more German, the comment might have clued me in :)

I too am working on a project where all the comments are in German, so I added this to my Favorites:

   https://translate.google.com/?sl=de&tl=en&op=translate

Dave Yeo

  • Hero Member
  • *****
  • Posts: 5474
  • Karma: +132/-1
    • View Profile
Re: Games with older SDL and FSLIB
« Reply #38 on: July 17, 2025, 05:49:17 am »
Ok, if I knew more German, the comment might have clued me in :)

I too am working on a project where all the comments are in German, so I added this to my Favorites:

   https://translate.google.com/?sl=de&tl=en&op=translate

That helped, along with using qe to load the files as codepage 1208.
Problem is that configure no longer allows relative paths for PREFIX etc.
Simple fix was to build with
Code: [Select]
make pkgdatadir=./data
and manually package it.
Seems to work here.

Mentore

  • Sr. Member
  • ****
  • Posts: 250
  • Karma: +14/-0
    • View Profile
Re: Games with older SDL and FSLIB
« Reply #39 on: July 17, 2025, 07:45:14 am »
Here's the game installed to \usr\local. Still not sure how to install it so that it looks relatively for its data.
Edit: Removed zip

This is one of the biggest problems I encountered with installing unix ported programs. Either you install them in /usr/local or /usr/something, or they are configured to install in a modifiable PREFIX, otherwise you are on your own figuring out a way to install it in a generic path.
I seem to remember I found something interesting via the OS/2 toolkit, but can't remember right now - I'm in the middle of an INCREDIBLY TOUGH moving from a house to another, and I can't really describe how hard and taxing this is becoming day after day.
Hope I'll get back on working on ArcaOS translation and software development ASAP.

Mentore

Martin Iturbide

  • OS2World NewsMaster
  • Global Moderator
  • Hero Member
  • *****
  • Posts: 5370
  • Karma: +44/-1
  • Your Friend Wil Declares...
    • View Profile
    • Martin's Personal Blog
Re: Games with older SDL and FSLIB
« Reply #40 on: July 17, 2025, 05:42:59 pm »
Hello Dave

That helped, along with using qe to load the files as codepage 1208.
Problem is that configure no longer allows relative paths for PREFIX etc.
Simple fix was to build with
Code: [Select]
make pkgdatadir=./data
and manually package it.
Seems to work here.

Thanks Dave. It also run here.

Just one thing. This port is incompatible with SDL12.dll from netlabs (6-30-16  6:46a        10,527 ).
Once I put on the folder the SDL12.dll (and SDLMIXER)  from SDL_1-2-15_2020-10-05.zip worked great.

Just a another thing. Can you please upload your code changes to this repo fork?
- https://github.com/OS2World/GAME-SDL-PUZZLE-Cuyo

Regards
Martin Iturbide
OS2World NewsMaster
... just share the dream.

Martin Iturbide

  • OS2World NewsMaster
  • Global Moderator
  • Hero Member
  • *****
  • Posts: 5370
  • Karma: +44/-1
  • Your Friend Wil Declares...
    • View Profile
    • Martin's Personal Blog
Re: Games with older SDL and FSLIB
« Reply #41 on: July 17, 2025, 06:08:02 pm »
Dave.

I had included a readme to package the game to Hobbes. Let me know if you want to add something else or any correction.

Regards
Martin Iturbide
OS2World NewsMaster
... just share the dream.

Dave Yeo

  • Hero Member
  • *****
  • Posts: 5474
  • Karma: +132/-1
    • View Profile
Re: Games with older SDL and FSLIB
« Reply #42 on: July 17, 2025, 10:27:39 pm »
Hello Dave
Thanks Dave. It also run here.

Just one thing. This port is incompatible with SDL12.dll from netlabs (6-30-16  6:46a        10,527 ).
Once I put on the folder the SDL12.dll (and SDLMIXER)  from SDL_1-2-15_2020-10-05.zip worked great.

Yes I linked against SDL_1-2-15_2020-10-05. Perhaps I should build a SDL_Mixer with GCC and linking against the SDL that YUM installed. This would simplify things as it is a hassle getting configure to recognize SDLMIXER which is built with OW and uses a different calling convention

Just a another thing. Can you please upload your code changes to this repo fork?
- https://github.com/OS2World/GAME-SDL-PUZZLE-Cuyo

Regards

I shall try and see if my app password works with the OS2World organization. Seems that previously it didn't.
If not I'll give you the patches to push.
We should first decide about SDL_mixer as I had to hack configure to get it to use the OW version.
Edit:fix a typo