gcc -lunix lib issues

I am trying to compile software which requires unix.lib, but cannot find
unix.lib anywhere. Does anyone here know where I can find it?

Thanks,

Karen

Karen <chibiusa@mtu.net> wrote:

I am trying to compile software which requires unix.lib, but cannot find
unix.lib anywhere. Does anyone here know where I can find it?

Is this porting from QNX4? Have you tried linking without specifying
-lunix at all? You might find that most of the functions that were
in unix.lib are actually in our standard C library.

If not, on what functions does the link fail?

-David

QNX Training Services
dagibbs@qnx.com

Actually, this is porting to QNX4, and the code is dying on a line reading
"bzero((void*)&start_tv, sizeof(start_tv)); bzero is undefined, and I’ve a
feeling it is supposed to belong to unix.lib. I may be wrong though. Any
ideas?

  • Karen

“David Gibbs” <dagibbs@qnx.com> wrote in message
news:9f8uib$a8e$2@nntp.qnx.com

Karen <> chibiusa@mtu.net> > wrote:
I am trying to compile software which requires unix.lib, but cannot find
unix.lib anywhere. Does anyone here know where I can find it?

Is this porting from QNX4? Have you tried linking without specifying
-lunix at all? You might find that most of the functions that were
in unix.lib are actually in our standard C library.

If not, on what functions does the link fail?

-David

QNX Training Services
dagibbs@qnx.com

Hello,

If you’ve installed the QNX4 compiler package correctly you should have
a collection of unix*.lib also. The routine you’re referring to can be
found in the unix libs. With wlib you can check this:


/usr/watcom/10.6/usr/lib $ wlib unix3r.lib | grep bzero
WATCOM Library Manager Version 10.6
Copyright by WATCOM International Corp. 1988, 1996. All rights reserved.
WATCOM is a trademark of WATCOM International Corp.
brk_…brk bzero_…bzero
bzero Offset=00017000H
bzero_

However, there isn’t a specific “unix.lib” file. It depends on how
you’ve compiled your modules: 16 bit? 32 bit? register calling? stack
calling? (and in case of 16 bit) small/compact/medium/large model?

When you specify “-lunix”, the linker knows from your object model which
unix*.lib to select. Make sure the library search path is also correct.
(Perhaps by specifying this with the “-L” option)

One “gotcha” to look out for is mixed model linking. For instance if one
module is compiled with register calling (-3r), and the other with stack
calling (-3s), and you try to link them together, the linker will still
flag errors even though the routines are present. (IIRC, this even
happens when mixing “-5r” with “-3r” modules.)

good luck,
rick

Karen wrote:

Actually, this is porting to QNX4, and the code is dying on a line reading
"bzero((void*)&start_tv, sizeof(start_tv)); bzero is undefined, and I’ve a
feeling it is supposed to belong to unix.lib. I may be wrong though. Any
ideas?

  • Karen

“David Gibbs” <> dagibbs@qnx.com> > wrote in message
news:9f8uib$a8e$> 2@nntp.qnx.com> …
Karen <> chibiusa@mtu.net> > wrote:
I am trying to compile software which requires unix.lib, but cannot find
unix.lib anywhere. Does anyone here know where I can find it?

Is this porting from QNX4? Have you tried linking without specifying
-lunix at all? You might find that most of the functions that were
in unix.lib are actually in our standard C library.

If not, on what functions does the link fail?

-David

QNX Training Services
dagibbs@qnx.com

In article <9f902c$n6r$1@inn.qnx.com>, Karen <chibiusa@mtu.net> wrote:

Actually, this is porting to QNX4, and the code is dying on a line reading
"bzero((void*)&start_tv, sizeof(start_tv)); bzero is undefined, and I’ve a
feeling it is supposed to belong to unix.lib. I may be wrong though. Any
ideas?

bzero and friends were originally for sockets and friends so sometimes
they appear in socket libraries. The standard porting workaround is to
define a bzero macro like

#define bzero(b,len) memset(b, 0, (size_t)(len))
or
#define bzero(b,len) memset(b, 0, len)


  • Karen

“David Gibbs” <> dagibbs@qnx.com> > wrote in message
news:9f8uib$a8e$> 2@nntp.qnx.com> …
Karen <> chibiusa@mtu.net> > wrote:
I am trying to compile software which requires unix.lib, but cannot find
unix.lib anywhere. Does anyone here know where I can find it?

Is this porting from QNX4? Have you tried linking without specifying
-lunix at all? You might find that most of the functions that were
in unix.lib are actually in our standard C library.

If not, on what functions does the link fail?

-David

QNX Training Services
dagibbs@qnx.com

Well, I should note than even when I try to use a simple hello world program
with the -lunix option, I get this error message:

cc warning: cc: cannot find library ‘unix’

the bzero substitution worked, but now I’m hitting the same problem on
different function names. Any suggestions?

Thanks,

Karen

“Karen” <chibiusa@mtu.net> wrote in message news:9f902c$n6r$1@inn.qnx.com

Actually, this is porting to QNX4, and the code is dying on a line reading
"bzero((void*)&start_tv, sizeof(start_tv)); bzero is undefined, and I’ve
a
feeling it is supposed to belong to unix.lib. I may be wrong though. Any
ideas?

  • Karen

“David Gibbs” <> dagibbs@qnx.com> > wrote in message
news:9f8uib$a8e$> 2@nntp.qnx.com> …
Karen <> chibiusa@mtu.net> > wrote:
I am trying to compile software which requires unix.lib, but cannot
find
unix.lib anywhere. Does anyone here know where I can find it?

Is this porting from QNX4? Have you tried linking without specifying
-lunix at all? You might find that most of the functions that were
in unix.lib are actually in our standard C library.

If not, on what functions does the link fail?

-David

QNX Training Services
dagibbs@qnx.com

Karen <chibiusa@mtu.net> wrote:

Well, I should note than even when I try to use a simple hello world program
with the -lunix option, I get this error message:

cc warning: cc: cannot find library ‘unix’

the bzero substitution worked, but now I’m hitting the same problem on
different function names. Any suggestions?

The -lunix was a QNX4-ism that doesn’t exist on QNX6 so don’t bother
trying to link against it. We already support the masking of bzero
over to memset() in <strings.h>. What other issues are you hitting?

chris

\

cdm@qnx.com > “The faster I go, the behinder I get.”

Chris McKillop – Lewis Carroll –
Software Engineer, QSSL
<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<

Karen <chibiusa@mtu.net> wrote:

First, you might want to move this discussion to qdn.public.qnx4.devtools
as this conference is for QNX6 discussions.

Well, I should note than even when I try to use a simple hello world program
with the -lunix option, I get this error message:

cc warning: cc: cannot find library ‘unix’

the bzero substitution worked, but now I’m hitting the same problem on
different function names. Any suggestions?

Can you post the entire command line that you pass to cc?

If you cd to /usr/lib, and do an “ls unix*” what do you see?

Do you set or modify the environment variable LIBQNX before invoking
cc?

-David

QNX Training Services
dagibbs@qnx.com