OS/2, eCS & ArcaOS - Technical > Programming
Compiling a PM sample with GCC
Martin Iturbide:
Hi
Just in case I created a new VM from my ArcaOS 5.0.7 vanilla, installed "yum install gcc os2tk45", copied nmake 4.
I opened a new 4CMD session:
run:
- SET C_INCLUDE_PATH=/@unixroot/usr/include;c:/usr/include/os2tk45
- D:\OS2TK45\bin\nmake 2>&1 |tee make.out
Same error. Can it be some issue with os2def.h ?
Regards
Dave Yeo:
Have you installed libc-dev? You shouldn't need the toolkit usually with GCC as it has its own version of the toolkit as Lars said.
Dave Yeo:
--- Quote from: Lars on March 30, 2022, 09:48:34 am ---I think the IBM provided toolkit files were packaged for those developers that intend to use WATCOM or the IBM provided toolchain (Visual Age C++). Maybe that should have been stated right away ...
--- End quote ---
GCC multimedia apps at least also need to use the toolkit as the EMX (now libc) version is missing them, this includes dive.h and IIRC mmpm2.lib. Trick is including the toolkit at the end of the include search, often with -idirafter.
Martin Iturbide:
Hi
Thanks, I didn't know that libc-devel had the include files.
So.
- yum install libc-devel
- yum remove os2tk45
and now opened a new 4CMD session:
run:
- SET C_INCLUDE_PATH=/@unixroot/usr/include;c:/usr/include/os2tk45
- nmake 2>&1 |tee make.out
Now I got a new error.
--- Code: ---Operating System/2 Program Maintenance Utility
Version 4.00.001 Oct 4 2001
Copyright (C) IBM Corporation 1988-2001
Copyright (C) Microsoft Corp. 1988-1991
All rights reserved.
gcc -Zomf -c -O2 walker.c -o walker.obj
gcc.exe: fatal error: cannot execute 'as': spawnvp: No such file or directory
compilation terminated.
NMAKE : fatal error U1077: 'C:\SYS\APPS\4OS2\4OS2.EXE' : return code '1'
Stop.
--- End code ---
Using:
- gcc.exe (GCC) 9.2.0 20190812 (OS/2 RPM build 9.2.0-5.oc00)
- nmake Version 4.00.001
- rc - 4.00.011
Dave Yeo:
That's weird, as is the GNU compiler, part of GCC. Is as.exe in \usr\bin? Is your PATH correct in having c:\usr\bin near the beginning? Have you tried with cmd.exe instead of 4os2? I only use cmd.exe due to 4os2 acting different in some circumstances and breaking things.
Using the stock 4os2 install, it works fine here,
--- Code: ---Operating System/2 Program Maintenance Utility
Version 3.00.013 Nov 17 1995
Copyright (C) IBM Corporation 1988-1995
Copyright (C) Microsoft Corp. 1988-1991
All rights reserved.
gcc -Zomf -c -O2 walker.c -o walker.obj
rc -r walker.rc
Operating System/2 Resource Compiler
Version 4.00.011 Oct 10 2000
(C) Copyright IBM Corporation 1988-2000
(C) Copyright Microsoft Corp. 1985-2000
All rights reserved.
Creating binary resource file walker.RES
RC: RCPP -E -D RC_INVOKED -W4 -f walker.rc -ef W:\OS2\RCPP.ERR -I G:\IBMCPP\INCLUDE -I G:\IBMCPP\INCLUDE\OS2 -I G:\IBMCPP\INC -I G:\IBMCPP\INCLUDE\SOM -I W:\usr\include\os2tk45\inc -I W:\usr\include\os2tk45\gl -I W:\usr\include\os2tk45
walker.rc
gcc -Zomf walker.obj walker.def -o walker.exe
Warning! W1058: file ld3xIFSd.: line(20): protmode option not valid for an OS/2 EMX executable
rc walker.res
Operating System/2 Resource Compiler
Version 4.00.011 Oct 10 2000
(C) Copyright IBM Corporation 1988-2000
(C) Copyright Microsoft Corp. 1985-2000
All rights reserved.
Reading binary resource file walker.res
Writing resources to OS/2 v2.0 Linear .EXE file
Writing 1 DEMAND resource object(s)
Writing: 5552 bytes in 2 page(s)
1.1 (1388 bytes)
2.1 (1388 bytes)
3.1 (1388 bytes)
4.1 (1388 bytes)
Writing Extended Attributes: Default Icon
Writing Extended Attributes: Checksum
--- End code ---
Guess the protmode line could be removed from the def file. The IBM linkers don't complain about it and others have acted surprised about the warning.
Navigation
[0] Message Index
[#] Next page
[*] Previous page
Go to full version