Easy way to include linker settings

Easy way to include linker settings

Hello! Sometimes if you are using third party libs (like this SDK) it makes sense to have all settings in an include file. Thus, it is possible to inlcude SDKs without changing via VisualStudio Property Pages. Here, I will give you a small example how to set the required linker settings. Just copy and paste the following code to a new created file. ------------------------------------------------------------------------------------------------------ ////////////////////////////////////////////////////////////////////////// // MAIN INCLUDE FOR INTEL ATOM DEVELOPER SDK ////////////////////////////////////////////////////////////////////////// #ifndef __ADPCPPF_H #define __ADPCPPF_H #pragma once // include the main header for C++ framework #include "adpcppf.h" // add appropriate linker settings #ifdef _DEBUG #pragma comment (lib, __FILE__"/../../lib/IADP_SDK/adpcppfd.lib") #pragma message("Automatically linking with adpcppfd.lib") #pragma comment (lib, __FILE__"/../../lib/IADP_SDK/adpcored.lib") #pragma message("Automatically linking with adpcored.lib" ) #else #pragma comment (lib, __FILE__"/../../lib/IADP_SDK/adpcppf.lib") #pragma message("Automatically linking with adpcppf.lib") #pragma comment (lib, __FILE__"/../../lib/IADP_SDK/adpcore.lib") #pragma message("Automatically linking with adpcore.lib" ) #endif // _DEBUG // this lib will is also required #pragma comment (lib, "Psapi.lib") #pragma message("Automatically linking with Psapi.lib" ) #endif // __ADPCPPF_H ------------------------------------------------------------------------------------------------------ Now, save the file to the same folder as adpcppf.h. Instead of including adpcppf.h, include this new file. No additional Linker settings must be applied to you project... Hope this helps. Best regards, Markus
1 post / 0 new
For more complete information about compiler optimizations, see our Optimization Notice.