Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>You need to tell CMake that you want a GUI application:</p> <pre><code> # GUI Type if(WIN32) set(GUI_TYPE WIN32) endif(WIN32) if(APPLE) set(GUI_TYPE MACOSX_BUNDLE) endif(APPLE) ADD_EXECUTABLE(test ${GUI_TYPE} ${test_SRCS}) </code></pre> <p>Note that when you are compiling on Windows, this will change the program entry from <code>main()</code> to <code>WinMain()</code>, so you will need to modify your sources as well. Here's what I usually do:</p> <pre><code>#ifdef _WIN32 class Win32CommandLineConverter; int CALLBACK WinMain(HINSTANCE /* hInstance */, HINSTANCE /* hPrevInstance */, LPSTR /* lpCmdLine */, int /* nCmdShow */) { Win32CommandLineConverter cmd_line; return main(cmd_line.argc(), cmd_line.argv()); } class Win32CommandLineConverter { private: std::unique_ptr&lt;char*[]&gt; argv_; std::vector&lt;std::unique_ptr&lt;char[]&gt;&gt; storage_; public: Win32CommandLineConverter() { LPWSTR cmd_line = GetCommandLineW(); int argc; LPWSTR* w_argv = CommandLineToArgvW(cmd_line, &amp;argc); argv_ = std::unique_ptr&lt;char*[]&gt;(new char*[argc]); storage_.reserve(argc); for(int i=0; i&lt;argc; ++i) { storage_.push_back(ConvertWArg(w_argv[i])); argv_[i] = storage_.back().get(); } LocalFree(w_argv); } int argc() const { return static_cast&lt;int&gt;(storage_.size()); } char** argv() const { return argv_.get(); } static std::unique_ptr&lt;char[]&gt; ConvertWArg(LPWSTR w_arg) { int size = WideCharToMultiByte(CP_UTF8, 0, w_arg, -1, nullptr, 0, nullptr, nullptr); std::unique_ptr&lt;char[]&gt; ret(new char[size]); WideCharToMultiByte(CP_UTF8, 0, w_arg, -1, ret.get(), size, nullptr, nullptr); return ret; } }; #endif </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload