Darks Wings
Intermediate OT User
- Joined
- Jan 25, 2010
- Messages
- 26
- Reaction score
- 128
What an amazing update gtz mate! Awesome thank you
Severity Code Description Project File Line Suppression State Details
Error C2036 'MatrixArea *': unknown size Black-Tek-Server C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.39.33519\include\vector 2055
[settings]
arch=x86_64
build_type=Release
compiler=msvc
compiler.cppstd=20
compiler.runtime=dynamic
compiler.version=193
os=Windows
ISO C++20 Standard (/std:c++20)
same error matrixarea using ubuntu 22Hi,
trying to compile it with Visual Studio 2022 but get the same error despite your instructions.
Code:Severity Code Description Project File Line Suppression State Details Error C2036 'MatrixArea *': unknown size Black-Tek-Server C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.39.33519\include\vector 2055
Default file looks like this:
Code:[settings] arch=x86_64 build_type=Release compiler=msvc compiler.cppstd=20 compiler.runtime=dynamic compiler.version=193 os=Windows
Project property in Visual Studio 2022 looks like this:
Code:ISO C++20 Standard (/std:c++20)
@llouche and @tibera
I am dumfounded as to how this is happening. I have some that it works fine for, others get this error. One such person who had this error though, this is how he solved it.
View attachment 84511
Post automatically merged:
Please let me know if this fixes the compilation problem for you... and yes its normal to get two loss of precision warnings if you do.
Post automatically merged:
I think you should be able to just open up matrixarea.h and add "#include <valarray>". I don't know that for sure though, as I don't have a problem compiling it the way it is...
Post automatically merged:
This here is confirmed fix.
View attachment 84517
[ 16%] Building CXX object CMakeFiles/tfs.dir/src/creature.cpp.o
In file included from /usr/include/c++/11/vector:67,
from /usr/include/c++/11/functional:62,
from /usr/include/c++/11/pstl/glue_algorithm_defs.h:13,
from /usr/include/c++/11/algorithm:74,
from /home/pro/blacktek/src/otpch.h:9,
from /home/pro/blacktek/build/CMakeFiles/tfs.dir/cmake_pch.hxx:5,
from <command-line>:
/usr/include/c++/11/bits/stl_vector.h: In instantiation of ‘std::_Vector_base<_Tp, _Alloc>::~_Vector_base() [with _Tp = MatrixArea; _Alloc = std::allocator<MatrixArea>]’:
/usr/include/c++/11/bits/stl_vector.h:683:7: required from ‘std::vector<_Tp, _Alloc>::~vector() [with _Tp = MatrixArea; _Alloc = std::allocator<MatrixArea>]’
/home/pro/blacktek/src/combat.h:69:7: required from ‘void std::default_delete<_Tp>::operator()(_Tp*) const [with _Tp = AreaCombat]’
/usr/include/c++/11/bits/unique_ptr.h:361:17: required from ‘std::unique_ptr<_Tp, _Dp>::~unique_ptr() [with _Tp = AreaCombat; _Dp = std::default_delete<AreaCombat>]’
/home/pro/blacktek/src/combat.h:86:3: required from here
/usr/include/c++/11/bits/stl_vector.h:336:49: error: invalid use of incomplete type ‘class MatrixArea’
336 | _M_impl._M_end_of_storage - _M_impl._M_start);
| ~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~
In file included from /home/pro/blacktek/src/game.h:8,
from /home/pro/blacktek/src/creature.cpp:7:
/home/pro/blacktek/src/combat.h:19:7: note: forward declaration of ‘class MatrixArea’
19 | class MatrixArea;
| ^~~~~~~~~~
In file included from /usr/include/c++/11/bits/move.h:57,
from /usr/include/c++/11/bits/stl_pair.h:59,
from /usr/include/c++/11/bits/stl_algobase.h:64,
from /usr/include/c++/11/bits/specfun.h:45,
from /usr/include/c++/11/cmath:1935,
from /home/pro/blacktek/src/definitions.h:30,
from /home/pro/blacktek/src/otpch.h:7,
from /home/pro/blacktek/build/CMakeFiles/tfs.dir/cmake_pch.hxx:5,
from <command-line>:
/usr/include/c++/11/type_traits: In instantiation of ‘struct std::is_destructible<MatrixArea>’:
/usr/include/c++/11/bits/stl_construct.h:188:51: required from ‘constexpr void std::_Destroy(_ForwardIterator, _ForwardIterator) [with _ForwardIterator = MatrixArea*]’
/usr/include/c++/11/bits/alloc_traits.h:848:15: required from ‘void std::_Destroy(_ForwardIterator, _ForwardIterator, std::allocator<_T2>&) [with _ForwardIterator = MatrixArea*; _Tp = MatrixArea]’
/usr/include/c++/11/bits/stl_vector.h:680:15: required from ‘std::vector<_Tp, _Alloc>::~vector() [with _Tp = MatrixArea; _Alloc = std::allocator<MatrixArea>]’
/home/pro/blacktek/src/combat.h:69:7: required from ‘void std::default_delete<_Tp>::operator()(_Tp*) const [with _Tp = AreaCombat]’
/usr/include/c++/11/bits/unique_ptr.h:361:17: required from ‘std::unique_ptr<_Tp, _Dp>::~unique_ptr() [with _Tp = AreaCombat; _Dp = std::default_delete<AreaCombat>]’
/home/pro/blacktek/src/combat.h:86:3: required from here
/usr/include/c++/11/type_traits:885:52: error: static assertion failed: template argument must be a complete class or an unbounded array
885 | static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/11/type_traits:885:52: note: ‘std::__is_complete_or_unbounded<std::__type_identity<MatrixArea> >((std::__type_identity<MatrixArea>{}, std::__type_identity<MatrixArea>()))’ evaluates to false
In file included from /usr/include/c++/11/bits/stl_iterator.h:85,
from /usr/include/c++/11/bits/stl_algobase.h:67,
from /usr/include/c++/11/bits/specfun.h:45,
from /usr/include/c++/11/cmath:1935,
from /home/pro/blacktek/src/definitions.h:30,
from /home/pro/blacktek/src/otpch.h:7,
from /home/pro/blacktek/build/CMakeFiles/tfs.dir/cmake_pch.hxx:5,
from <command-line>:
/usr/include/c++/11/bits/stl_construct.h: In instantiation of ‘constexpr void std::_Destroy(_ForwardIterator, _ForwardIterator) [with _ForwardIterator = MatrixArea*]’:
/usr/include/c++/11/bits/alloc_traits.h:848:15: required from ‘void std::_Destroy(_ForwardIterator, _ForwardIterator, std::allocator<_T2>&) [with _ForwardIterator = MatrixArea*; _Tp = MatrixArea]’
/usr/include/c++/11/bits/stl_vector.h:680:15: required from ‘std::vector<_Tp, _Alloc>::~vector() [with _Tp = MatrixArea; _Alloc = std::allocator<MatrixArea>]’
/home/pro/blacktek/src/combat.h:69:7: required from ‘void std::default_delete<_Tp>::operator()(_Tp*) const [with _Tp = AreaCombat]’
/usr/include/c++/11/bits/unique_ptr.h:361:17: required from ‘std::unique_ptr<_Tp, _Dp>::~unique_ptr() [with _Tp = AreaCombat; _Dp = std::default_delete<AreaCombat>]’
/home/pro/blacktek/src/combat.h:86:3: required from here
/usr/include/c++/11/bits/stl_construct.h:188:51: error: static assertion failed: value type is destructible
188 | static_assert(is_destructible<_Value_type>::value,
| ^~~~~
/usr/include/c++/11/bits/stl_construct.h:188:51: note: ‘std::integral_constant<bool, false>::value’ evaluates to false
/usr/include/c++/11/bits/stl_construct.h:195:25: error: invalid use of incomplete type ‘using value_type = std::remove_cv_t<MatrixArea>’ {aka ‘class MatrixArea’}
195 | std::_Destroy_aux<__has_trivial_destructor(_Value_type)>::
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /home/pro/blacktek/src/game.h:8,
from /home/pro/blacktek/src/creature.cpp:7:
/home/pro/blacktek/src/combat.h:19:7: note: forward declaration of ‘using value_type = std::remove_cv_t<MatrixArea>’ {aka ‘class MatrixArea’}
19 | class MatrixArea;
| ^~~~~~~~~~
In file included from /usr/include/c++/11/bits/stl_iterator.h:85,
from /usr/include/c++/11/bits/stl_algobase.h:67,
from /usr/include/c++/11/bits/specfun.h:45,
from /usr/include/c++/11/cmath:1935,
from /home/pro/blacktek/src/definitions.h:30,
from /home/pro/blacktek/src/otpch.h:7,
from /home/pro/blacktek/build/CMakeFiles/tfs.dir/cmake_pch.hxx:5,
from <command-line>:
/usr/include/c++/11/bits/stl_construct.h: In instantiation of ‘static constexpr void std::_Destroy_aux<<anonymous> >::__destroy(_ForwardIterator, _ForwardIterator) [with _ForwardIterator = MatrixArea*; bool <anonymous> = false]’:
/usr/include/c++/11/bits/stl_construct.h:193:39: required from ‘constexpr void std::_Destroy(_ForwardIterator, _ForwardIterator) [with _ForwardIterator = MatrixArea*]’
/usr/include/c++/11/bits/alloc_traits.h:848:15: required from ‘void std::_Destroy(_ForwardIterator, _ForwardIterator, std::allocator<_T2>&) [with _ForwardIterator = MatrixArea*; _Tp = MatrixArea]’
/usr/include/c++/11/bits/stl_vector.h:680:15: required from ‘std::vector<_Tp, _Alloc>::~vector() [with _Tp = MatrixArea; _Alloc = std::allocator<MatrixArea>]’
/home/pro/blacktek/src/combat.h:69:7: required from ‘void std::default_delete<_Tp>::operator()(_Tp*) const [with _Tp = AreaCombat]’
/usr/include/c++/11/bits/unique_ptr.h:361:17: required from ‘std::unique_ptr<_Tp, _Dp>::~unique_ptr() [with _Tp = AreaCombat; _Dp = std::default_delete<AreaCombat>]’
/home/pro/blacktek/src/combat.h:86:3: required from here
/usr/include/c++/11/bits/stl_construct.h:162:39: error: cannot increment a pointer to incomplete type ‘MatrixArea’
162 | for (; __first != __last; ++__first)
| ^~~~~~~
/usr/include/c++/11/bits/stl_construct.h: In instantiation of ‘constexpr void std::destroy_at(_Tp*) [with _Tp = MatrixArea]’:
/usr/include/c++/11/bits/stl_construct.h:149:22: required from ‘constexpr void std::_Destroy(_Tp*) [with _Tp = MatrixArea]’
/usr/include/c++/11/bits/stl_construct.h:163:19: required from ‘static constexpr void std::_Destroy_aux<<anonymous> >::__destroy(_ForwardIterator, _ForwardIterator) [with _ForwardIterator = MatrixArea*; bool <anonymous> = false]’
/usr/include/c++/11/bits/stl_construct.h:193:39: required from ‘constexpr void std::_Destroy(_ForwardIterator, _ForwardIterator) [with _ForwardIterator = MatrixArea*]’
/usr/include/c++/11/bits/alloc_traits.h:848:15: required from ‘void std::_Destroy(_ForwardIterator, _ForwardIterator, std::allocator<_T2>&) [with _ForwardIterator = MatrixArea*; _Tp = MatrixArea]’
/usr/include/c++/11/bits/stl_vector.h:680:15: required from ‘std::vector<_Tp, _Alloc>::~vector() [with _Tp = MatrixArea; _Alloc = std::allocator<MatrixArea>]’
/home/pro/blacktek/src/combat.h:69:7: required from ‘void std::default_delete<_Tp>::operator()(_Tp*) const [with _Tp = AreaCombat]’
/usr/include/c++/11/bits/unique_ptr.h:361:17: required from ‘std::unique_ptr<_Tp, _Dp>::~unique_ptr() [with _Tp = AreaCombat; _Dp = std::default_delete<AreaCombat>]’
/home/pro/blacktek/src/combat.h:86:3: required from here
/usr/include/c++/11/bits/stl_construct.h:88:22: error: invalid use of incomplete type ‘class MatrixArea’
88 | __location->~_Tp();
| ~~~~~~~~~~~~~^~~
In file included from /home/pro/blacktek/src/game.h:8,
from /home/pro/blacktek/src/creature.cpp:7:
/home/pro/blacktek/src/combat.h:19:7: note: forward declaration of ‘class MatrixArea’
19 | class MatrixArea;
| ^~~~~~~~~~
make[2]: *** [CMakeFiles/tfs.dir/build.make:269: CMakeFiles/tfs.dir/src/creature.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:102: CMakeFiles/tfs.dir/all] Error 2
make: *** [Makefile:91: all] Error 2
g_scheduler.addEvent(createSchedulerTask(15000, [=, thisPtr = std::weak_ptr<ServicePort>(shared_from_this())]() { ServicePort::eek:penAcceptor(thisPtr, serverPort); }));
g_scheduler.addEvent(createSchedulerTask(15000, [this, thisPtr = std::weak_ptr<ServicePort>(shared_from_this())]() {
ServicePort::eek:penAcceptor(thisPtr, serverPort);
}));
set(tfs_SRC
${CMAKE_CURRENT_LIST_DIR}/otpch.cpp
${CMAKE_CURRENT_LIST_DIR}/actions.cpp
${CMAKE_CURRENT_LIST_DIR}/ban.cpp
${CMAKE_CURRENT_LIST_DIR}/baseevents.cpp
${CMAKE_CURRENT_LIST_DIR}/bed.cpp
${CMAKE_CURRENT_LIST_DIR}/chat.cpp
${CMAKE_CURRENT_LIST_DIR}/combat.cpp
${CMAKE_CURRENT_LIST_DIR}/condition.cpp
${CMAKE_CURRENT_LIST_DIR}/configmanager.cpp
${CMAKE_CURRENT_LIST_DIR}/connection.cpp
${CMAKE_CURRENT_LIST_DIR}/container.cpp
${CMAKE_CURRENT_LIST_DIR}/creature.cpp
${CMAKE_CURRENT_LIST_DIR}/creatureevent.cpp
${CMAKE_CURRENT_LIST_DIR}/cylinder.cpp
${CMAKE_CURRENT_LIST_DIR}/database.cpp
${CMAKE_CURRENT_LIST_DIR}/databasemanager.cpp
${CMAKE_CURRENT_LIST_DIR}/databasetasks.cpp
${CMAKE_CURRENT_LIST_DIR}/depotchest.cpp
${CMAKE_CURRENT_LIST_DIR}/depotlocker.cpp
${CMAKE_CURRENT_LIST_DIR}/events.cpp
${CMAKE_CURRENT_LIST_DIR}/fileloader.cpp
${CMAKE_CURRENT_LIST_DIR}/game.cpp
${CMAKE_CURRENT_LIST_DIR}/globalevent.cpp
${CMAKE_CURRENT_LIST_DIR}/guild.cpp
${CMAKE_CURRENT_LIST_DIR}/groups.cpp
${CMAKE_CURRENT_LIST_DIR}/house.cpp
${CMAKE_CURRENT_LIST_DIR}/housetile.cpp
${CMAKE_CURRENT_LIST_DIR}/inbox.cpp
${CMAKE_CURRENT_LIST_DIR}/imbuement.cpp
${CMAKE_CURRENT_LIST_DIR}/iologindata.cpp
${CMAKE_CURRENT_LIST_DIR}/iomap.cpp
${CMAKE_CURRENT_LIST_DIR}/iomapserialize.cpp
${CMAKE_CURRENT_LIST_DIR}/iomarket.cpp
${CMAKE_CURRENT_LIST_DIR}/item.cpp
${CMAKE_CURRENT_LIST_DIR}/items.cpp
${CMAKE_CURRENT_LIST_DIR}/luascript.cpp
${CMAKE_CURRENT_LIST_DIR}/mailbox.cpp
${CMAKE_CURRENT_LIST_DIR}/map.cpp
${CMAKE_CURRENT_LIST_DIR}/matrixarea.cpp
${CMAKE_CURRENT_LIST_DIR}/monster.cpp
${CMAKE_CURRENT_LIST_DIR}/monsters.cpp
${CMAKE_CURRENT_LIST_DIR}/mounts.cpp
${CMAKE_CURRENT_LIST_DIR}/movement.cpp
${CMAKE_CURRENT_LIST_DIR}/networkmessage.cpp
${CMAKE_CURRENT_LIST_DIR}/npc.cpp
${CMAKE_CURRENT_LIST_DIR}/otserv.cpp
${CMAKE_CURRENT_LIST_DIR}/outfit.cpp
${CMAKE_CURRENT_LIST_DIR}/outputmessage.cpp
${CMAKE_CURRENT_LIST_DIR}/party.cpp
${CMAKE_CURRENT_LIST_DIR}/player.cpp
${CMAKE_CURRENT_LIST_DIR}/position.cpp
${CMAKE_CURRENT_LIST_DIR}/protocol.cpp
${CMAKE_CURRENT_LIST_DIR}/protocolgame.cpp
${CMAKE_CURRENT_LIST_DIR}/protocollogin.cpp
${CMAKE_CURRENT_LIST_DIR}/protocolold.cpp
${CMAKE_CURRENT_LIST_DIR}/protocolstatus.cpp
${CMAKE_CURRENT_LIST_DIR}/quests.cpp
${CMAKE_CURRENT_LIST_DIR}/raids.cpp
${CMAKE_CURRENT_LIST_DIR}/rsa.cpp
${CMAKE_CURRENT_LIST_DIR}/scheduler.cpp
${CMAKE_CURRENT_LIST_DIR}/scriptmanager.cpp
${CMAKE_CURRENT_LIST_DIR}/script.cpp
${CMAKE_CURRENT_LIST_DIR}/server.cpp
${CMAKE_CURRENT_LIST_DIR}/signals.cpp
${CMAKE_CURRENT_LIST_DIR}/spawn.cpp
${CMAKE_CURRENT_LIST_DIR}/spells.cpp
${CMAKE_CURRENT_LIST_DIR}/storeinbox.cpp
${CMAKE_CURRENT_LIST_DIR}/talkaction.cpp
${CMAKE_CURRENT_LIST_DIR}/tasks.cpp
${CMAKE_CURRENT_LIST_DIR}/teleport.cpp
${CMAKE_CURRENT_LIST_DIR}/thing.cpp
${CMAKE_CURRENT_LIST_DIR}/tile.cpp
${CMAKE_CURRENT_LIST_DIR}/tools.cpp
${CMAKE_CURRENT_LIST_DIR}/trashholder.cpp
${CMAKE_CURRENT_LIST_DIR}/vocation.cpp
${CMAKE_CURRENT_LIST_DIR}/weapons.cpp
${CMAKE_CURRENT_LIST_DIR}/wildcardtree.cpp
${CMAKE_CURRENT_LIST_DIR}/xtea.cpp
PARENT_SCOPE)
View attachment 84469
To make an imbuement with this system, you do so by creating it in lua like so
LUA:--- Imbuement(type, value, duration, decaytype) local imbue = Imbuement(IMBUEMENT_TYPE_DEATH_DAMAGE, 15, 65, 2) -- decaytype 1 for equipped, 2 for infight, i forgot to register their enums :D
The item must have slots already. I have included a test talk action I was using to make imbued items for testing.
Here is a picture of the available imbuement api, but the sources also contain comments inside each method (in the sources) to serve as an example.
and also a picture of the available "types"
View attachment 84473View attachment 84472
Lua Script Error: [Event Interface]
data/events/scripts/player.lua:Player@onLook
...ek/data/scripts/eventcallbacks/player/default_onLook.lua:57: attempt to call a table value
stack traceback:
...ek/data/scripts/eventcallbacks/player/default_onLook.lua:57: in function 'callback'
/home/pro/blacktek/data/scripts/lib/event_callbacks.lua:141: in function 'onLook'
data/events/scripts/player.lua:12: in function <data/events/scripts/player.lua:9>
Yeah the fix is just to wrap item:getImbuements() with pairs(). You can see how I did that in one of my previous pictures, I also added duration to the onlook. Go back a few posts and look at the screens hots I shared, you should be able to spot it pretty easilyLUA:Lua Script Error: [Event Interface] data/events/scripts/player.lua:Player@onLook ...ek/data/scripts/eventcallbacks/player/default_onLook.lua:57: attempt to call a table value stack traceback: ...ek/data/scripts/eventcallbacks/player/default_onLook.lua:57: in function 'callback' /home/pro/blacktek/data/scripts/lib/event_callbacks.lua:141: in function 'onLook' data/events/scripts/player.lua:12: in function <data/events/scripts/player.lua:9>
I think it might be easier for you to explain to me what it is you are doing? None of the libs are supposed to be static. So I am not sure how or why yours is trying to compile a static lib.What kind of program are you compiling the source code for Windows with? I can't compile any of them; it always gives errors like int32, int16, etc. I've corrected them, and errors still come up. I'm about to give up. What are the libs and boots you're using there?
View attachment 84525
1>LINK: Fatal error LNK1181: Unable to open input file 'zstd_static.lib'
Can share link commit?Yeah the fix is just to wrap item:getImbuements() with pairs(). You can see how I did that in one of my previous pictures, I also added duration to the onlook. Go back a few posts and look at the screens hots I shared, you should be able to spot it pretty easily
Post automatically merged:
Here it is @tibera View attachment 84524
Post automatically merged:
Obviously the one that matters for your specific error is the top one
@OTcreator Here it is working on Linux. So, follow the tutorial from Tibera, it will definitely work.work for me in ubuntu 22.04 !! check prints and some changes in server.cpp
I don't have a linux machine to compile on my friend.Make the Linux version available.
I have spoke with other linux users, they seem pretty certain that compiling on their machine, and then sharing the binaries to another's machine, will not work.Make the Linux version available.
<item id="2472" article="a" name="magic plate armor">
<attribute key="weight" value="8500" />
<attribute key="armor" value="17" />
<attribute key="slotType" value="body" />
<attribute key="imbuementslots" value="2" />
<attribute key="imbuementslots" value="2" />
</item>
[2472] = { -- magic plate armor
min = 2,
max = 4,
slots_in_percent_chance = {
{ slots = 2, chance = 50 },
{ slots = 3, chance = 40 },
{ slots = 4, chance = 10 },
}
}