title: Trying to compile a Sciter project for the first time in CLion. Continue getting "undefined reference to 'WinMain'"?
body: <p>As the title says I'm having a difficult time compiling the Hello, World! example from sciter.com. As far as I can tell I have everything linked properly, I made sure that the bit architecture of my DLL's matched that of my project, etc.</p>
  <p>I have been trying to figure it out for hours now and sciters website has no previously asked questions on the topic. Was hoping someone could point me in the right direction.</p>
  <p>Here's the compiler output:</p>
  <pre><code>====================[ Build | SciterDemo | Debug ]==============================
  &quot;C:\Program Files\JetBrains\CLion 2022.2.1\bin\cmake\win\bin\cmake.exe&quot; --build C:\Users\edwar\CLionProjects\SciterDemo\cmake-build-debug --target SciterDemo -j 12
  [0/1] Re-running CMake...
  -- Configuring done
  -- Linking Sciter
  -- Generating done
  -- Build files have been written to: C:/Users/edwar/CLionProjects/SciterDemo/cmake-build-debug
  [1/1] Linking CXX executable SciterDemo.exe
  FAILED: SciterDemo.exe 
  cmd.exe /C &quot;cd . &amp;&amp; C:\PROGRA~1\JETBRA~1\CLION2~1.1\bin\mingw\bin\G__~1.EXE -g  CMakeFiles/SciterDemo.dir/main.cpp.obj -o SciterDemo.exe -Wl,--out-implib,libSciterDemo.dll.a -Wl,--major-image-version,0,--minor-image-version,0  sciter-js-sdk-main/bin/windows/x64/libsciter.a  -lkernel32 -luser32 -lgdi32 -lwinspool -lshell32 -lole32 -loleaut32 -luuid -lcomdlg32 -ladvapi32 &amp;&amp; cd .&quot;
  C:\Program Files\JetBrains\CLion 2022.2.1\bin\mingw\bin/ld.exe: C:/PROGRA~1/JETBRA~1/CLION2~1.1/bin/mingw/bin/../lib/gcc/x86_64-w64-mingw32/11.2.0/../../../../x86_64-w64-mingw32/lib/../lib/libmingw32.a(lib64_libmingw32_a-crt0_c.o):crt0_c.c:(.text+0x46): undefined reference to `WinMain'
  collect2.exe: error: ld returned 1 exit status
  ninja: build stopped: subcommand failed.
  </code></pre>
  <p>EDIT:</p>
  <p>Here is the code in my <code>main.cpp</code> file:</p>
  <pre><code>#include &quot;sciter-js-sdk-main/include/sciter-x.h&quot;
  #include &quot;sciter-js-sdk-main/include/sciter-x-window.hpp&quot;
  #include &quot;include/sciter-win-main.cpp&quot;
  
  class frame: public sciter::window {
  public:
      frame() : window(SW_TITLEBAR | SW_RESIZEABLE | SW_CONTROLS | SW_MAIN | SW_ENABLE_DEBUG) {}
  
      SOM_PASSPORT_BEGIN(frame)
          SOM_FUNCS(
                  SOM_FUNC(nativeMessage)
          )
      SOM_PASSPORT_END
  
      sciter::string nativeMessage() {return WSTR(&quot;Hello, World!&quot;);}
  };
  
  #include &quot;resources.cpp&quot;
  
  int uimain(std::function&lt;int()&gt; run ) {
  
      sciter::archive::instance().open(aux::elements_of(resources));
  
      sciter::om::hasset&lt;frame&gt; pwin = new frame();
  
      pwin-&gt;load((WSTR(&quot;this://app/main.htm&quot;)));
  
      pwin-&gt;expand();
  
      return run();
  }
  </code></pre>
  <p>As you can see it only has <code>uimain</code> which per the <a href="https://sciter.com/hello-cpp-tutorial/" rel="nofollow noreferrer">Hello World!</a> tutorial is correct. I don't know if maybe this is causing an issue.</p>