This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
compiling multi file project
- From: Jan de Haan <haan dot j dot de at gmail dot com>
- To: gcc at gcc dot gnu dot org
- Date: Fri, 24 Jan 2014 13:35:59 +0100
- Subject: compiling multi file project
- Authentication-results: sourceware.org; auth=none
Hi All,
banging my head, exhausted google, don't know where I make the mistake,
can somebody please tell me the errors of my ways?
Project layout:
projectheader.h
#ifndef PROJECTHEADER
#define PROJECTHEADER
#include <projectwidesystemheaders>
#include "class1header"
main.cpp
#include "projectheader"
class1header.h
#ifndef CLASS1HEADER
#define CLASS1HEADER
#include <class1specificsystemheaders>
#include <tr1/memory>
typedef shared_ptr<Class1> Class1Ptr;
class1source.cpp
#include "class1header"
definitions
A sound and logical layout, as far as I know.
Problem: class1source.cpp fails to compile on it's header with
"error: ‘shared_ptr’ does not name a type"
What is wrong with my layout (because including the projectheader in
class1source compiles) and what is the best thing I can do about it?
Sincerely,
Jan de Haan.
--
"Piracy is simply demand where supply does not exist."