conditional-compilation

Creating demo and full version app based on one code base/project

元气小坏坏 提交于 2019-11-30 16:04:41
问题 I have developed one Android app in one project with Eclipse - it's structured (coming from iPhone) so one constant defines whether it's the demo or the full version. Now I have the problem that everytime I want to create the demo version I need to change the constant but also need to make a copy of the project with a different package name. Obviously changing code in the original full version needs to be copied over to the demo or I would have to redo the creation of the demo app everytime I

Creating demo and full version app based on one code base/project

纵然是瞬间 提交于 2019-11-30 15:31:40
I have developed one Android app in one project with Eclipse - it's structured (coming from iPhone) so one constant defines whether it's the demo or the full version. Now I have the problem that everytime I want to create the demo version I need to change the constant but also need to make a copy of the project with a different package name. Obviously changing code in the original full version needs to be copied over to the demo or I would have to redo the creation of the demo app everytime I submit my app. I see three possible approaches: 1. While I have looked into library projects it is

How to compile specific files in objective-c++ and the rest of the project in objective-c

本秂侑毒 提交于 2019-11-30 13:14:41
问题 I'm currently busy on a project where I need to use an external accessory to read Mifare 1k tags. The accessory was provided with an SDK, written in (Objective ?)C++ and I followed the instructions provided to set XCode to "Compile sources as: Objective-C++" and added "-Obj-C++" in "Other linkers flags. The SDK compiles fine then, but trouble is I am already using several libraries in the project (such as ASIHTTPRequest, JSONKit, ...) and I get compilation problems because of those new

Why is /clr incompatible with /mt and /mtd in Visual Studio?

别说谁变了你拦得住时间么 提交于 2019-11-30 13:11:46
问题 can anybody please explain for me how and why /clr is incompatible with /mtd ? What is the alternative for this? What happens internally if I use /md or /mdd ? As far as I know we don't combinedly use /clr and /mtd. Can someone explain if there is a way to do this? And please explain me how and why /clr is incompatible with /mt and /mtd in Visual Studio? 回答1: I expect the clue is given here: If you are using the /clr compiler switch, your code will be linked with an import library, msvcmrt

Java (Eclipse) - Conditional compilation

家住魔仙堡 提交于 2019-11-30 10:29:08
I have a java project that is referenced in j2me project and in android project. In this project i would like to use conditional compilation. Something like... //#if android ... //#endif //if j2me ... //#endif I have been reading about this but i did not find anything useful yet. sinek You could use Antenna (there is a plugin for Eclipse, and you can use it with the Ant build system). I'm using it in my projects in a way you've described and it works perfectly :) EDIT: here is the example related to @WhiteFang34 solution that is a way to go: In your core project: //base class Base.java public

How to compile specific files in objective-c++ and the rest of the project in objective-c

柔情痞子 提交于 2019-11-30 06:36:16
I'm currently busy on a project where I need to use an external accessory to read Mifare 1k tags . The accessory was provided with an SDK, written in (Objective ?)C++ and I followed the instructions provided to set XCode to "Compile sources as: Objective-C++" and added "-Obj-C++" in "Other linkers flags. The SDK compiles fine then, but trouble is I am already using several libraries in the project (such as ASIHTTPRequest, JSONKit, ...) and I get compilation problems because of those new settings in those libraries. If I switch back to the previous settings, I get compilation problems in the

Conditionally display block of markdown text using knitr

不羁的心 提交于 2019-11-30 06:31:17
问题 I would like to edit a single rmarkdown (Rmd) document with a list of "problems", each followed by its solution. Each solution may contain the results of R console, but also some explaining (markdown and LaTeX formatted) text. Besides, I would like to knitr it in 2 versions: with and without the solutions, changing the source as less as possible, and compiling. I know I can use a logical variable in order to conditionally evaluate R code and show plots and R output, but I don't know how to

How to #ifdef by CompilerType ? GCC or VC++

三世轮回 提交于 2019-11-30 03:59:27
I used #ifdef Win32 for safe calls alike sprintf_s but now I want to build project with MinGW and it's just wrong now. I need to use #ifdef VC++ or somehow like that. Is it possible? See the "Microsoft-Specific Predefined Macros" table of Visual C predefined macros You could check for _MSC_VER . Aniket Inge #ifdef __clang__ /*code specific to clang compiler*/ #elif __GNUC__ /*code for GNU C compiler */ #elif _MSC_VER /*usually has the version number in _MSC_VER*/ /*code specific to MSVC compiler*/ #elif __BORLANDC__ /*code specific to borland compilers*/ #elif __MINGW32__ /*code specific to

When does #if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP) in dxvahd.h Microsoft header file become true

瘦欲@ 提交于 2019-11-30 03:54:11
问题 Hi I am having 2 VC++ solutions "A" & "B" (VS2008) both are having the same codebase (with just few lines of code different). Using DXVAHD.h in both. dxvahd.h is a standard Microsoft header file. If we open this header file, we see there is a conditional if " #if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP) " I see that in VC++ solution "A", the above conditional #if statement is false, hence the whole dxvahd header file gets greyed out & is not even compiled!! Whereas in another

How do you use type traits to do conditional compilation?

若如初见. 提交于 2019-11-29 18:46:55
问题 I'm trying to write code like here but using C++11 features, without Boost. Working from this example, I tried to define a response_trait , and basee conditional compilation on the result of the trait. How can I make this work? #include <vector> using namespace std ; struct Vector{ float x,y,z ; } ; struct Vertex { Vector pos ; } ; struct VertexN { Vector pos, normal ; } ; struct Matrix {} ; template <typename T> struct response_trait { static bool const has_normal = false; } ; template <>