qcc flags

I a currently porting my (large) QNX4 product to Neutrino and have run
into some questions regarding qcc vs. the watcom tools.

  1. Is the a way to limit the number of error messages generated
    by qcc. Using watcom you could limit the number of warnings and error
    messages to something usefull (like a page). with qcc of there is a
    missing header you can end up with 27 gazillion warnings - of which
    only the initial one are valid. I’m stuck hitting ctrl-s at the
    moment…

  2. How does one use qcc to multiply search libraries during
    linking. The gcc man pages mention the -( libnames -) to do this but
    I was unable to use -W to specify this under qcc and was forced to
    include libraries multiple times to get things to link. It works but
    it sure is ugly…

  3. It seems if you are linking in a bunch of static libraries you
    need to throw in a -Bdynamic afterword so you can automatically pick
    up llibc.so.1 – also what is the naming convetion for libraries if
    you have a " -l m" you will load in libm.a or .so – what are the
    rules that allow this i.e. how do I name my libraries so the linker
    can automaticallly find them (prepend lib to them?).

  4. Is there a special make target like FORCE which always forces
    the target to be made. Note: I am not using the qssl make rules. Also
    the examples in the makefile documentation mention a project that
    does not exist on my machine (QNXRTP) although the mignto project is
    there. Mention is made to the O’Reilly book for more info about the
    neutrino (gnu) make - is that my best source for info?

  5. On a docs note, the PhEventRead docs have an example with a
    Receive in the code – it provides a link to MsgReceive but the
    example seems to be QNX4.

Given the above questions - I’m looking for more documentation for the
tools than the man page and on-line help. Is there a O’reilly book
which covers these tools in more depth?

Thanks,
Bill Derby

William M. Derby Jr. <derbyw@derbtronics.com> wrote:

I a currently porting my (large) QNX4 product to Neutrino and have run
into some questions regarding qcc vs. the watcom tools.

  1. Is the a way to limit the number of error messages generated
    by qcc. Using watcom you could limit the number of warnings and error
    messages to something usefull (like a page). with qcc of there is a
    missing header you can end up with 27 gazillion warnings - of which
    only the initial one are valid. I’m stuck hitting ctrl-s at the
    moment…

I don’t know of a way off-hand – but you could always redirect the
output to a file, then you get the whole of the output. Or pipe the
output to more or less, and then you have the output paged. qcc might
use stderr for the output, so you might have to redirect that as well.

e.g.

qcc blah | less 2>&1
qcc blah > compile.out 2>&1
make blah > make.out 2>&1

-David

William M. Derby Jr. <derbyw@derbtronics.com> wrote:

I a currently porting my (large) QNX4 product to Neutrino and have run
into some questions regarding qcc vs. the watcom tools.

  1. Is the a way to limit the number of error messages generated
    by qcc. Using watcom you could limit the number of warnings and error
    messages to something usefull (like a page). with qcc of there is a
    missing header you can end up with 27 gazillion warnings - of which
    only the initial one are valid. I’m stuck hitting ctrl-s at the
    moment…

No. I normally pipe the errors (they will be on stderr) to less
or to a file.

  1. How does one use qcc to multiply search libraries during
    linking. The gcc man pages mention the -( libnames -) to do this but
    I was unable to use -W to specify this under qcc and was forced to
    include libraries multiple times to get things to link. It works but
    it sure is ugly…

Here’s an even uglier one…

-Wl,"-(" -lone -ltwo -lthree -Wl,"-)"

or equivalently

-Wl,–start-group -lone -ltwo -lthree -Wl,–end-group

Note that this will have an impact on the linking time for your
application, and should only be used when you have circular dependencies
in your libs (ick)

  1. It seems if you are linking in a bunch of static libraries you
    need to throw in a -Bdynamic afterword so you can automatically pick
    up llibc.so.1 – also what is the naming convetion for libraries if
    you have a " -l m" you will load in libm.a or .so – what are the
    rules that allow this i.e. how do I name my libraries so the linker
    can automaticallly find them (prepend lib to them?).

-Bdynamic and -Bstatic are like toggles. They affect how the linker
searches for libraries. By default it will look for lib"name".so, then
lib"name".a. Setting -Bstatic will cause it to only look for the .a
version. Setting -Bdynamic changes it to look for .so versions again.

Libraries should be named libyourname.so or libyourname.a, depending
on whether they have been built as dynamically or static libraries.

  1. Is there a special make target like FORCE which always forces
    the target to be made. Note: I am not using the qssl make rules. Also
    the examples in the makefile documentation mention a project that
    does not exist on my machine (QNXRTP) although the mignto project is
    there. Mention is made to the O’Reilly book for more info about the
    neutrino (gnu) make - is that my best source for info?

Checkout http://www.gnu.org/manual/make/index.html


cburgess@qnx.com

Here’s an even uglier one…

-Wl,"-(" -lone -ltwo -lthree -Wl,"-)"

Ahhh, I didn’t have the quotes

Note that this will have an impact on the linking time for your
application, and should only be used when you have circular dependencies
in your libs (ick)

Mine are not circular but there is about 15 of them and I had to play
around untl I got the order correct which of course was a new
exercise…I guess I wanted to "take the easy way out"™


Thanks guys…

Bill