Re: [Dev-C++] Compiling Separately: Separating Code into Modules ...
Open Source C & C++ IDE for Windows
Brought to you by:
claplace
|
From: JB M. <jb...@so...> - 2003-06-09 18:18:51
|
Mark,
thanks for the tip, but that's not the BIG problem. I am following along
with Jesse Liberty's book SAMS Teach Yourself C++ in 10 Minutes. I
understand the return types, but I was just taking the author's source code
from the web site for the book.
I am more of a Java Programmer currently, but I used to use Borland C++
3.1 back in the late 80's/early 90's.
This is specific to the Dev-C++ IDE (which is why I have written to the
list).
** I get 0 (zero) errors when attempting to compile the project or its
individual files. **
I am trying to compile a few files. I have two implementation files with
associated header files, and the main funtion in a separate file. The book
shows the header files with a .h extension and the implementation files with
a .cpp extension.
My questions are these:
Does the order of files in the project matter?
Does the extension have to be .hpp (or is .h OK) for header
files?
If all of the files are included in the project, shouldn't I just be
able to hit Ctrl-F10 and watch the thing link and compile the files,
and then run?
----- Original Message -----
From: "Mark Livingstone" <mli...@ip...>
To: "JB Maust" <jb...@so...>
Sent: Saturday, June 07, 2003 8:30 AM
Subject: Re: [Dev-C++] Compiling Separately: Separating Code into Modules
...
> On Thu, 5 Jun 2003 21:31:41 -0400, you wrote:
>
> > Hello,
> >
> > I am trying to compile a modular program. Is there an order to this
(i.e. if I'm using Borland C++ Compiler at the DOS command prompt I'd have
to compile each file separately, but with Dev C++ 4 (an IDE) I'm not sure.
> >
> > When I try to compile the files separately, I get zero errors but
zero bytes compiled ... what could be wrong?
> >
> > I anybody can explain the procedure to me, I would appreciate it.
>
> Try returning an int rather than a float ;-)
>
> >
> > Below is the main() function "Main.cpp" which refers to the header and
implementation files.
>
>
> > int main(int argc, char* argv[])
> ^^^^^^^^^^^^
> > {
> > SAMSErrorHandling::Initialize();
> >
> > float ReturnCode = 0;
> ^^^^^^^^^^^^^^^^^^^^^^^^^^
>
> >
> > try
> > {
> > float Dividend = GetDividend();
> > float Divisor = GetDivisor();
> >
> > cout << Divide(Dividend, Divisor) << endl;
> > }
> > catch (...)
> > {
> > ReturnCode =
> > SAMSErrorHandling::HandleNotANumberError();
> > };
> >
> > SAMSPrompt::PauseForUserAcknowledgement();
> > return ReturnCode;
> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> > }
|