how to set up environment in C++?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • tony

    how to set up environment in C++?

    In Java, we have to set Path and classpath in order to run the
    programmes correctly. Could anybody tell me how to do this in the C++
    world? How to set the include path and lib path if I don't want to use
    any IDE?
    Thank you!
  • Zeppe

    #2
    Re: how to set up environment in C++?

    tony wrote:
    In Java, we have to set Path and classpath in order to run the
    programmes correctly. Could anybody tell me how to do this in the C++
    world? How to set the include path and lib path if I don't want to use
    any IDE?
    Thank you!
    It does not depend on the language, it depends on the compiler, so you
    have to check the compiler documentation in order to learn about the
    format of the arguments.

    Regards,

    Zeppe

    Comment

    • Stefan Naewe

      #3
      Re: how to set up environment in C++?

      On 6/19/2007 2:22 PM, tony wrote:
      In Java, we have to set Path and classpath in order to run the
      programmes correctly. Could anybody tell me how to do this in the C++
      world? How to set the include path and lib path if I don't want to use
      any IDE?
      Thank you!
      Check the manual/documentation of your compiler.

      S.
      --
      Stefan Naewe stefan dot naewe at atlas-elektronik dot com
      Don't top-post http://www.catb.org/~esr/jargon/html/T/top-post.html
      Plain text mails only, please http://www.expita.com/nomime.html

      Comment

      • Victor Bazarov

        #4
        Re: how to set up environment in C++?

        tony wrote:
        In Java, we have to set Path and classpath in order to run the
        programmes correctly. Could anybody tell me how to do this in the C++
        world? How to set the include path and lib path if I don't want to use
        any IDE?
        There is no equivalent "in the C++ world". C++ is a language that lets
        you create _native_ applications, which means that whatever environment
        you need to set up to run them is governed by the hosting operating
        system. Same for a compiler. It's just like any other application on
        your computer, nothing special about it. In order to set it up in the
        way it will work for you some special steps may be required, and that
        is NOT governed by the language, but by the compiler itself (since it's
        a native application in the majority of cases). Please refer to the
        compiler documentation to learn about all the steps needed to set it up
        correctly.

        V
        --
        Please remove capital 'A's when replying by e-mail
        I do not respond to top-posted replies, please don't ask


        Comment

        • =?UTF-8?B?RXJpayBXaWtzdHLDtm0=?=

          #5
          Re: how to set up environment in C++?

          On 2007-06-19 14:22, tony wrote:
          In Java, we have to set Path and classpath in order to run the
          programmes correctly. Could anybody tell me how to do this in the C++
          world? How to set the include path and lib path if I don't want to use
          any IDE?
          It depends on what system you are using, if you use one with gcc
          preinstalled it is probably already setup correctly. You should ask in a
          group dedicated to your system for a better answer.

          --
          Erik Wikström

          Comment

          • tony

            #6
            Re: how to set up environment in C++?

            Options of compilers can do that temporarily, but what I want is to
            setup the search directories permanently.
            To make it explicit:
            one way is:
            gcc -I <includeDir-L <libDir<src>
            yet what I want:
            set up includeDir and libDir permanently, and
            when I compile codes:
            gcc <src>
            without need of specifying options.

            Comment

            • Victor Bazarov

              #7
              Re: how to set up environment in C++?

              tony wrote:
              Options of compilers can do that temporarily, but what I want is to
              setup the search directories permanently.
              [..]
              We get that. Do you not understand that it differs from system to
              system? And it's not part of C++ _language_. RTFM for your OS.

              V
              --
              Please remove capital 'A's when replying by e-mail
              I do not respond to top-posted replies, please don't ask


              Comment

              • Tim Slattery

                #8
                Re: how to set up environment in C++?

                tony <tonywinslow198 6@gmail.comwrot e:
                >In Java, we have to set Path and classpath in order to run the
                >programmes correctly. Could anybody tell me how to do this in the C++
                >world? How to set the include path and lib path if I don't want to use
                >any IDE?
                Depends on your operating system. You'll (probably) want to add the
                directory where your application resides to the system PATH. Different
                systems will have different search strategies for libraries, you'll
                have to find out what yours does.

                --
                Tim Slattery
                Slattery_T@bls. gov

                Comment

                • shadowman

                  #9
                  Re: how to set up environment in C++?

                  tony wrote:
                  Options of compilers can do that temporarily, but what I want is to
                  setup the search directories permanently.
                  To make it explicit:
                  one way is:
                  gcc -I <includeDir-L <libDir<src>
                  yet what I want:
                  set up includeDir and libDir permanently, and
                  when I compile codes:
                  gcc <src>
                  without need of specifying options.
                  If you need help finding a good search term -- you probably want to look
                  up the 'make' utility, and makefiles.

                  Comment

                  • attibln

                    #10
                    Re: how to set up environment in C++?

                    On Jun 19, 2:22 pm, tony <tonywinslow1.. .@gmail.comwrot e:
                    In Java, we have to set Path and classpath in order to run the
                    programmes correctly. Could anybody tell me how to do this in the C++
                    world? How to set the include path and lib path if I don't want to use
                    any IDE?
                    Thank you!
                    In case you use the BASH (eiter on linux or cygwin) you could make an
                    entry in ~/.alias (create it if it doesn't exist yet) and add the line

                    alias "gccIL=gcc -I <includeDir-L <libDir>"

                    then you can use gccIL <src to compile w/o having to state the
                    include and lib directory.

                    peace!
                    ~ Attila

                    Comment

                    • Markus Schoder

                      #11
                      Re: how to set up environment in C++?

                      On Tue, 19 Jun 2007 21:17:29 +0800, tony wrote:
                      Options of compilers can do that temporarily, but what I want is to
                      setup the search directories permanently. To make it explicit:
                      one way is:
                      gcc -I <includeDir-L <libDir<src>
                      yet what I want:
                      set up includeDir and libDir permanently, and when I compile codes:
                      gcc <src>
                      without need of specifying options.
                      You can use the environment variables

                      CPLUS_INCLUDE_P ATH

                      and

                      LIBRARY_PATH

                      --
                      Markus Schoder

                      Comment

                      Working...