Comments (16)
@Pospelove commit changes (make
got 95% compile!) and have next errors connected with espm
library and maybe that issue #100
[ 95%] Building CXX object skymp5-server/CMakeFiles/skymp5-server.dir/cpp/addon/main.cc.o
/home/bogdasar/Documents/Programming/C++_Programming/skymp/skymp5-server/cpp/addon/main.cc: In constructor ‘ScampServer::ScampServer(const Napi::CallbackInfo&)’:
/home/bogdasar/Documents/Programming/C++_Programming/skymp/skymp5-server/cpp/addon/main.cc:361:45: error: no matching function for call to ‘espm::Loader::Loader(std::vector<std::filesystem::__cxx11::path>&)’
361 | auto espm = new espm::Loader(pluginPaths);
| ^
In file included from /home/bogdasar/Documents/Programming/C++_Programming/skymp/skymp5-server/cpp/server_guest_lib/MpObjectReference.h:9,
from /home/bogdasar/Documents/Programming/C++_Programming/skymp/skymp5-server/cpp/server_guest_lib/MpActor.h:3,
from /home/bogdasar/Documents/Programming/C++_Programming/skymp/skymp5-server/cpp/server_guest_lib/PartOne.h:4,
from /home/bogdasar/Documents/Programming/C++_Programming/skymp/skymp5-server/cpp/addon/main.cc:12:
/home/bogdasar/Documents/Programming/C++_Programming/skymp/skymp5-server/cpp/lib_espm/Loader.h:41:3: note: candidate: ‘espm::Loader::Loader(const std::vector<std::experimental::filesystem::v1::__cxx11::path>&, espm::Loader::OnProgress)’
41 | Loader(const std::vector<fs::path>& filePaths_,
| ^~~~~~
/home/bogdasar/Documents/Programming/C++_Programming/skymp/skymp5-server/cpp/lib_espm/Loader.h:41:39: note: no known conversion for argument 1 from ‘std::vector<std::filesystem::__cxx11::path>’ to ‘const std::vector<std::experimental::filesystem::v1::__cxx11::path>&’
41 | Loader(const std::vector<fs::path>& filePaths_,
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~
/home/bogdasar/Documents/Programming/C++_Programming/skymp/skymp5-server/cpp/lib_espm/Loader.h:35:3: note: candidate: ‘espm::Loader::Loader(const std::experimental::filesystem::v1::__cxx11::path&, const std::vector<std::experimental::filesystem::v1::__cxx11::path>&, espm::Loader::OnProgress)’
35 | Loader(const fs::path& dataDir, const std::vector<fs::path>& fileNames,
| ^~~~~~
/home/bogdasar/Documents/Programming/C++_Programming/skymp/skymp5-server/cpp/lib_espm/Loader.h:35:3: note: candidate expects 3 arguments, 1 provided
/home/bogdasar/Documents/Programming/C++_Programming/skymp/skymp5-server/cpp/lib_espm/Loader.h:22:7: note: candidate: ‘espm::Loader::Loader(espm::Loader&&)’
22 | class Loader
| ^~~~~~
/home/bogdasar/Documents/Programming/C++_Programming/skymp/skymp5-server/cpp/lib_espm/Loader.h:22:7: note: no known conversion for argument 1 from ‘std::vector<std::filesystem::__cxx11::path>’ to ‘espm::Loader&&’
make[2]: *** [skymp5-server/CMakeFiles/skymp5-server.dir/build.make:76: skymp5-server/CMakeFiles/skymp5-server.dir/cpp/addon/main.cc.o] Ошибка 1
make[1]: *** [CMakeFiles/Makefile2:162: skymp5-server/CMakeFiles/skymp5-server.dir/all] Ошибка 2
Didn't go into details, but apparently the problem is the incompatibility of std::filesystem
and std::experimantal::filesystem
.
from skymp.
@bogdasar1985 Thanks for the clarification! You are right. We only need the server to build on Linux, not the client with all Windows-specific stuff.
For now, try comment excess add_subdirectory
calls in CMakeLists.txt
like this:
#add_subdirectory(chakra-wrapper)
#add_subdirectory(skyrim-platform)
#add_subdirectory(skymp5-client)
#add_subdirectory(skymp5-front)
#add_subdirectory(skymp5-functions-lib)
#add_subdirectory(skymp5-scripts)
#add_subdirectory(client-deps)
add_subdirectory(skymp5-server)
from skymp.
@bogdasar1985 Thanks for looking into it. I think you should submit a pull request even if the project is still unbuildable. So we would be able to see what we can do then.
from skymp.
@Pospelove Fixed (66bfb88). I just increased the local buffer from 128 to 512 bytes.
from skymp.
CMake Error at vcpkg/scripts/buildsystems/vcpkg.cmake:797 (_find_package):
Could not find a package configuration file provided by "directxtk" with
any of the following names:
directxtkConfig.cmake
directxtk-config.cmake
Add the installation prefix of "directxtk" to CMAKE_PREFIX_PATH or set
"directxtk_DIR" to a directory containing one of the above files. If
"directxtk" provides a separate development package or SDK, be sure it has
been installed.
Call Stack (most recent call first):
skyrim-platform/src/platform_se/CMakeLists.txt:220 (find_package)
-- Configuring incomplete, errors occurred!
See also "/home/bogdasar/Documents/Programming/C++_Programming/skymp/build/CMakeFiles/CMakeOutput.log".
No, it shouldn't. Linux is not support DirectX.
from skymp.
@Pospelove I fixed some errors. Two of them related to the Chakra library and its wrapper.
Firstly, I am of course include directory with that lib:
In file skymp/skymp5-server/cpp/CMakeLists.txt
add include_directories("../../chakra-wrapper")
on server_guest_lib
build scenario.
Then I have an errors:
The first was associated with an invalid typedef
:
In file included from /home/bogdasar/Documents/Programming/C++_Programming/skymp/skymp5-server/cpp/../../chakra-wrapper/JsEngine.h:3,
from /home/bogdasar/Documents/Programming/C++_Programming/skymp/skymp5-server/cpp/server_guest_lib/DynamicFields.cpp:2:
/home/bogdasar/Documents/Programming/C++_Programming/skymp/build/vcpkg_installed/x64-linux/include/ChakraCore.h:1969:21: error: expected ‘)’ before ‘*’ token
1969 | typedef void(__cdecl *ArrayBufferFreeFn)(void*);
| ~ ^~
| )
/home/bogdasar/Documents/Programming/C++_Programming/skymp/build/vcpkg_installed/x64-linux/include/ChakraCore.h:1983:11: error: ‘ArrayBufferFreeFn’ has not been declared
1983 | _Out_ ArrayBufferFreeFn* freeFn);
I fixed them by remove explicit calling convention as __cdecl
, inside library file ChakraCore.h
whats mean, if I remove build
dir with vcpkg cache and downloaded libraries, I will wanna do it again.
I also fixed some simple errors, in particular just typos.
But there are one mistake, which I can't fix:
In file included from /home/bogdasar/Documents/Programming/C++_Programming/skymp/skymp5-server/cpp/server_guest_lib/DynamicFields.cpp:2:
/home/bogdasar/Documents/Programming/C++_Programming/skymp/skymp5-server/cpp/../../chakra-wrapper/JsEngine.h: In member function ‘JsValue::operator std::wstring() const’:
/home/bogdasar/Documents/Programming/C++_Programming/skymp/skymp5-server/cpp/../../chakra-wrapper/JsEngine.h:267:26: error: ‘JsStringToPointer’ was not declared in this scope
267 | SafeCall(JS_ENGINE_F(JsStringToPointer), value, &stringPtr, &stringSize);
| ^~~~~~~~~~~~~~~~~
/home/bogdasar/Documents/Programming/C++_Programming/skymp/skymp5-server/cpp/../../chakra-wrapper/JsEngine.h:11:27: note: in definition of macro ‘JS_ENGINE_F’
11 | #define JS_ENGINE_F(func) func, #func
| ^~~~
make[2]: *** [skymp5-server/cpp/CMakeFiles/server_guest_lib.dir/build.make:132: skymp5-server/cpp/CMakeFiles/server_guest_lib.dir/server_guest_lib/DynamicFields.cpp.o] Ошибка 1
make[1]: *** [CMakeFiles/Makefile2:299: skymp5-server/cpp/CMakeFiles/server_guest_lib.dir/all] Ошибка 2
make: *** [Makefile:101: all] Ошибка 2
Chackra can't find function JsStringToPointer
. I looked in the documentation and found out that Chakra has 4 main header files. And the one in which the JsStringToPointer
function is declared, namely ChakraCommonWindows.h
, is apparently not available on Linux, which is clear from the file name.
Also if I try to find Chakra files in directory I found olny that:
bogdasar@bogdasar-Aspire-V3-571G:~/Documents/Programming/C++_Programming/skymp/build$ find .. -name 'Chakra*'
../vcpkg/packages/chakracore_x64-linux/include/ChakraCore.h
../vcpkg/packages/chakracore_x64-linux/include/ChakraCommon.h
../vcpkg/packages/chakracore_x64-linux/include/ChakraDebug.h
../build/vcpkg_installed/x64-linux/include/ChakraCore.h
../build/vcpkg_installed/x64-linux/include/ChakraCommon.h
../build/vcpkg_installed/x64-linux/include/ChakraDebug.h
Which means that vcpkg does not download ChakraCommonWindows.h
because of platform.
If my assumptions are correct, then I think that we will have to change JsEngine.h
or/and setup Chakra manually and change it according to the needs of our project.
So, I hope I have not forgotten anything and I have presented the results of the work correctly.
from skymp.
@Pospelove So, should I commit my fixes even though the project is not going to be build?
from skymp.
@Pospelove Pull request: #102
The problem with __cdelc
is here, explicit calling convention should be removed :
https://github.com/chakra-core/ChakraCore/blob/e264cb81cb6e04c34725fc8de206b599b91d2bbf/lib/Jsrt/ChakraCore.h#L1969
Decide whether to make a Pull Request and wait until it is updated library in vcpkg
or make your own custom version of the library.
Also the problem with JsStringToPointer
persists.
from skymp.
@Pospelove I fix one simple warning dff0a99
But there is also this:
/home/bogdasar/Documents/Programming/C++_Programming/skymp/skymp5-server/cpp/papyrus_vm_lib/ActivePexInstance.cpp: In function ‘VarValue CastToString(const VarValue&)’:
/home/bogdasar/Documents/Programming/C++_Programming/skymp/skymp5-server/cpp/papyrus_vm_lib/ActivePexInstance.cpp:153:41: warning: ‘%.*g’ directive output may be truncated writing between 1 and 310 bytes into a region of size 128 [-Wformat-truncation=]
153 | snprintf(buffer, sizeof(buffer), "%.*g", 9000, static_cast<double>(var));
| ^~~~
/home/bogdasar/Documents/Programming/C++_Programming/skymp/skymp5-server/cpp/papyrus_vm_lib/ActivePexInstance.cpp:153:40: note: assuming directive output of 309 bytes
153 | snprintf(buffer, sizeof(buffer), "%.*g", 9000, static_cast<double>(var));
| ^~~~~~
/home/bogdasar/Documents/Programming/C++_Programming/skymp/skymp5-server/cpp/papyrus_vm_lib/ActivePexInstance.cpp:153:15: note: ‘snprintf’ output between 2 and 311 bytes into a destination of size 128
153 | snprintf(buffer, sizeof(buffer), "%.*g", 9000, static_cast<double>(var));
| ~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
from skymp.
@bogdasar1985 Cool. Would be nice to fix these sprintf
warnings without functionality changes. Btw, this behavior is covered by unit tests as I can remember.
from skymp.
@Pospelove What are you going to do with this JS library?
from skymp.
@bogdasar1985 Currently, on the server, it's used for scripting. For now, there are no plans to use it for other purposes.
from skymp.
@Pospelove I mean the problems of building on Linux, because of this library. That #95 (comment) and their windows-specific(as I understand) function JsStringToPointer
.
from skymp.
@bogdasar1985 We could use this https://github.com/chakra-core/ChakraCore/wiki/JsCopyString
from skymp.
@bogdasar1985 I guess we can remove #if WIN32
there, and use non-experimental fs
from skymp.
I removed in my pr
from skymp.
Related Issues (20)
- Torches (LIGH) should be pickup-able and have reloot as well
- [Bug]: CTD when passing an empty character as the second argument when executing PapyrusUtil's MiscUtil.WriteToFile function HOT 5
- [SP Bug]: cameraStateChanged event crashes the game when opening the map menu HOT 1
- [SP Bug]: effectStart and/or effectFinish events crash the game when loading a save or main menu while fighting a mage HOT 2
- [SP Bug]: Browser incompatible on Linux HOT 3
- Papyrus compaibility HOT 3
- where is skyrimPlatform package? HOT 2
- Bash attack deliver unarmed damage. But they should deliver BASH damage instead
- Implement ObjectReference.GetDistance
- first potion after relog doesn't heal
- [Bug]: When executing PapyrusUtil's JsonUtil.GetStringValue function, a CTD occurs if an empty character is passed as the third argument.
- unhardcode bunned races
- SkyrimPlatform fills savegames with garbage
- AnimationSystem should not sum modifiers, should use individual modifier
- [Question]: Edit Current NPC Dialouge [ Audio and .lip files ] Directly using SkyMP TypeScript HOT 2
- support ObjectReference argument for AddItem
- GUI Demo does not work HOT 1
- Update upload-artifact and checkout action usages
- Problem with toolchainfile.cmake and chakracore HOT 1
- Implement parsing of espm records: SHOU, SLGM, WOOP, WTHR.
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from skymp.