Dave
Dave

Reputation: 7603

Visual Studio ignoring "Additional Library Directories" field

I have several libraries I need to use but I have been confronted by an unusual error, here is what happens. I create a new project and as always I go into properties > Linker > Input to add additional dependencies. I then go into Linker > General and include their location under additional library directories.

The problem is that no matter what I do, Visual Studio appears to be ignoring the additional library directories field, despite me seeing it correctly in the command line. As a result I am getting a cannot open lib (LNK1104) error.

Everything works when I put the path alongside the lib and I checked for spelling mistakes. I also tried moving the libs around and providing alternative paths but everything points to visual studio just ignoring that field. What makes this even more bizarre is that I have another project in which everything works just fine.

Does anyone have any insight on why this might be happening?

Upvotes: 5

Views: 5737

Answers (2)

Xantium
Xantium

Reputation: 11605

I had this problem exact problem, I tried the solution above to include header files, restarted VS, however that did not solve the problem.

What I did is changed the Solutions Configuration option from Debug to Release and then Visual Studio miraculously found them.

Upvotes: 1

Dave
Dave

Reputation: 7603

Okay so after a good nights sleep I figured out the problem. It turns out that my path, specified by $(SolutionDir), had a comma in it. I feel this is a bug more than anything else because it worked when I added it directly when specifying the lib. Removing the comma from the path leading up to the project directory solved the problem. (And no, adding quotes didn't fix it either).

Upvotes: 3

Related Questions