Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Windows build fails #23

Closed
wholelottajam opened this issue Jul 15, 2021 · 4 comments
Closed

Windows build fails #23

wholelottajam opened this issue Jul 15, 2021 · 4 comments

Comments

@wholelottajam
Copy link

How we can build this project in Visual Studio, can you help please?

@ftk
Copy link
Owner

ftk commented Jul 15, 2021

There are Quickjs forks that add visual studio support, also check "msvc" branch in this repo, it should work: https://github.com/ftk/quickjspp/tree/msvc

@wholelottajam
Copy link
Author

wholelottajam commented Jul 15, 2021

I tried msvc branch, also different quickjs windows forks but could not get rid of these errors when compiling examples

C:\workspaces\quickjspp\quickjspp.hpp(898): error C3083: 'is_const': the symbol to the left of a '::' must be a type C:\workspaces\quickjspp\quickjspp.hpp(1075): note: see reference to function template instantiation 'qjs::Value &qjs::Value::add<pointer-to-member(0x0)>(const char *)' being compiled C:\workspaces\quickjspp\test\class.cpp(62): note: see reference to function template instantiation 'qjs::Context::Module::class_registrar<base_test> &qjs::Context::Module::class_registrar<base_test>::fun<pointer-to-member(0x0)>(const char *)' being compiled C:\workspaces\quickjspp\test\class.cpp(62): note: see reference to function template instantiation 'qjs::Context::Module::class_registrar<base_test> &qjs::Context::Module::class_registrar<base_test>::fun<pointer-to-member(0x0)>(const char *)' being compiled C:\workspaces\quickjspp\quickjspp.hpp(898): error C2039: 'value': is not a member of 'qjs::detail::get_set<pointer-to-member(0x0)>' C:\workspaces\quickjspp\quickjspp.hpp(898): note: see declaration of 'qjs::detail::get_set<pointer-to-member(0x0)>' C:\workspaces\quickjspp\quickjspp.hpp(905): error C2065: 'value': undeclared identifier C:\workspaces\quickjspp\quickjspp.hpp(905): error C2131: expression did not evaluate to a constant C:\workspaces\quickjspp\quickjspp.hpp(905): note: a non-constant (sub-)expression was encountered C:\workspaces\quickjspp\quickjspp.hpp(900): error C2039: 'get': is not a member of 'qjs::detail::get_set<pointer-to-member(0x0)>' C:\workspaces\quickjspp\quickjspp.hpp(898): note: see declaration of 'qjs::detail::get_set<pointer-to-member(0x0)>' C:\workspaces\quickjspp\quickjspp.hpp(905): error C2065: 'get': undeclared identifier C:\workspaces\quickjspp\quickjspp.hpp(900): error C2672: 'qjs::Value::add_getter': no matching overloaded function found C:\workspaces\quickjspp\quickjspp.hpp(905): error C2975: 'FGet': invalid template argument for 'qjs::Value::add_getter', expected compile-time constant expression C:\workspaces\quickjspp\quickjspp.hpp(877): note: see declaration of 'FGet' C:\workspaces\quickjspp\quickjspp.hpp(904): error C2039: 'get': is not a member of 'qjs::detail::get_set<pointer-to-member(0x0)>' C:\workspaces\quickjspp\quickjspp.hpp(898): note: see declaration of 'qjs::detail::get_set<pointer-to-member(0x0)>' C:\workspaces\quickjspp\quickjspp.hpp(904): error C2039: 'set': is not a member of 'qjs::detail::get_set<pointer-to-member(0x0)>' C:\workspaces\quickjspp\quickjspp.hpp(898): note: see declaration of 'qjs::detail::get_set<pointer-to-member(0x0)>' C:\workspaces\quickjspp\quickjspp.hpp(905): error C2065: 'set': undeclared identifier C:\workspaces\quickjspp\quickjspp.hpp(904): error C2672: 'qjs::Value::add_getter_setter': no matching overloaded function found C:\workspaces\quickjspp\quickjspp.hpp(905): error C2975: 'FSet': invalid template argument for 'qjs::Value::add_getter_setter', expected compile-time constant expression C:\workspaces\quickjspp\quickjspp.hpp(859): note: see declaration of 'FSet' C:\workspaces\quickjspp\quickjspp.hpp(898): error C2039: 'value': is not a member of 'qjs::detail::get_set<pointer-to-member(0x10)>' C:\workspaces\quickjspp\quickjspp.hpp(898): note: see declaration of 'qjs::detail::get_set<pointer-to-member(0x10)>' C:\workspaces\quickjspp\quickjspp.hpp(900): error C2039: 'get': is not a member of 'qjs::detail::get_set<pointer-to-member(0x10)>' C:\workspaces\quickjspp\quickjspp.hpp(898): note: see declaration of 'qjs::detail::get_set<pointer-to-member(0x10)>' C:\workspaces\quickjspp\quickjspp.hpp(904): error C2039: 'get': is not a member of 'qjs::detail::get_set<pointer-to-member(0x10)>' C:\workspaces\quickjspp\quickjspp.hpp(898): note: see declaration of 'qjs::detail::get_set<pointer-to-member(0x10)>' C:\workspaces\quickjspp\quickjspp.hpp(904): error C2039: 'set': is not a member of 'qjs::detail::get_set<pointer-to-member(0x10)>' C:\workspaces\quickjspp\quickjspp.hpp(898): note: see declaration of 'qjs::detail::get_set<pointer-to-member(0x10)>' C:\workspaces\quickjspp\quickjspp.hpp(898): error C2039: 'value': is not a member of 'qjs::detail::get_set<pointer-to-member(0x14)>' C:\workspaces\quickjspp\quickjspp.hpp(898): note: see declaration of 'qjs::detail::get_set<pointer-to-member(0x14)>' C:\workspaces\quickjspp\quickjspp.hpp(900): error C2039: 'get': is not a member of 'qjs::detail::get_set<pointer-to-member(0x14)>' C:\workspaces\quickjspp\quickjspp.hpp(898): note: see declaration of 'qjs::detail::get_set<pointer-to-member(0x14)>' C:\workspaces\quickjspp\quickjspp.hpp(904): error C2039: 'get': is not a member of 'qjs::detail::get_set<pointer-to-member(0x14)>' C:\workspaces\quickjspp\quickjspp.hpp(898): note: see declaration of 'qjs::detail::get_set<pointer-to-member(0x14)>' C:\workspaces\quickjspp\quickjspp.hpp(904): error C2039: 'set': is not a member of 'qjs::detail::get_set<pointer-to-member(0x14)>' C:\workspaces\quickjspp\quickjspp.hpp(898): note: see declaration of 'qjs::detail::get_set<pointer-to-member(0x14)>' C:\workspaces\quickjspp\quickjspp.hpp(898): error C2039: 'value': is not a member of 'qjs::detail::get_set<pointer-to-member(0x18)>' C:\workspaces\quickjspp\quickjspp.hpp(898): note: see declaration of 'qjs::detail::get_set<pointer-to-member(0x18)>' C:\workspaces\quickjspp\quickjspp.hpp(900): error C2039: 'get': is not a member of 'qjs::detail::get_set<pointer-to-member(0x18)>' C:\workspaces\quickjspp\quickjspp.hpp(898): note: see declaration of 'qjs::detail::get_set<pointer-to-member(0x18)>' C:\workspaces\quickjspp\quickjspp.hpp(904): error C2039: 'get': is not a member of 'qjs::detail::get_set<pointer-to-member(0x18)>' C:\workspaces\quickjspp\quickjspp.hpp(898): note: see declaration of 'qjs::detail::get_set<pointer-to-member(0x18)>' C:\workspaces\quickjspp\quickjspp.hpp(904): error C2039: 'set': is not a member of 'qjs::detail::get_set<pointer-to-member(0x18)>' C:\workspaces\quickjspp\quickjspp.hpp(898): note: see declaration of 'qjs::detail::get_set<pointer-to-member(0x18)>' C:\workspaces\quickjspp\quickjspp.hpp(898): error C2039: 'value': is not a member of 'qjs::detail::get_set<pointer-to-member(0x20)>' C:\workspaces\quickjspp\quickjspp.hpp(898): note: see declaration of 'qjs::detail::get_set<pointer-to-member(0x20)>' C:\workspaces\quickjspp\quickjspp.hpp(900): error C2039: 'get': is not a member of 'qjs::detail::get_set<pointer-to-member(0x20)>' C:\workspaces\quickjspp\quickjspp.hpp(898): note: see declaration of 'qjs::detail::get_set<pointer-to-member(0x20)>' C:\workspaces\quickjspp\quickjspp.hpp(904): error C2039: 'get': is not a member of 'qjs::detail::get_set<pointer-to-member(0x20)>' C:\workspaces\quickjspp\quickjspp.hpp(898): note: see declaration of 'qjs::detail::get_set<pointer-to-member(0x20)>' C:\workspaces\quickjspp\quickjspp.hpp(904): error C2039: 'set': is not a member of 'qjs::detail::get_set<pointer-to-member(0x20)>' C:\workspaces\quickjspp\quickjspp.hpp(898): note: see declaration of 'qjs::detail::get_set<pointer-to-member(0x20)>' C:\workspaces\quickjspp\quickjspp.hpp(898): error C2039: 'value': is not a member of 'qjs::detail::get_set<pointer-to-member(0x28)>' C:\workspaces\quickjspp\quickjspp.hpp(898): note: see declaration of 'qjs::detail::get_set<pointer-to-member(0x28)>' C:\workspaces\quickjspp\quickjspp.hpp(900): error C2039: 'get': is not a member of 'qjs::detail::get_set<pointer-to-member(0x28)>' C:\workspaces\quickjspp\quickjspp.hpp(898): note: see declaration of 'qjs::detail::get_set<pointer-to-member(0x28)>' C:\workspaces\quickjspp\quickjspp.hpp(904): error C2039: 'get': is not a member of 'qjs::detail::get_set<pointer-to-member(0x28)>' C:\workspaces\quickjspp\quickjspp.hpp(898): note: see declaration of 'qjs::detail::get_set<pointer-to-member(0x28)>' C:\workspaces\quickjspp\quickjspp.hpp(904): error C2039: 'set': is not a member of 'qjs::detail::get_set<pointer-to-member(0x28)>' C:\workspaces\quickjspp\quickjspp.hpp(898): note: see declaration of 'qjs::detail::get_set<pointer-to-member(0x28)>' NMAKE : fatal error U1077: 'C:\PROGRA~2\MICROS~2\2017\COMMUN~1\VC\Tools\MSVC\1416~1.270\bin\Hostx86\x86\cl.exe' : return code '0x2' Stop. NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.16.27023\bin\HostX86\x86\nmake.exe"' : return code '0x2' Stop. NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.16.27023\bin\HostX86\x86\nmake.exe"' : return code '0x2' Stop. NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.16.27023\bin\HostX86\x86\nmake.exe"' : return code '0x2' Stop.

@ftk
Copy link
Owner

ftk commented Jul 16, 2021

It works for me:

git clone --depth=1 --single-branch --branch=msvc --recursive https://github.com/ftk/quickjspp quickjsppwin
cd quickjsppwin
cmake -S . -B build
cmake  --build build
cd build
ctest .
cl /?
Microsoft (R) C/C++ Optimizing Compiler Version 19.29.30038.1 for x64
cmake --version
cmake version 3.19.1

Did you compile as C++17/C++20?

@wholelottajam
Copy link
Author

Yeah I checked, it compiles with vs2019.
I tried it with Visual Studio 2017 (v15.9) with v141 toolset and I got errors during build.
Maybe that version does not supported. Thanks for respond.

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

No branches or pull requests

2 participants