简体   繁体   中英

How to check if my library is used for a Win8 Store app or a Win32 app?

As the title suggests I'm trying to build a library ( a small DirectX renderer) to be used both in a Windows8/Metro App, while also be usable for developement of Desktop apps using Win32.

To be more precise I'm wondering if I can use some sort of pre-processor directive to detect the target platform and separate the difference of code between these platforms using them, and if there exist where exactly can I get more information about that.

You can not, once a library has been build, pre-processor directives are already processed. This is why you would have to build two librarys, one for each purpose.

This link might answer further questions:

http://social.msdn.microsoft.com/Forums/en-US/winappswithnativecode/thread/61829316-fff3-43c7-a86a-cf0e13c66845/

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM