VCC - share classes between projects within same solution?

Started by
4 comments, last by NotAYakk 16 years, 10 months ago
I have one solution, which contains 2 projects - an application that the users will use, and a command line tool that technically inclined people will use to set up the app. Both of these projects share functionality, so I thought it would be fairly sensible for them to require the same cpp & h files. I can't find a way of doing this without getting linker errors. Is there a specific way? I added the files from one project into the other project (so its just pointing to the same files) but then I get \RomPaths.cpp(63): fatal error C1010: unexpected end of file while looking for precompiled header directive when compiling the app that had the files added to the project (and doesn't acutually have the original files in its folders)

For local multiplayer retro themed games, visit Domarius Games.

Advertisement
Okay out of desperation I manually copied the relevent files over to the other project that needs to share them - and I still get the same error. I don't even know what it means...

For local multiplayer retro themed games, visit Domarius Games.

Some info on the net tells me that all I have to do is add the required files to the project, without duplicating the files themselves, and it should work, so I guess my problem is a different one.

http://www.delphifaq.com/faq/f923.shtml
Seems my problem might be with this. I do have a stdafx.h file but I've never had to use it before. I just created a new console app and accepted the default code. Normally I've been taught (in class) to make an empty project, and we don't use stdafx.h

I guess I'll keep experimenting.

For local multiplayer retro themed games, visit Domarius Games.

Try turning off precompiled headers (Project Properties -> C/C++ -> Precompiled Headers) or including "stdafx.h" at the start of each source file in any projects in which you are using precompiled headers.
Thankyou! That was all it was, it's working great now. I think I even have that little tidbit in my notes somewhere...

You brought my project out of a stand-still :) I wasn't going to progress until I'd solved this.

For local multiplayer retro themed games, visit Domarius Games.

A cleaner solution would be to put the shared functionality in a library project that both the command-line and windows-based projects import.

This topic is closed to new replies.

Advertisement