Skip to content
This repository has been archived by the owner on Jul 3, 2023. It is now read-only.

CMake doesn't find implemantation of sciter methods #227

Open
koen1711 opened this issue Jul 3, 2023 · 1 comment
Open

CMake doesn't find implemantation of sciter methods #227

koen1711 opened this issue Jul 3, 2023 · 1 comment

Comments

@koen1711
Copy link

koen1711 commented Jul 3, 2023

Error:

/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/11/../../../x86_64-linux-gnu/Scrt1.o: in function `_start':
(.text+0x1b): undefined reference to `main'
/usr/bin/ld: CMakeFiles/MyApp.dir/src/main.cpp.o: in function `uimain(std::function<int ()>)':
main.cpp:(.text+0x29): undefined reference to `sciter::window::window(unsigned int, tagRECT)'
/usr/bin/ld: main.cpp:(.text+0x80): undefined reference to `sciter::window::expand(bool)'
/usr/bin/ld: CMakeFiles/MyApp.dir/src/main.cpp.o: in function `sciter::host<sciter::window>::on_load_data(SCN_LOAD_DATA*)':
main.cpp:(.text._ZN6sciter4hostINS_6windowEE12on_load_dataEP13SCN_LOAD_DATA[_ZN6sciter4hostINS_6windowEE12on_load_dataEP13SCN_LOAD_DATA]+0x1b1): undefined reference to `sciter::application::hinstance()'
collect2: error: ld returned 1 exit status
gmake[2]: *** [CMakeFiles/MyApp.dir/build.make:101: build/MyApp] Error 1
gmake[1]: *** [CMakeFiles/Makefile2:137: CMakeFiles/MyApp.dir/all] Error 2
gmake: *** [Makefile:156: all] Error 2

CMakeLists.txt

cmake_minimum_required(VERSION 3.10)
project(example)

set(CMAKE_CXX_STANDARD 17)

include_directories(
    extern/sciter/include
    extern/gtk/include
    extern/glib/include
    extern/pango/include
    extern/harfbuzz/include
    extern/cairo
    extern/gdk-pixbuf
    extern/atk-1.0
)

add_executable(MyApp src/main.cpp)

target_link_libraries(MyApp /home/koen/Documents/GitHub/BrowserC/extern/sciter/bin.lnx/x64/libsciter-gtk.so)
target_link_libraries(MyApp /home/koen/Documents/GitHub/BrowserC/extern/sciter/bin.lnx/x64/sciter-sqlite.so)

target_link_libraries(MyApp pango-1.0)
target_link_libraries(MyApp gtk-3)
target_link_libraries(MyApp glib-2.0)
@c-smile
Copy link
Owner

c-smile commented Jul 3, 2023

  1. Sciter repository was moved to Gitlab
  2. You need to include https://github.com/c-smile/sciter-sdk/blob/master/include/sciter-gtk-main.cpp source file to your project - where main() and sciter::window methods are defined.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants