-3

I have a code that needs libraries "lib" and "incluide" but those libraries are distributed in different folders inside a folder called "core" each folder inside "core" has an "incluide" and "lib"

for example

core »rtaudio» lib e incluide

core »math» lib and incluide

core »imanet» lib e incluide

I'll have to do "c / c ++" General »Aditional include directories" for each "include"?

"linker" general »Additional include directories" for each "lib"?

then I will have to load all the lib in each folder

Linker »Input» Additional Dependencies. for all the "lib"

how do I load all the lib files of each folder inside "core" automatically without having to open each folder and copy the name then paste in Linker »Input» Additional Dependencies?

Do I have to do it manually?

jony alton
  • 101
  • 3
  • 1
    try what you figured out by yourself, then - if still necessary - edit the question to include problems (error messages) you get even after following [the documentation](https://msdn.microsoft.com/en-us/library/ee855621.aspx). – Cee McSharpface Jul 08 '18 at 21:17
  • Possible duplicate of: [Problems importing libraries to my c++ project, how to fix this?](https://stackoverflow.com/questions/24715864/problems-importing-libraries-to-my-c-project-how-to-fix-this) – πάντα ῥεῖ Jul 08 '18 at 21:18

1 Answers1

0

The easiest way to tell the linker what libraries you need to link against is often not to do it via the IDE at all, especially if you can use relative paths.

Instead, you can do this (which can appear in any file compiled into the project, doesn't matter which):

#pragma comment (lib, "path\\to\\foo.lib")

Just add as many of these as you need.

Presumably, your include directories contain header files (so these are not relevant to the linker at all), and yes, add "c / c ++" -> "General" -> "Additional include directories" for each include directory (not file), or again, for relative paths you can simply do:

#include "path/to/foo.h"

directly in the code (note the forward slashes - these are more convenient as you don't have to double them up).

There is, AFAIK, no way to specify a list of directories to search for libraries. Go figure.

Paul Sanders
  • 24,133
  • 4
  • 26
  • 48