-1

Our large C++ solution has a lot of project references between different projects and it seems to cause problems, most commonly it will try to link the wrong version of the dependency e.g. You'll build Project in release and get an error about missing library dependency_d.lib. Especially if you are using multiple build configurations.

Are project references considered bad practice working in C++ and developers should stick with the old way (#include directories and libraries listed in project settings)? Or does this simply suggest they've been set up wrong in our solution?

Mr. Boy
  • 60,845
  • 93
  • 320
  • 589

1 Answers1

0

In our team we use #include despite of using vcpkg for the most libraries.

But you can set up different dependencies for each build configuration (Debug, Release etc.): just select desired Configuration at the top if the Project properties window. Your dependency _d .lib seems to be a Debug library.

I think there are some problems in your config. Also I haven't heard anything about project references are bad practice.

  • that's the point, if you set a project reference how does it know which build configuration to depend on? – Mr. Boy Aug 04 '21 at 09:32
  • @Mr.Boy, did you try [this](https://stackoverflow.com/questions/694415/c-sharp-vs2008-add-separate-debug-release-references-to-a-project)? – T-Rrexx Aug 04 '21 at 16:12