By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,952 Members | 949 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,952 IT Pros & Developers. It's quick & easy.

how to set up environment in C++?

P: n/a
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!
Jun 19 '07 #1
Share this Question
Share on Google+
10 Replies


P: n/a
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
Jun 19 '07 #2

P: n/a
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
Jun 19 '07 #3

P: n/a
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
Jun 19 '07 #4

P: n/a
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
Jun 19 '07 #5

P: n/a
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.
Jun 19 '07 #6

P: n/a
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
Jun 19 '07 #7

P: n/a
tony <to*************@gmail.comwrote:
>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
Sl********@bls.gov
http://members.cox.net/slatteryt
Jun 19 '07 #8

P: n/a
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.
Jun 19 '07 #9

P: n/a
On Jun 19, 2:22 pm, tony <tonywinslow1...@gmail.comwrote:
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

Jun 20 '07 #10

P: n/a
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_PATH

and

LIBRARY_PATH

--
Markus Schoder
Jun 20 '07 #11

This discussion thread is closed

Replies have been disabled for this discussion.