[Last Call] Learn about multicloud storage options and how to improve your company's cloud strategy. Register Now

x
?
Solved

compile multi source program

Posted on 2004-10-05
3
Medium Priority
?
213 Views
Last Modified: 2010-04-22
hello, all,

 i am a quite new linux programmer, i coded one header file "A.h", two source files "B.cpp", "C.cpp".
 I needs to know how to compile and link them to an exe.

Thanx in advance

kim
0
Comment
Question by:kim_wei
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 11

Accepted Solution

by:
cjjclifford earned 100 total points
ID: 12225058
g++ B.cpp C.cpp -o test.exe

This assumes you have "g++" installed, and in your path, and that the A.h is in the current directory.
0
 

Author Comment

by:kim_wei
ID: 12225484
hello, cjjclifford,
      
  thanx a lot, if the header file in other directories, how can the header file be complied with other source files?

kim
0
 
LVL 11

Expert Comment

by:cjjclifford
ID: 12225516
the -I flag can be used to specify which directories, or if they are in subdirectories, you can change the #include line to include the (sub)directory path...

Cheers,
C.
0

Featured Post

Fill in the form and get your FREE NFR key NOW!

Veeam® is happy to provide a FREE NFR server license to certified engineers, trainers, and bloggers.  It allows for the non‑production use of Veeam Agent for Microsoft Windows. This license is valid for five workstations and two servers.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Have you ever been frustrated by having to click seven times in order to retrieve a small bit of information from the web, always the same seven clicks, scrolling down and down until you reach your target? When you know the benefits of the command l…
The purpose of this article is to demonstrate how we can upgrade Python from version 2.7.6 to Python 2.7.10 on the Linux Mint operating system. I am using an Oracle Virtual Box where I have installed Linux Mint operating system version 17.2. Once yo…
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…
Want to learn how to record your desktop screen without having to use an outside camera. Click on this video and learn how to use the cool google extension called "Screencastify"! Step 1: Open a new google tab Step 2: Go to the left hand upper corn…

650 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question