Author Topic: General Software Testing  (Read 91622 times)

Martin Iturbide

  • OS2World NewsMaster
  • Global Moderator
  • Hero Member
  • *****
  • Posts: 5497
  • Karma: +49/-1
  • Your Friend Wil Declares...
    • View Profile
    • Martin's Personal Blog
Re: General Software Testing
« Reply #90 on: October 09, 2025, 11:48:33 pm »
Hello

I tried to compile it, but I suck. Only warnings, but I fail with the linker.


Code: [Select]
Creating binary resource file Mandel.RES
RC:  RCPP -E -D RC_INVOKED -W4 -f Mandel.rc -ef C:\OS2\RCPP.ERR -I C:\usr\include

Mandel.rc
gcc -Wall -Zomf Mandel.obj gifcompr.obj gifencod.obj Mandel.def -los2 -o Mandel.exe
weakld: error: Unresolved symbol (UNDEF) '_DosReleaseMutexSem'.
weakld: info: The symbol is referenced by:
    E:\dev\5TRYING\Mandel\Mandel.obj
weakld: error: Unresolved symbol (UNDEF) '_DosRequestMutexSem'.
weakld: info: The symbol is referenced by:
    E:\dev\5TRYING\Mandel\Mandel.obj
weakld: error: Unresolved symbol (UNDEF) '_DosCreateMutexSem'.
weakld: info: The symbol is referenced by:
    E:\dev\5TRYING\Mandel\Mandel.obj
Ignoring unresolved externals reported from weak prelinker.
Error! E2028: _DosRequestMutexSem is an undefined reference
Error! E2028: _DosReleaseMutexSem is an undefined reference
Error! E2028: _DosCreateMutexSem is an undefined reference
file E:\dev\5TRYING\Mandel\Mandel.obj(Mandel.obj): undefined symbol _DosRequestMutexSem
file E:\dev\5TRYING\Mandel\Mandel.obj(Mandel.obj): undefined symbol _DosReleaseMutexSem
file E:\dev\5TRYING\Mandel\Mandel.obj(Mandel.obj): undefined symbol _DosCreateMutexSem
make: *** [Makefile:10: Mandel.exe] Error 1

Regards
« Last Edit: October 09, 2025, 11:50:13 pm by Martin Iturbide »
Martin Iturbide
OS2World NewsMaster
... just share the dream.

Dave Yeo

  • Hero Member
  • *****
  • Posts: 5584
  • Karma: +141/-1
    • View Profile
Re: General Software Testing
« Reply #91 on: October 10, 2025, 01:25:49 am »
Mandel.c needs #define INCL_DOSSEMAPHORES before os2.h. Makefile needs some minor mods, -Zmts removed and -Zomf added in its place on the Mandel.exe recipe.
I will attach my work.
Note that it runs fine run from the source directory besides a warning about the lack of a map file. With the map file(s) gives a blank screen. I think as it expects only 256 colours
Edit:, yes the map files seem to be different palettes. I ran out of memory while playing with it so it may be worth adding a -Zhigh-mem where you have the -Zomf. Guess the check for map file could be removed or changed to a parameter. If I knew how, it could query the number of colours and only use the map file with 256 colours.
Edit2: With the map files, if you save the image, the gif looks correct and varies based on the map file.
Edit3: Updated source again, add stdlib.h a few places, fixed make clean, bigger stack for _beginthread.
Now get warnings like,
Code: [Select]
gcc    -c -o Mandel.o Mandel.c
Mandel.c: In function 'MandelWndProc':
Mandel.c:170:20: warning: passing argument 1 of '_beginthread' from incompatible pointer type [-Wincompatible-pointer-types]
  170 |      _beginthread (SaveThread, 0, 4096, &pfdFileDialog.szFullFile);
      |                    ^~~~~~~~~~
      |                    |
      |                    void (__attribute__((system)) *)(char *) {aka void (*)(char *)}

Mandel.h has,
Code: [Select]
void APIENTRY SaveThread (char *path);Not sure of the fix.
« Last Edit: October 10, 2025, 02:19:37 am by Dave Yeo »

Rich Walsh

  • Sr. Member
  • ****
  • Posts: 417
  • Karma: +30/-0
  • ONU! (OS/2 is NOT Unix!)
    • View Profile
Re: General Software Testing
« Reply #92 on: October 10, 2025, 05:23:02 pm »
Now get warnings like,
Code: [Select]
gcc    -c -o Mandel.o Mandel.c
Mandel.c: In function 'MandelWndProc':
Mandel.c:170:20: warning: passing argument 1 of '_beginthread' from incompatible pointer type [-Wincompatible-pointer-types]
  170 |      _beginthread (SaveThread, 0, 4096, &pfdFileDialog.szFullFile);
      |                    ^~~~~~~~~~
      |                    |
      |                    void (__attribute__((system)) *)(char *) {aka void (*)(char *)}

Not sure of the fix.

_beginthread (&SaveThread, 0, 4096, &pfdFileDialog.szFullFile);

It wants the address of SaveThread() (whence the '&'), not just a reference to it. Other/earlier compilers would do the conversion without mentioning it - gcc has gotten fussier over the years.

Edit: all wrong :(  It's complaining that the signature of SaveThread() doesn't match what it expects: a function that takes a character ptr and doesn't return a value. Take a look at SaveThread() and see if it returns a value or takes e.g., a ptr to void rather than a char ptr, then modify or cast accordingly.

« Last Edit: October 10, 2025, 07:17:22 pm by Rich Walsh »

Martin Iturbide

  • OS2World NewsMaster
  • Global Moderator
  • Hero Member
  • *****
  • Posts: 5497
  • Karma: +49/-1
  • Your Friend Wil Declares...
    • View Profile
    • Martin's Personal Blog
Re: General Software Testing
« Reply #93 on: October 10, 2025, 06:52:43 pm »
Thanks Dave.  It compiles here with the warnings.

I put your changes here:
https://github.com/OS2World/APP-GRAPHICS-Mandelbrot

I just made some little silly text changes to show the bldlevel info and updated the "about" text.

Regards
« Last Edit: October 10, 2025, 07:00:29 pm by Martin Iturbide »
Martin Iturbide
OS2World NewsMaster
... just share the dream.