Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

VS2017 and multiple versions of an object. #11

Closed
fred-dev opened this issue Oct 31, 2018 · 4 comments
Closed

VS2017 and multiple versions of an object. #11

fred-dev opened this issue Oct 31, 2018 · 4 comments

Comments

@fred-dev
Copy link

I am having an issue related to a problem with VS2017 and OF, the VS/OF issue can be seen here:

openframeworks/openFrameworks#6122

Maybe I am using the wrong approach for setting up my scenes. Some of my scenes use a few addons, and in some cases, they use the same addon, or an addon that has the same dependancy as another addon. To this end, it seems VS is compiling the objects twice in the same location and then overwriting the first and it is not able to link as the original is not there.

If I make this all in a single app, it seems to work, but when i split out the apps into scenes and have my includes in each scenes .h file I get these problems.

Is there a way to add all my includes to a single file and result in the scenes to have access to all of them that they need, but only have the obj files compiled once? Or do I need to add the #include "addon.h" to each scene.h file I create?

@danomatika
Copy link
Owner

danomatika commented Oct 31, 2018

The scenes in the example are header-only as they are relatively simple. You can, of course, move the implementation into a matching .cpp file and put your includes there.

@fred-dev
Copy link
Author

sorry, maybe I was unclear, or just don't understand. Ill try to re-phrase: Is there a way to add all my includes to a single file that all my scene files can see and will result in the obj files being compiled only once?

@danomatika
Copy link
Owner

Make a single header that is included by the scenes and/or use pointers and forward class declarations? Also, make sure your headers have ifdef guards or pragma once.

Sounds like something similar to the classic circular include problem, except I wouldn't know the VS linker-specific aspect you are experiencing. I don't have a Windows setup to test anything. It seems like this may be more of a general C++, OF, & VS issue than ofxAppUtils-specific.

@fred-dev
Copy link
Author

Yes, you are right, I think it is a VS issue, I have the exact code working perfectly on OSX (thanks for your work btw). It seems it is this issue of VS overwriting obj files in compilation. It seems it is not related to this addon specifically as I have now found it with some other addons and much simpler structures. Many thanks, I will mark this as closed, sorry for the distraction.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants