Looking at your errors, perhaps try compiling as C by changing the codes suffix from .cpp to .c, hwman.c
You cannot. The file headers contain the "class" C++ keyword. A C-compiler has no clue how to handle that and what it means.
There are multiple problems with gcc, for once, I suspect that the various typedefs like SOMEXTERN etc. are not properly defined anywhere, at least not in the header files that come with gcc. If you use the toolkit headers, gcc might barf because it does not understand certain pragmas etc. etc.
Next, I seem to remember that gcc uses "C" as default calling convention and not SYSCALL (_System) as the IBM and Watcom compilers do (which is relevant for example regarding the generated symbol names), so you have to make sure that you pick the correct gcc switch to tell it to use SYSCALL calling convention.
I had also tried to use gcc in the past. gcc is good for porting UNIX programs but it is a nightmare for native OS/2 development. Is has no decent source code debugger (only a lousy command line version that gives me the creeps).
Use Watcom if you really want to get into it. That is a decent compiler and it has a GUI source code debugger. I have used Watcom for native OS/2 development and while the linker command file syntax is frightening, you will always find a good template if you look around :-)