OS/2, eCS & ArcaOS - Technical > Programming
Compiling a PM sample with GCC (2023)
Martin Iturbide:
Hi
Now vf00 to vf15 are compiling with a lot of warnigs that I will check later.
I'm stuck here:
--- Code: ---gcc -Zomf vectfont.obj vectfont.def -o vectfont.exe
weakld: error: Unresolved symbol (UNDEF) '_Display_CharAngle'.
weakld: info: The symbol is referenced by:
C:\dev\DEV-SAMPLES-PM-VectFont\vectfont.obj
weakld: error: Unresolved symbol (UNDEF) '_Display_24Point'.
weakld: info: The symbol is referenced by:
C:\dev\DEV-SAMPLES-PM-VectFont\vectfont.obj
weakld: error: Unresolved symbol (UNDEF) '_Display_Stretch'.
weakld: info: The symbol is referenced by:
C:\dev\DEV-SAMPLES-PM-VectFont\vectfont.obj
weakld: error: Unresolved symbol (UNDEF) '_Display_Block'.
weakld: info: The symbol is referenced by:
C:\dev\DEV-SAMPLES-PM-VectFont\vectfont.obj
weakld: error: Unresolved symbol (UNDEF) '_Display_Mirror'.
weakld: info: The symbol is referenced by:
C:\dev\DEV-SAMPLES-PM-VectFont\vectfont.obj
weakld: error: Unresolved symbol (UNDEF) '_Display_Rotate'.
weakld: info: The symbol is referenced by:
C:\dev\DEV-SAMPLES-PM-VectFont\vectfont.obj
weakld: error: Unresolved symbol (UNDEF) '_Display_Spokes'.
weakld: info: The symbol is referenced by:
C:\dev\DEV-SAMPLES-PM-VectFont\vectfont.obj
weakld: error: Unresolved symbol (UNDEF) '_Display_Shadow'.
weakld: info: The symbol is referenced by:
C:\dev\DEV-SAMPLES-PM-VectFont\vectfont.obj
weakld: error: Unresolved symbol (UNDEF) '_Display_Hollow'.
weakld: info: The symbol is referenced by:
C:\dev\DEV-SAMPLES-PM-VectFont\vectfont.obj
weakld: error: Unresolved symbol (UNDEF) '_Display_Neon'.
weakld: info: The symbol is referenced by:
C:\dev\DEV-SAMPLES-PM-VectFont\vectfont.obj
weakld: error: Unresolved symbol (UNDEF) '_Display_CharShear'.
weakld: info: The symbol is referenced by:
C:\dev\DEV-SAMPLES-PM-VectFont\vectfont.obj
weakld: error: Unresolved symbol (UNDEF) '_Display_Fade'.
weakld: info: The symbol is referenced by:
C:\dev\DEV-SAMPLES-PM-VectFont\vectfont.obj
weakld: error: Unresolved symbol (UNDEF) '_Display_ModSpokes'.
weakld: info: The symbol is referenced by:
C:\dev\DEV-SAMPLES-PM-VectFont\vectfont.obj
weakld: error: Unresolved symbol (UNDEF) '_Display_DropShadow'.
weakld: info: The symbol is referenced by:
C:\dev\DEV-SAMPLES-PM-VectFont\vectfont.obj
weakld: error: Unresolved symbol (UNDEF) '_Display_Wavy'.
weakld: info: The symbol is referenced by:
C:\dev\DEV-SAMPLES-PM-VectFont\vectfont.obj
Ignoring unresolved externals reported from weak prelinker.
Warning! W1058: file ldlF6kxQ.: line(19): protmode option not valid for an OS/2 EMX executable
Error! E2028: _Display_24Point is an undefined reference
Error! E2028: _Display_Mirror is an undefined reference
Error! E2028: _Display_Stretch is an undefined reference
Error! E2028: _Display_CharAngle is an undefined reference
Error! E2028: _Display_Rotate is an undefined reference
Error! E2028: _Display_CharShear is an undefined reference
Error! E2028: _Display_Shadow is an undefined reference
Error! E2028: _Display_Hollow is an undefined reference
Error! E2028: _Display_DropShadow is an undefined reference
Error! E2028: _Display_Block is an undefined reference
Error! E2028: _Display_Neon is an undefined reference
Error! E2028: _Display_Fade is an undefined reference
Error! E2028: _Display_Spokes is an undefined reference
Error! E2028: _Display_Wavy is an undefined reference
Error! E2028: _Display_ModSpokes is an undefined reference
file C:\dev\DEV-SAMPLES-PM-VectFont\vectfont.obj(vectfont.obj): undefined symbol _Display_24Point
file C:\dev\DEV-SAMPLES-PM-VectFont\vectfont.obj(vectfont.obj): undefined symbol _Display_Mirror
file C:\dev\DEV-SAMPLES-PM-VectFont\vectfont.obj(vectfont.obj): undefined symbol _Display_Stretch
file C:\dev\DEV-SAMPLES-PM-VectFont\vectfont.obj(vectfont.obj): undefined symbol _Display_CharAngle
file C:\dev\DEV-SAMPLES-PM-VectFont\vectfont.obj(vectfont.obj): undefined symbol _Display_Rotate
file C:\dev\DEV-SAMPLES-PM-VectFont\vectfont.obj(vectfont.obj): undefined symbol _Display_CharShear
file C:\dev\DEV-SAMPLES-PM-VectFont\vectfont.obj(vectfont.obj): undefined symbol _Display_Shadow
file C:\dev\DEV-SAMPLES-PM-VectFont\vectfont.obj(vectfont.obj): undefined symbol _Display_Hollow
file C:\dev\DEV-SAMPLES-PM-VectFont\vectfont.obj(vectfont.obj): undefined symbol _Display_DropShadow
file C:\dev\DEV-SAMPLES-PM-VectFont\vectfont.obj(vectfont.obj): undefined symbol _Display_Block
file C:\dev\DEV-SAMPLES-PM-VectFont\vectfont.obj(vectfont.obj): undefined symbol _Display_Neon
file C:\dev\DEV-SAMPLES-PM-VectFont\vectfont.obj(vectfont.obj): undefined symbol _Display_Fade
file C:\dev\DEV-SAMPLES-PM-VectFont\vectfont.obj(vectfont.obj): undefined symbol _Display_Spokes
file C:\dev\DEV-SAMPLES-PM-VectFont\vectfont.obj(vectfont.obj): undefined symbol _Display_Wavy
file C:\dev\DEV-SAMPLES-PM-VectFont\vectfont.obj(vectfont.obj): undefined symbol _Display_ModSpokes
make: *** [vectfont.exe] Error 1
--- End code ---
Maybe I'm not doing something fine on the new makefile. (nake,out attached)
Regards
Martin Iturbide:
Hi
Checking my makefile I think I need to call all the .obj to create vectfont.exe.
I changed to this:
--- Quote ---vectfont.exe : vectfont.obj vectfont.res vf00.obj vf01.obj vf02.obj vf03.obj vf04.obj vf05.obj vf06.obj vf07.obj vf08.obj vf09.obj vf10.obj vf11.obj vf12.obj vf13.obj vf14.obj vf15.obj vectfont.def
gcc -Zomf vectfont.obj vf00.obj vf01.obj vf02.obj vf03.obj vf04.obj vf05.obj vf06.obj vf07.obj vf08.obj vf09.obj vf10.obj vf11.obj vf12.obj vf13.obj vf14.obj vf15.obj vectfont.def -o vectfont.exe
wrc vectfont.res
--- End quote ---
Now the error changed to:
--- Code: ---gcc -Zomf vectfont.obj vf00.obj vf01.obj vf02.obj vf03.obj vf04.obj vf05.obj vf06.obj vf07.obj vf08.obj vf09.obj vf10.obj vf11.obj vf12.obj vf13.obj vf14.obj vf15.obj vectfont.def -o vectfont.exe
weakld: error: Unresolved symbol (UNDEF) '_max'.
weakld: info: The symbol is referenced by:
C:\dev\DEV-SAMPLES-PM-VectFont\vf00.obj
C:\dev\DEV-SAMPLES-PM-VectFont\vf14.obj
weakld: error: Unresolved symbol (UNDEF) '_min'.
weakld: info: The symbol is referenced by:
C:\dev\DEV-SAMPLES-PM-VectFont\vf00.obj
C:\dev\DEV-SAMPLES-PM-VectFont\vf05.obj
C:\dev\DEV-SAMPLES-PM-VectFont\vf14.obj
Ignoring unresolved externals reported from weak prelinker.
Warning! W1058: file ldgVmPcu.: line(35): protmode option not valid for an OS/2 EMX executable
Error! E2028: _max is an undefined reference
Error! E2028: _min is an undefined reference
file C:\dev\DEV-SAMPLES-PM-VectFont\vf00.obj(vf00.obj): undefined symbol _max
file C:\dev\DEV-SAMPLES-PM-VectFont\vf00.obj(vf00.obj): undefined symbol _min
file C:\dev\DEV-SAMPLES-PM-VectFont\vf05.obj(vf05.obj): undefined symbol _min
file C:\dev\DEV-SAMPLES-PM-VectFont\vf14.obj(vf14.obj): undefined symbol _min
file C:\dev\DEV-SAMPLES-PM-VectFont\vf14.obj(vf14.obj): undefined symbol _max
make: *** [vectfont.exe] Error 1
--- End code ---
Dave Yeo:
os2tk45\h\libc\stdlib.h has,
--- Code: ---#define max(a,b) (((a) > (b)) ? (a) : (b))
#define min(a,b) (((a) < (b)) ? (a) : (b))
--- End code ---
Martin Iturbide:
Hi Dave
I haven't installed the OS2tk45.
I'm using this one:
--- Quote ---[C:\usr\include]dir stdlib.h
The volume label in drive C is ARCAOS.
The Volume Serial Number is C470:B5BB.
Directory of C:\usr\include
4-22-23 7:24a 16,886 124 a--- stdlib.h
1 file(s) 16,886 bytes used
--- End quote ---
It does not has any max(a,b) or min(a,b). If I include those lines on stdlib.h I get the same error.
--- Code: ---gcc -I. -Zomf vectfont.obj vf00.obj vf01.obj vf02.obj vf03.obj vf04.obj vf05.obj
vf06.obj vf07.obj vf08.obj vf09.obj vf10.obj vf11.obj vf12.obj vf13.obj vf14.ob
j vf15.obj vectfont.def -o vectfont.exe
weakld: error: Unresolved symbol (UNDEF) '_max'.
weakld: info: The symbol is referenced by:
C:\dev\DEV-SAMPLES-PM-VectFont\vf00.obj
C:\dev\DEV-SAMPLES-PM-VectFont\vf14.obj
weakld: error: Unresolved symbol (UNDEF) '_min'.
weakld: info: The symbol is referenced by:
C:\dev\DEV-SAMPLES-PM-VectFont\vf00.obj
C:\dev\DEV-SAMPLES-PM-VectFont\vf14.obj
Ignoring unresolved externals reported from weak prelinker.
Warning! W1058: file ldmdI0AW.: line(35): protmode option not valid for an OS/2
EMX executable
Error! E2028: _max is an undefined reference
Error! E2028: _min is an undefined reference
file C:\dev\DEV-SAMPLES-PM-VectFont\vf00.obj(vf00.obj): undefined symbol _max
file C:\dev\DEV-SAMPLES-PM-VectFont\vf00.obj(vf00.obj): undefined symbol _min
file C:\dev\DEV-SAMPLES-PM-VectFont\vf14.obj(vf14.obj): undefined symbol _min
file C:\dev\DEV-SAMPLES-PM-VectFont\vf14.obj(vf14.obj): undefined symbol _max
make: *** [vectfont.exe] Error 1
--- End code ---
Now, I installed os2tk45, but I can not find stdlib.h to compare it with the one on "C:\usr\include".
Which package contains the os2tk45 stdlib.h ?
Regards
Dave Yeo:
I found libc/stddef.h in os2tk45, the complete package. I guess Bitwise didn't add the conflicting libc to the rpm.
Simplest in this case is just to add the defines, with guards incase someone does use the toolkit or such where min and max are defined. VECTFONT.H seems like a good candidate, could create a header as well.
--- Code: ---diff --git a/VECTFONT.H b/VECTFONT.H
index fcae64a..6fac9ca 100644
--- a/VECTFONT.H
+++ b/VECTFONT.H
@@ -48,3 +48,10 @@ VOID Display_Fade (HPS hps, LONG cxClient, LONG cyClient) ;
// VF12
VOID Display_Spokes (HPS hps, LONG cxClient, LONG cyClient) ; // VF13
VOID Display_Wavy (HPS hps, LONG cxClient, LONG cyClient) ; // VF14
VOID Display_ModSpokes (HPS hps, LONG cxClient, LONG cyClient) ; // VF15
+
+#ifndef max
+#define max(a,b) (((a) > (b)) ? (a) : (b))
+#endif
+#ifndef min
+#define min(a,b) (((a) < (b)) ? (a) : (b))
+#endif
--- End code ---
This compiles but doesn't work as expected. Wrong max and min?
BTW, my makefile patch is this, more readable. I see you didn't commit the makefile :)
--- Code: ---all : vectfont.exe
vectfont.exe : vectfont.obj vectfont.res vf00.obj vf01.obj vf02.obj vf03.obj \
vf04.obj vf05.obj vf06.obj vf07.obj vf08.obj vf09.obj vf10.obj \
vf11.obj vf12.obj vf13.obj vf14.obj vf15.obj vectfont.def
gcc -Zomf vectfont.obj vf00.obj vf01.obj vf02.obj vf03.obj vf04.obj \
vf05.obj vf06.obj vf07.obj vf08.obj vf09.obj vf10.obj vf11.obj \
vf12.obj vf13.obj vf14.obj vf15.obj vectfont.def -o vectfont.exe
wrc vectfont.res
--- End code ---
Navigation
[0] Message Index
[#] Next page
[*] Previous page
Go to full version