Adding library code to your project, or use precompiled binaries?

1.8k views Asked by At

I need some advice on my project. I am going to use various C++ libraries to accomplish different tasks. I am using Visual Studio 2008. To me, it seems to get a little out of hand when I add the actual source code of the library to my project's path.

It seems easier to just use the include files of the library, and just link precompiled binaries to my application. So my question is this. Is it better for me to include the source code of each library to my project, compile and link, or will it be better to just compile the libraries separately (or download a precompiled version) and link it to my program? Are there any pitfalls of the second way?

Thanks

2

There are 2 answers

0
Martin Beckett On BEST ANSWER

If a library is available use it.

With C++ and windows you may have to rebuild the library if it was built with a different compiler, there are issues linking C++ libs between gcc/mingw and visual studio. but in general there is no reason to add the source to your code base.

2
Keith On

Depending on the particular library, you might want to be able to debug it. Just downloading precompiled libraries and no source might make that difficult.