Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

rileyriley

Puzzling project/solution setup in VS.net

This topic is 5327 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I have my program split up into several projects within the same solution in VS.net (C++). There is a "main" project that lists the other projects as its dependencies. For example, I have a graphics project and a math project, and they both feed into the main project. The main project outputs an executable, and the other projects output libraries in .lib form. The problem comes when I want to use an additional library that I did not write (for example, d3d9.lib). To use them, I go to the particular project that needs them and add them to the particular project's 'Additional Dependencies' property, and that is all. Then, when I try to build the solution, I get a long list of warnings about redefinitions. For example: d3d9.lib(d3d9.dll) : warning LNK4006: _Direct3DCreate9@4 already defined in d3d9.lib(d3d9.dll); second definition ignored I get one of those for every function in the library. This happens whether I build the entire solution or just the one project. Does anyone know why this might be happening? Thanks for any insight~ edit: PS: I have checked everywhere for somewhere I might have required the library twice.. in each case, I only add the library to one dependency list! [edited by - rileyriley on January 14, 2004 7:55:21 PM]

Share this post


Link to post
Share on other sites
Advertisement
If I understand your problem, then I would say that you shouldn''t link against d3d9.lib in your libraries. Only do it in your main project.

Share this post


Link to post
Share on other sites
Thanks, that works perfectly. I guess I don''t quite understand how the project heirarchy goes yet.


Now I''m getting
LINK : warning LNK4098: defaultlib ''LIBC'' conflicts with use of other libs; use /NODEFAULTLIB:library
when I build the main project, but I''ll work on figuring that out for a while. Thanks for the help.

Share this post


Link to post
Share on other sites
That one sounds like you''ve got conflicting runtime library settings in the different libraries and the main project. Make sure the the Runtime Library setting on all the projects are the same. Should be under project options->C/C++->Code Generation.

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!