Sign in to follow this  
Bagpuss

Compiler Issue (MS Vis Studio)

Recommended Posts

OK, I have somehow managed to break my program. I had a fully working program (Project A) with a number of classes I put in just as placeholders, so I wouldnt forget to add them later. (They were irrelevant for what I was working on) In another Project (Project B) I hve 2 classes that I would like to use in Project A to replace the placeholder classes. I have added these to the files section of Visual studio, and changed the location of the headers to point to my other project. (I dont want to copy them in to the project folder, as Im maintaining 2 versions of the same classes then) But when I go to compile, I get the error message "The Source Files d:\\Source\ProjectA\foo.cpp and D:\\Source\ProjectB\foo.cpp are both configured to produce the output d:\\Source\ProjectB\foo.obj. Project cannot be built" I have had a good louck amogst all the settings and cannot find out where to change this. I didnt link Project B into a, just referenced the 2 .h files. Before I give in and just copy the class files over to my new project and have to maintain 2 sets of code, can anyone tell me where / how to fix this. Thansk, Bp

Share this post


Link to post
Share on other sites
Simple: you can only have one copy of foo.cpp in your project. Did you forget to remove foo.cpp from project A before adding the one from project b?

Share this post


Link to post
Share on other sites
thanks for the reply. Yes, all copies of the old files are still there, but renamed _oldFoo and _oldBar.

Hmm, its a mystery

Bp

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this