OS/2, eCS & ArcaOS - Technical > Applications

General Software Testing

<< < (19/19)

Martin Iturbide:
Hello

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



--- Code: ---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
--- End code ---

Regards

Dave Yeo:
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: ---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 *)}

--- End code ---

Mandel.h has,

--- Code: ---void APIENTRY SaveThread (char *path);
--- End code ---
Not sure of the fix.

Rich Walsh:

--- Quote from: Dave Yeo on October 10, 2025, 01:25:49 am ---Now get warnings like,

--- Code: ---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 *)}

--- End code ---

Not sure of the fix.

--- End quote ---

_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.

Martin Iturbide:
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

Martin Iturbide:
Hello

I'm trying some old MD+F Blitter demo.

- https://web.archive.org/web/20060505034436/http://www.modulardreams.com/downloads/os2blit.zip
- https://web.archive.org/web/20060505034436/http://www.modulardreams.com/downloads/os2va.zip

But when I run it, I get a rapid quit and got this POPUPLOG.

--- Code: ---
11-30-2025  20:41:20  SYS3175  PID 00db  TID 0001  Slot 0086
C:\HOME\DOWNLOADS\OS2BLI15\BLITTER.EXE
c0000005
00185e04
P1=00000001  P2=0000000c  P3=XXXXXXXX  P4=XXXXXXXX 
EAX=00000000  EBX=00000000  ECX=00000000  EDX=00000000
ESI=00000000  EDI=00000000 
DS=0053  DSACC=d0f3  DSLIM=9fffffff 
ES=0053  ESACC=d0f3  ESLIM=9fffffff 
FS=150b  FSACC=00f3  FSLIM=00000030
GS=0000  GSACC=****  GSLIM=********
CS:EIP=005b:00185e04  CSACC=d0df  CSLIM=9fffffff
SS:ESP=0053:003d0c8c  SSACC=d0f3  SSLIM=9fffffff
EBP=00000000  FLG=00010202

BLITTER.EXE 0001:00175e04

--- End code ---

Download Reference:
-- https://web.archive.org/web/20060505034436/http://www.modulardreams.com/old_download.html

Any ideas are welcome.

Regards

Navigation

[0] Message Index

[*] Previous page

Go to full version