Hi all, basically all I want to do is create a test project that
references another project (both C++) that contains all my code.
I had this working on a win32 machine previously and am just porting
the code over. I've already managed to get all my code compiling and
running in a command line project in XCode. But now I'd like to put my
code in one project to create a library. Then create a different
project and reference that library project.
Right now, I'm leaving my code and am just trying to create two bare
bones projects - one which references the other. I initially created a
dynamic library (specifically a Carbon Dynamic Library project) and got
a tiny class that uses iostream compiling. Then I tried to include
this project in my test project (that would use this class) by adding
the project to the source directory and I just got a "No such file or
directory".
So, then I started searching online and everyone stated that this is
better achieved using a Framework (specifically a Carbon Framework).
So I tried this and this framework project returned this error:
main.c:5: error: iostream: No such file or directory
from this include directive:
#include <iostream>
God, what I wouldn't give for a simple step-by-step procedure for
creating one project that I can include in another project - as an
added bonus that project should be able to find iostream.
Please help!
Novice
illegal.prime@gmail.com - 23 Sep 2006 19:06 GMT
Alright, so I've reverted to trying to build a carbon dynamic library.
My carbon dynamic library is able to compile with this:
#include<iostream>
and use the standard libraries contained within. Then I add one of my
headers to my test project under Source. I also include my project
within my test project and it compiles.
However, when I try to use anything in my project (from within my test
project) I get this run-time error:
ZeroLink: unknown symbol '__ZN8TCStringC1Ec'
Novice
> Hi all, basically all I want to do is create a test project that
> references another project (both C++) that contains all my code.
[quoted text clipped - 28 lines]
>
> Novice
Mark - 23 Sep 2006 20:03 GMT
What you want to do is have one project with multiple targets. Examples
of targets are applications, frameworks, and dynamic libraries. Suppose
you are writing a dynamic library and you want to write an application
that tests the library. You would have one project that contains two
targets: a dynamic library target and an application target.
Choose Project > New Target to add a target to your project. If you
create a dynamic library project, you need to add an application
target. If you create an application project, you need to add a dynamic
library target.
If you're going to have a project with application and dynamic library
targets, you have to make the dynamic library target a direct
dependency of the application target. Select the name of the
application target from the Groups and Files list and click the Info
button in the project window toolbar. The target settings window will
open. Click the General tab. Click the + button to add the direct
dependency, which will be the dynamic library target.
Mark Szymczyk
Author, Xcode Tools Sensei
Now Updated for Xcode 2.4
<http://www.meandmark.com>
Michael Ash - 23 Sep 2006 22:56 GMT
> main.c:5: error: iostream: No such file or directory
You will get far better results if you avoid writing C++ in C files.
Rename this main.cc or main.cpp and you'll have much more success.

Signature
Michael Ash
Rogue Amoeba Software