Groups | Search | Server Info | Login | Register


Groups > comp.os.os2.programmer.misc > #150

Re: EMX problem

From "Dave Saville" <dave@invalid.invalid>
Newsgroups comp.os.os2.programmer.misc
Subject Re: EMX problem
Date 2011-04-03 20:31 +0000
Organization A noiseless patient Spider
Message-ID <fV45K0OBJxbE-pn2-UW9Gwdgwbd4f@localhost> (permalink)
References <fV45K0OBJxbE-pn2-Po0DVV9WtXII@localhost>

Show all headers | View raw


On Tue, 29 Mar 2011 10:56:19 UTC, "Dave Saville" 
<dave@invalid.invalid> wrote:

> I am trying to fix a few of the niggles I and others have with YAOS. 
> 
> First I tried to build it with the current gcc but there were so many
> errors, both in the C and linkage I gave up. 
> 
> I switched to my old emx setup and only get one warning and a link
> fail. This is without any code mods. I decided to get it to
> compile/link before messing with anything. 
> 
> The error I get is:
> 
> gcc -O2 -Wall -c -o yaos.o yaos.cc
> yaos.cc: In function `void setTitle(char *)':
> yaos.cc:30: warning: ANSI C++ forbids cast to non-reference type used
> as lvalue
> gcc -O2 -Wall -o yaost.exe yaos.o util.o ycd.o ext.o file.o easysock.o
> version.o -lvideo -lsocket yaos.def
> yaos.o: Undefined symbol __16_DosSmSetTitle referenced from text
> segment
> make: *** [yaost.exe] Error 1
> 
> extern "C" {
> USHORT _THUNK_FUNCTION (DosSmSetTitle) (_far16ptr title);
> 
> void setTitle(char *title)
> {
>   char *_title = (char*)_tmalloc(strlen(title)+1);
>   if (_title != NULL) {
>     strcpy(_title, title);
>     _THUNK_PROLOG (4);
>     _THUNK_FAR16 (_emx_32to16 (_title));   <--- line 30
>     _THUNK_CALL (DosSmSetTitle);
>     _tfree(_title);
>   }
> }
> 
> };
> 
> cat yaos.def
> NAME WINDOWCOMPAT
> IMPORTS
>   _16_DosSmSetTitle = SESMGR.5
> 
> 
> The original makefile used -Zomf but that throws loads of link errors.
> I reinstalled EMX from the fix4 wpi on hobbes. Gcc is the old 2.8.1
> 
> Any ideas?

1) I had something wrong in my EMX setup. Reinstalled using the old 
zips not the wpi. 

2) Now compiles clean with -Zomf. But there is a problem in that YAOS 
thinks the max command line is 260 chars. Luckily it was a #define so 
I bumped it to 1024. Testing one function and it crashes. Tracked it 
down to the 1024. reducing to 807 and it stops crashing. Can't see 
why. Just for fun I recomplied at 1024 without the -Zomf - and it does
not crash. But in this case I need to fix the original problem of the 
link failing on __16_DosSmSetTitle (I commented the call out for the 
test.)

-- 
Regards
Dave Saville

Back to comp.os.os2.programmer.misc | Previous | NextNext in thread | Find similar


Thread

Re: EMX problem "Dave Saville" <dave@invalid.invalid> - 2011-04-03 20:31 +0000
  Re: EMX problem Ilya Zakharevich <nospam-abuse@ilyaz.org> - 2011-04-04 17:27 +0000
    Re: EMX problem "Dave Saville" <dave@invalid.invalid> - 2011-04-04 19:01 +0000
      Re: EMX problem Ilya Zakharevich <nospam-abuse@ilyaz.org> - 2011-04-04 21:30 +0000
        Re: EMX problem "Dave Saville" <dave@invalid.invalid> - 2011-04-05 13:43 +0000
          Re: EMX problem Ilya Zakharevich <nospam-abuse@ilyaz.org> - 2011-04-05 18:55 +0000
      Re: EMX problem "A.D. Fundum" <what.ever@neverm.ind> - 2011-04-06 13:24 +0200

csiph-web