1

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.

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.

Here's the compiler output:

====================[ Build | SciterDemo | Debug ]==============================
"C:\Program Files\JetBrains\CLion 2022.2.1\bin\cmake\win\bin\cmake.exe" --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 "cd . && 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 && cd ."
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.

EDIT:

Here is the code in my main.cpp file:

#include "sciter-js-sdk-main/include/sciter-x.h"
#include "sciter-js-sdk-main/include/sciter-x-window.hpp"
#include "include/sciter-win-main.cpp"

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("Hello, World!");}
};

#include "resources.cpp"

int uimain(std::function<int()> run ) {

    sciter::archive::instance().open(aux::elements_of(resources));

    sciter::om::hasset<frame> pwin = new frame();

    pwin->load((WSTR("this://app/main.htm")));

    pwin->expand();

    return run();
}

As you can see it only has uimain which per the Hello World! tutorial is correct. I don't know if maybe this is causing an issue.

cigien
  • 57,834
  • 11
  • 73
  • 112
  • What's in `main.cpp`? Does it have a `main` or `WinMain` function? – Retired Ninja Aug 27 '22 at 22:14
  • @RetiredNinja I updated my question to include my main.cpp files contents. According to their Hello World! tutorial ```uimain``` is the only function necessary. This is the tutorial I'm following: https://sciter.com/hello-cpp-tutorial/ – Edward Severinsen Aug 27 '22 at 22:50

0 Answers0