Solved

compile multi source program

Posted on 2004-10-05
3
210 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 25 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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
File system unmounted 3 167
install command in linux 1 61
Understanding curl command 1 64
Shell script for mvn build 2 83
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…
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…
Finding and deleting duplicate (picture) files can be a time consuming task. My wife and I, our three kids and their families all share one dilemma: Managing our pictures. Between desktops, laptops, phones, tablets, and cameras; over the last decade…
Suggested Courses

737 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