473,396 Members | 2,147 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,396 software developers and data experts.

seprate compilation for classes

Is it possible to seperately compile two classes (suppose class A and
class B ) , and use class A
in class B .I wish to compile two classes class A in A.c and A.hh and
class B in B.c and B.hh , and then use one class in another , by
combining them during link time .(gcc -c A.o B.o -o output )
Jun 27 '08 #1
2 1086
katyusha wrote:
Is it possible to seperately compile two classes (suppose class A and
class B ) , and use class A
in class B .I wish to compile two classes class A in A.c and A.hh and
class B in B.c and B.hh , and then use one class in another , by
combining them during link time .(gcc -c A.o B.o -o output )
Just #include "A.hh" in B.hh and use A in B.

Btw, I think it's a bad idea to name your source files with ".c" if
they are C++ files.

Jun 27 '08 #2
On Apr 16, 7:20*am, katyusha <milo...@gmail.comwrote:
Is it possible to seperately compile two classes (suppose class A and
class B ) , and use class A
in class B .I wish to compile two classes class A in A.c and A.hh *and
class B in B.c and B.hh , and then use one class in another , by
combining them during link time *.(gcc -c *A.o B.o -o output )
You can use forward declarations to solve this problem. For details
refer to:

http://www.eventhelix.com/RealTimeMa...dePatterns.htm

--
EventStudio 4.0 - http://www.Eventhelix.com/Eventstudio/
Sequence diagram based systems engineering tool
Jun 27 '08 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Novice | last post by:
Hi all, I'm afraid this is the second posting of this information as I didn't get a response on the previous post. I will try to shorten my message (i.e. be more concise) in the hopes that it will...
3
by: Tiraman | last post by:
Hi, Can some one explain me why do i need to compile a web application or in other words , what is the deference between 2 web sites (same files) but one of them was compiled and the other...
3
by: Dan | last post by:
Hi, I have a problem using an aspx page with a Control on it. I get the following error message Compiler Error Message: CS1595: 'Test.Class2' is defined in multiple places; using definition...
3
by: Robert | last post by:
I have a number of web projects converted from 1.1 to 2.0 in VS2005. I am methodically seeing the error below: The element 'compilation' has invalid child element 'compilers'. List of...
1
by: Alexander Walker | last post by:
Hello I have recently published a web application using the "Publish Web Site" option of the solution explorer from Visual Studio 2005, I have published the website so that the pages could not...
1
by: kuldeep singh sethi | last post by:
Hi friends!!!!!!!!! Code for create a seprate email id account like yahoo,gmail or others. i want to know that how a new account is created like yahoo, gmail. Means the seperate account. when a...
35
by: mwelsh1118 | last post by:
Why doesn't C# allow incremental compilation like Java? Specifically, in Java I can compile single .java files in isolation. The resulting individual .class files can be grouped into .jar files....
7
by: dupin | last post by:
Hi, I´m compiling a C++ program with g++ 2.9.5 on SunOS 5.8. I have made a project with NetBeans 5.5.1 and getting from it the make files. The compilation and linking process ocurrs...
1
by: BSand0764 | last post by:
I'm getting an error that I can't seem to resolve. When I compile the Functor related logic in a test program, the files compile and execute properly (see Listing #1). However, when I...
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
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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
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...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.