Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » U++ TheIDE » U++ TheIDE: Compiling, Linking, Debugging of your packages » What flag for conditional compile to GUI or CLI
What flag for conditional compile to GUI or CLI [message #49857] Mon, 21 May 2018 08:08 Go to next message
slashupp is currently offline  slashupp
Messages: 193
Registered: July 2009
Experienced Member

could be this is a stupid question:
the flags are defined in upp & to access them must include upp-headers
(giving chicken / egg problem)
so must define some local flag / boolean that is set/unset when upp-headers are used
and this local flag / boolean must then be checked in my code

BUT!: the build-flag 'GUI' is used when building gui-apps, and not available? when cli-app? please advise

----
What flag(s) must I use to conditional compile for either GUI or CLI?
I've tried:
//#if defined(GUI)
//#if defined(GUI_X11) || defined(GUI_WIN) || defined(GUI_WIN32) || defined(GUI_GTK)
//#if defined(GUI_APP_MAIN)
//#if defined(GUI_WIN) || defined(PLATFORM_X11)
#include <CtrlLib/CtrlLib.h>
using namespace Upp;
	void PRINTSTRING(const std::string &s) { PromptOK(DeQtf(s.c_str())); }
#else
	void PRINTSTRING(const std::string &s) { std::cout << s << std::flush; }
#endif

[Updated on: Mon, 21 May 2018 09:32]

Report message to a moderator

Re: What flag for conditional compile to GUI or CLI [message #49859 is a reply to message #49857] Mon, 21 May 2018 19:17 Go to previous messageGo to next message
omari is currently offline  omari
Messages: 193
Registered: March 2010
Experienced Member
Each flag name is prefixed with "flag" e.g. flagGUI, flagDEBUG. Hence you can test for these in source code with #ifdef or #if defined(flagNAME).
example :
#ifdef flagGUI
#include <CtrlLib/CtrlLib.h>
#endif


regards
omari.
Re: What flag for conditional compile to GUI or CLI [message #49865 is a reply to message #49859] Tue, 22 May 2018 12:09 Go to previous messageGo to next message
slashupp is currently offline  slashupp
Messages: 193
Registered: July 2009
Experienced Member

Thank you!

We NEED proper documentation. Do you know if there is any effort
under way to produce it? I am very willing to spend a couple of
hours per week to help if there is someone in control who can tell
me what & how to do it.
Re: What flag for conditional compile to GUI or CLI [message #49866 is a reply to message #49865] Tue, 22 May 2018 12:14 Go to previous message
Klugier is currently offline  Klugier
Messages: 640
Registered: September 2012
Location: Poland, Kraków
Contributor
Hello Slashupp,

You can directly contact with me via Slack. If you do not have account - please follow the steps on this documentation page. Making documentation for U++ is easy, all you need to do is edit T++ files. However to start doing this you need the committer privileges on our SVN trunk. To obtain that privileges, please contact Mirek directly (via forum message or on Slack).

Sincerely,
Klugier


Ultimate++ - one framework to rule them all.

[Updated on: Tue, 22 May 2018 12:14]

Report message to a moderator

Previous Topic: Promising results from CLANG/LLVM 6.0.0 on Windows
Next Topic: I can't to build exe-file from default package.
Goto Forum:
  


Current Time: Thu Nov 21 22:21:30 CET 2019

Total time taken to generate the page: 0.01024 seconds