473,386 Members | 1,883 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

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!
Jun 19 '07 #1
10 1563
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
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
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
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
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
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
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
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
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

19
by: Vijay Kumar R Zanvar | last post by:
Hi clc, I want to know few examples of freestanding environments. -- "There's money in this case, Watson," he continued, glancing out of the window, "if there is nothing else." - A Scandal...
4
by: Bill Davidson | last post by:
All: I've found the 'Environment.GetEnvironmentVariable()' method; but how do I create and/or set an environment variable? Thanks, Bill
4
by: | last post by:
Hi all, I am trying to append a certain string to the PATH environment variable programmatically. I am able to read what is in the variable using the System.Environment method...
10
by: Edward | last post by:
I've just taken over maintaining a system from a colleague who has left. I find the following line in her code: Dim params(2) As SqlClient.SqlParameter params(0) = New...
6
by: Matt | last post by:
Is there a way to retrieve the Windows Environment Variables (Such as User ID) with Javascript in IE?
6
by: Fuzzyman | last post by:
Hello all, I would like to set a Windows Environment variable for another (non-child) process. This means that the following *doesn't* work : :: os.environ = value In the ``win32api``...
11
by: rossum | last post by:
I want to declare a const multi-line string inside a method, and I am having some problems using Environment.NewLine. I started out with: class foo { public void PrintStuff() { const...
0
by: Joe HM | last post by:
Hello - I am putting together a little ConsoleApplication that is supposed to check for an Environment Variable and create it if it does not exist. I found some code that will add a new...
3
by: smitty1e | last post by:
Just a fun exercise to unify some of the major input methods for a script into a single dictionary. Here is the output, given a gr.conf file in the same directory with the contents stated below: ...
1
by: replysonika | last post by:
Hello, I run a Java app with subprocess from Python script. This python script is called from another Python Wrapper. python = subprocess.Popen(, stdout=subprocess.PIPE,...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.