LinuxQuestions.org
Visit the LQ Articles and Editorials section
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices

Closed Thread
 
Search this Thread
Old 03-03-2004, 01:50 PM   #1
arnab_be
LQ Newbie
 
Registered: Mar 2004
Posts: 3

Rep: Reputation: 0
Using g++ to compile multiple source files


Hi,
I have a total of 5 files:

1. test.cpp
#include"TextTranslator.h"
#include<fstream>

int main()
{
ifstream examplefile("readme.txt");
TextTranslator tt(examplefile);
tt.translation(examplefile);
return(0);
}

2. TextTranslator.cpp
#include"TextTranslator.h"
#include<iostream>
#include<fstream>
#include<stdlib>
TextTranslator :: TextTranslator(){
}
TextTranslator :: TextTranslator(ifstream examplefile){

if (! examplefile.is_open())
{
cout << "Error opening file";
exit (1);
}
}
void TextTranslator :: translation(ifstream examplefile)
{
ofstream outfile("readme.xml");
outfile << "<Document>\n";
outfile << examplefile.rdbuf();
outfile << "\n</Document>";
outfile.close();
}

3. TextTranslator.h
#include"Translator.h>
#include<fstream.h>
class TextTranslator: public Translator {
public:
TextTranslator();
 
Old 03-03-2004, 03:21 PM   #2
XavierP
Moderator
 
Registered: Nov 2002
Location: Kent, England
Distribution: Lubuntu
Posts: 19,176
Blog Entries: 4

Rep: Reputation: 430Reputation: 430Reputation: 430Reputation: 430Reputation: 430
Please do not post the same thread in more than one forum. Picking the most relevant forum and posting it once there makes it easier for other members to help you and keeps the discussion all in one place.

http://www.linuxquestions.org/rules.php

And trying to post 3 times in the wrong forum is clearly against the rules. Please do not do it again.
 
  


Closed Thread


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
unable to compile source files Hallowedpoint Linux - Newbie 6 11-19-2005 09:02 AM
multiple C source files howto introuble Programming 2 07-31-2005 08:49 PM
Where must I download files to so I can compile and install from source? eBopBob Linux - Software 3 08-12-2004 03:52 PM
Using g++ to compile multiple source files arnab_be Linux - Newbie 1 03-03-2004 03:22 PM
I need help using multiple source files CodeWarrior Programming 4 12-30-2003 05:18 AM


All times are GMT -5. The time now is 02:26 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration