Solved

linking in C++

Posted on 2003-11-04
1
207 Views
Last Modified: 2010-04-17
Frndz ,

I have 2 file ,  a.cpp and b.cpp    . class abc is implemented in b.cpp .
I want to instantiate a obj of class abc and use it in a.cpp . How can I do this ?

how should be my make file ?

thanks in advance .
Raghava
0
Comment
Question by:raghava_dg
1 Comment
 
LVL 1

Accepted Solution

by:
tegila earned 50 total points
ID: 9677950
first, add in a.cpp:
#include "b.cpp"
next step is compile your program:
use
gcc -c a.cpp -o a.o
gcc -c b.cpp -o b.o
gcc a.o b.o -o out.exe
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
wordmultiple challenge 12 119
Tviruailstringtree sort multi columns on header click 1 53
Windows Service to Receive TCP Packets 4 122
This code tracks birthdays 3 60
This article will show, step by step, how to integrate R code into a R Sweave document
Whether you've completed a degree in computer sciences or you're a self-taught programmer, writing your first lines of code in the real world is always a challenge. Here are some of the most common pitfalls for new programmers.
In this fifth video of the Xpdf series, we discuss and demonstrate the PDFdetach utility, which is able to list and, more importantly, extract attachments that are embedded in PDF files. It does this via a command line interface, making it suitable …
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

920 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

17 Experts available now in Live!

Get 1:1 Help Now