programming in C/C++ - Solaris

This is a discussion on programming in C/C++ - Solaris ; Hi, I want to write some C and C++ code (using either vi or emacs), but I'm not sure what packages to use. I have gcc installed, both from Blastwave and Sunfreeware, adjusted the path in .profile accordingly for either ...

+ Reply to Thread
Page 1 of 2 1 2 LastLast
Results 1 to 20 of 22

Thread: programming in C/C++

  1. programming in C/C++

    Hi,

    I want to write some C and C++ code (using either vi or emacs), but I'm
    not sure what packages to use. I have gcc installed, both from Blastwave
    and Sunfreeware, adjusted the path in .profile accordingly for either
    /opt/sfw/.. or /usr/local/..
    Despite that, gcc can't find stdio.h, and g++ gives lots of errors on
    iostream. So my question is: what should I have installed (and how
    should I adjust the path)?
    Sorry if this is OT.

    Thanks,

    Huub

  2. Re: programming in C/C++

    On Mon, 30 Oct 2006, Huub wrote:

    > I want to write some C and C++ code (using either vi or emacs), but I'm not
    > sure what packages to use. I have gcc installed, both from Blastwave and
    > Sunfreeware, adjusted the path in .profile accordingly for either /opt/sfw/..
    > or /usr/local/..


    I recommend the use of Sun's (free) compiler.

    > Despite that, gcc can't find stdio.h, and g++ gives lots of errors on
    > iostream. So my question is: what should I have installed (and how should I
    > adjust the path)?


    Check out my article on building software on Solaris; it's linked to
    from my home page: www.rite-group.com/rich.

    HTH,

    --
    Rich Teer, SCNA, SCSA, OpenSolaris CAB member

    President,
    Rite Online Inc.

    Voice: +1 (250) 979-1638
    URL: http://www.rite-group.com/rich

  3. Re: programming in C/C++

    >
    > I recommend the use of Sun's (free) compiler.


    I assume you mean Sun Studio? Or do cc and CC come with a package?

    >
    > Check out my article on building software on Solaris; it's linked to
    > from my home page: www.rite-group.com/rich.


    Thanks.

  4. Re: programming in C/C++

    On Mon, 30 Oct 2006, Huub wrote:

    > I assume you mean Sun Studio? Or do cc and CC come with a package?


    Yep, Sun Studio.

    --
    Rich Teer, SCNA, SCSA, OpenSolaris CAB member

    President,
    Rite Online Inc.

    Voice: +1 (250) 979-1638
    URL: http://www.rite-group.com/rich

  5. Re: programming in C/C++

    >
    > Yep, Sun Studio.
    >


    Ok, got it installed and working. Question though: on Linux I'm used to
    use #include and #include for C and C++
    respectively. cc gives the error it can't find stdio.h. Does Solaris use
    another library? Or is this something extra I have to install?

  6. Re: programming in C/C++

    Huub wrote:
    >>
    >> Yep, Sun Studio.
    >>

    >
    > Ok, got it installed and working. Question though: on Linux I'm used to
    > use #include and #include for C and C++
    > respectively. cc gives the error it can't find stdio.h. Does Solaris use
    > another library?


    stdio.h isn't a library but a header file.

    > Or is this something extra I have to install?


    Likely SUNWhea.

    It looks like you didn't install Solaris with the developer or higher
    cluster, so you are probably missing these too:

    SUNWtoo SUNWarc SUNWast SUNWbtool SUNWsprot SUNWlibmr SUNWlibm SUNWlibC
    SUNWzlib SUNWscpr SUNWscpu SUNWcpp

  7. Re: programming in C/C++

    Jean-Louis Liagre wrote:
    > Huub wrote:
    >>>
    >>> Yep, Sun Studio.
    >>>

    >>
    >> Ok, got it installed and working. Question though: on Linux I'm used
    >> to use #include and #include for C and C++
    >> respectively. cc gives the error it can't find stdio.h. Does Solaris
    >> use another library?

    >
    > stdio.h isn't a library but a header file.
    >
    >> Or is this something extra I have to install?

    >
    > Likely SUNWhea.
    >
    > It looks like you didn't install Solaris with the developer or higher
    > cluster, so you are probably missing these too:
    >
    > SUNWtoo SUNWarc SUNWast SUNWbtool SUNWsprot SUNWlibmr SUNWlibm SUNWlibC
    > SUNWzlib SUNWscpr SUNWscpu SUNWcpp


    At installation I chose everything except OEM. So I should have them.
    How do I check this? pkginfo?

  8. Re: programming in C/C++

    On Mon, 30 Oct 2006, Huub wrote:

    > At installation I chose everything except OEM. So I should have them. How do I


    OK, that means that you should have it.

    > check this? pkginfo?


    Yep; you should get something like this if it's installed OK:

    rich@marrakesh5006# pkginfo SUNWhea
    system SUNWhea SunOS Header Files

    --
    Rich Teer, SCNA, SCSA, OpenSolaris CAB member

    President,
    Rite Online Inc.

    Voice: +1 (250) 979-1638
    URL: http://www.rite-group.com/rich

  9. Re: programming in C/C++

    On Mon, 30 Oct 2006 18:33:04 +0100, Huub <"v.niekerk at hccnet.nl"> wrote:
    >>
    >> Yep, Sun Studio.
    >>

    >
    > Ok, got it installed and working. Question though: on Linux I'm used to
    > use #include and #include for C and C++
    > respectively. cc gives the error it can't find stdio.h. Does Solaris use
    > another library? Or is this something extra I have to install?


    You are a bit confused. stdio.h and iostream are headers, not libraries.
    libc.so and libCstd.so/libCrun.so are the libraries.

    It's possible that you didn't do a developer install, and do not have
    the headers in /usr/include. It's the SUNWhea package. You'll also need
    SUNWsprot, perhaps some more.

    A bientot
    Paul
    --
    Paul Floyd http://paulf.free.fr (for what it's worth)
    Surgery: ennobled Gerald.

  10. Re: programming in C/C++


    "Rich Teer" wrote in message
    news:Pine.SOL.4.64.0610301011200.26476@marrakesh.. .
    > --
    > Rich Teer, SCNA, SCSA, OpenSolaris CAB member


    Rich, care to comment on my thread on the SCSA certification? :-)

    Thanks.



  11. Re: programming in C/C++

    Rich Teer wrote:
    > On Mon, 30 Oct 2006, Huub wrote:
    >
    >> At installation I chose everything except OEM. So I should have them. How do I

    >
    > OK, that means that you should have it.
    >
    >> check this? pkginfo?

    >
    > Yep; you should get something like this if it's installed OK:
    >
    > rich@marrakesh5006# pkginfo SUNWhea
    > system SUNWhea SunOS Header Files
    >


    It looks like I do have some and don't have others. Like I don't have
    SUNWhea and I do have SUNWtoo. What is the easiest way to install the
    missing ones?

  12. Re: programming in C/C++

    Huub wrote:
    > Rich Teer wrote:
    >
    >> On Mon, 30 Oct 2006, Huub wrote:
    >>
    >>> At installation I chose everything except OEM. So I should have them.
    >>> How do I

    >>
    >>
    >> OK, that means that you should have it.
    >>
    >>> check this? pkginfo?

    >>
    >>
    >> Yep; you should get something like this if it's installed OK:
    >>
    >> rich@marrakesh5006# pkginfo SUNWhea
    >> system SUNWhea SunOS Header Files
    >>

    >
    > It looks like I do have some and don't have others. Like I don't have
    > SUNWhea and I do have SUNWtoo. What is the easiest way to install the
    > missing ones?


    As you know what they are, pkgadd them from the install media. I'm not
    sure which CD, but look in the Product directories.

    --
    Ian Collins.

  13. Re: programming in C/C++

    > As you know what they are, pkgadd them from the install media. I'm not
    > sure which CD, but look in the Product directories.
    >


    Ok. Found them on disk4, but

    # pkgadd -d SUNWarc/
    pkgadd: ERROR: no packages were found in


    and

    # pkgadd -d . SUNWarc/
    pkgadd: ERROR: no package associated with

    Also tried it from directories below it which didn't work either. So
    hints are welcome.

  14. Re: programming in C/C++

    Huub wrote:
    >> As you know what they are, pkgadd them from the install media. I'm not
    >> sure which CD, but look in the Product directories.
    >>

    >
    > Ok. Found them on disk4, but
    >
    > # pkgadd -d SUNWarc/
    > pkgadd: ERROR: no packages were found in
    >
    >

    -d requires the full path. See the first example in the man page (you
    did read through the man page, didn't you?)

    --
    Ian Collins.

  15. Re: programming in C/C++

    Ian Collins wrote:
    > Huub wrote:
    >>> As you know what they are, pkgadd them from the install media. I'm not
    >>> sure which CD, but look in the Product directories.
    >>>

    >> Ok. Found them on disk4, but
    >>
    >> # pkgadd -d SUNWarc/
    >> pkgadd: ERROR: no packages were found in
    >>
    >>

    > -d requires the full path. See the first example in the man page (you
    > did read through the man page, didn't you?)
    >


    I tried:

    # man pkgadd
    No manual entry for pkgadd.

    So I guess I have to install more than just these packages.

  16. Re: programming in C/C++

    Huub <"v.niekerk at hccnet.nl"> wrote:
    >
    > # pkgadd -d . SUNWarc/
    > pkgadd: ERROR: no package associated with


    Use "pkgadd -d . SUNWarc" (without the '/').

    mp.
    --
    Systems Administrator | Institute of Scientific Computing | Univ. of Vienna
    | http://www.par.univie.ac.at/solaris/pca/
    Patch Check Advanced | Analyze, download and install patches for Sun Solaris

  17. Re: programming in C/C++

    >
    > Use "pkgadd -d . SUNWarc" (without the '/').
    >
    > mp.


    Thank you.

  18. Re: programming in C/C++


    Huub wrote:
    > Jean-Louis Liagre wrote:
    > > Huub wrote:
    > >>> Yep, Sun Studio.
    > >> Ok, got it installed and working. Question though: on Linux I'm used
    > >> to use #include and #include for C and C++
    > >> respectively. cc gives the error it can't find stdio.h. Does Solaris
    > >> use another library?

    > > stdio.h isn't a library but a header file.
    > >> Or is this something extra I have to install?

    > > Likely SUNWhea.
    > > It looks like you didn't install Solaris with the developer or higher
    > > cluster, so you are probably missing these too:
    > > SUNWtoo SUNWarc SUNWast SUNWbtool SUNWsprot SUNWlibmr SUNWlibm SUNWlibC
    > > SUNWzlib SUNWscpr SUNWscpu SUNWcpp

    > At installation I chose everything except OEM. So I should have them.


    As this thread stumbles along, it appears that you did no such thing :
    <
    I suggest an initial install. Start over and do things properly.
    You dont need to have 4 different c/g++ compilers (hopefully).
    Backup anything you think you need to save of course.
    The time you spend on this now will save many more hours later.


  19. Re: programming in C/C++

    >
    > As this thread stumbles along, it appears that you did no such thing :
    > <
    > I suggest an initial install. Start over and do things properly.
    > You dont need to have 4 different c/g++ compilers (hopefully).
    > Backup anything you think you need to save of course.
    > The time you spend on this now will save many more hours later.
    >


    With all your friendly help, it seems I have what I need to program. I
    tested a " Hello World" in C and C++, and with commandline cc and CC
    they run ok. So for now, no need to reinstall. What I did realize btw,
    is that during install disk4 gave "failed" on some items. My guess is
    that those failed item were in fact those I installed manually now.
    So reinstalling everything once again is not necessary and no option for me.

    Thank you.

  20. Re: programming in C/C++

    On Tue, 31 Oct 2006, Alex R wrote:

    > Rich, care to comment on my thread on the SCSA certification? :-)


    Sure, but I didn't read it (the thread). In a nutshell, what was
    your question?

    --
    Rich Teer, SCNA, SCSA, OpenSolaris CAB member

    President,
    Rite Online Inc.

    Voice: +1 (250) 979-1638
    URL: http://www.rite-group.com/rich

+ Reply to Thread
Page 1 of 2 1 2 LastLast