Author Topic: Linking a .cpp file to a project...  (Read 2633 times)

Offline tabl3six

  • Single posting newcomer
  • *
  • Posts: 5
Linking a .cpp file to a project...
« on: August 26, 2011, 09:05:48 pm »
This is part of an example in a book I'm reading. Can't get the code to run.

Can anyone walk me through what I'm supposed to do here. I'll paste in the function in the mean time, but like to know if it's possible to do what the author is suggesting.

Thanks all.

Code
#include <iostream>

#include "Fract.h" // Declaration of Fraction class must
                   // be placed in Fract.h.
using namespace std;

// Note: Fract.cpp must be compiled and linked into
// the project, or else Fraction frunction defs must be
// copied into this file.

Offline codeur

  • Multiple posting newcomer
  • *
  • Posts: 113
    • Code::Blocks EDU-Portable
Re: Linking a .cpp file to a project...
« Reply #1 on: August 27, 2011, 02:52:37 am »
Google is your friend there, but finding the easiest info source for your needs can take time:

* To make a project and place a source file into the project the easiest is this page in the Code::Blocks wiki: http://wiki.codeblocks.org/index.php?title=Creating_a_new_project

* The following "Student Manual" from Brooklyn College gives some more info about CB for students and learners:
http://www.sci.brooklyn.cuny.edu/~goetz/codeblocks/codeblocks-instructions.pdf

* The Code::Blocks manual: http://www.codeblocks.org/user-manual is more complete but could confuse beginners.
« Last Edit: August 27, 2011, 03:07:54 am by codeur »