Solved

compile multi source program

Posted on 2004-10-05
3
206 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
  • 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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
Optimize bash script 20 449
Problem to line 1 44
What is the timeframe of this cron job? 2 110
Linux Hanging with disable Error Output 4 70
The purpose of this article is to fix the unknown display problem in Linux Mint operating system. After installing the OS if you see Display monitor is not recognized then we can install "MESA" utilities to fix this problem or we can install additio…
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…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…

705 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

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now