• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

Compiling Problems compiling Ninja's "TFS 1.2 8.6".

Sinth

Argardh.com
Joined
Jan 14, 2015
Messages
721
Reaction score
133
Location
Cambodia
SOLVED:

ill update this or make a fresh tutorial if i get the time and/or understanding enough of what I did to make it work(dont want to spread bad/crappy info)

original post below:




Morning fellas

Using:

TFS SDK 3.2

Boost 160

Ninjas TFS 1.2 for 8.6-client ( https://otland.net/threads/8-60-the-forgotten-server-1-2.236489/ )

Windows 10

Microsoft Visual Studio Express 2015

Following all instructions/tips at: https://otland.net/threads/compilin...s-pics-and-lots-of-explanation.204532/page-12

But still failing.

Error message:


1> player.cpp
1>C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\atomic(661): error C2338: You've instantiated std::atomic<T> with sizeof(T) equal to 2/4/8 and alignof(T) < sizeof(T). Before VS 2015 Update 2, this would have misbehaved at runtime. VS 2015 Update 2 was fixed to handle this correctly, but the fix inherently changes layout and breaks binary compatibility. Please define _ENABLE_ATOMIC_ALIGNMENT_FIX to acknowledge that you understand this, and that everything you're linking has been compiled with VS 2015 Update 2 (or later). (compiling source file ..\src\outputmessage.cpp)
1> C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\atomic(675): note: see reference to class template instantiation 'std::_Atomic_base<_Ty,4>' being compiled
1> with
1> [
1> _Ty=boost::lockfree::detail::tagged_index
1> ] (compiling source file ..\src\outputmessage.cpp)
1> C:\boost_1_60_0\boost/lockfree/detail/freelist.hpp(603): note: see reference to class template instantiation 'std::atomic<boost::lockfree::detail::tagged_index>' being compiled (compiling source file ..\src\outputmessage.cpp)
1> C:\boost_1_60_0\boost/lockfree/detail/freelist.hpp(604): note: see reference to class template instantiation 'boost::lockfree::detail::fixed_size_freelist<T,NodeStorage>' being compiled (compiling source file ..\src\outputmessage.cpp)
1> position.cpp

Tried using Boost 159 and 157 aswell without success. Aswell as Mpir2.7 and the "real" Visual Studi but most other stuff than mentioned @top only gives me more errors.


thanks in advance
 
Last edited:
Thanks alot!

This thread(my post) is already outdated as people have helped out on your thread and the compiling tutorial though.

Apparently Boost160 does not contain a Lib64 Folder, Solution?? (@LordVissie uploaded his for me and im DLing it atm)

Also, maybe more important "bug" is that boost_register is not in the TFS SDK 3.2 nor does that compiling guide mention/use it at all.. Is it only 1.1+ versions that need this for compiling ? .. you need to execute this file in the Boost/boost folder, correct?(At least 1 out of a few tutorials said this "had to be done")..

If it fails again ill add your line of code there but, what/where is "lockfree_h"??

Huge thanks!
 
Everything in place, finally, yet, still same error :/

Where do I find lockfree_h?

Update: Sorry, adress was on the github page ofc.. my bad.

Pray for me this time, my hair needs it as its getting pretty thin up there by now :D
 
It's a fact: i'll die bald.

1> party.cpp
1>c:\tibtestserver\forgottenserver-8.6\src\lockfree.h(23): error C2059: syntax error: '+' (compiling source file ..\src\outputmessage.cpp)
1>c:\tibtestserver\forgottenserver-8.6\src\lockfree.h(23): error C2014: preprocessor command must start as first nonwhite space (compiling source file ..\src\outputmessage.cpp)
1>c:\tibtestserver\forgottenserver-8.6\src\lockfree.h(24): error C2014: preprocessor command must start as first nonwhite space (compiling source file ..\src\outputmessage.cpp)
1>c:\tibtestserver\forgottenserver-8.6\src\lockfree.h(25): error C2014: preprocessor command must start as first nonwhite space (compiling source file ..\src\outputmessage.cpp)
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt\assert.h(14): error C2143: syntax error: missing ';' before '{' (compiling source file ..\src\outputmessage.cpp)
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt\assert.h(14): error C2447: '{': missing function header (old-style formal list?) (compiling source file ..\src\outputmessage.cpp)
1> player.cpp
1>C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\atomic(661): error C2338: You've instantiated std::atomic<T> with sizeof(T) equal to 2/4/8 and alignof(T) < sizeof(T). Before VS 2015 Update 2, this would have misbehaved at runtime. VS 2015 Update 2 was fixed to handle this correctly, but the fix inherently changes layout and breaks binary compatibility. Please define _ENABLE_ATOMIC_ALIGNMENT_FIX to acknowledge that you understand this, and that everything you're linking has been compiled with VS 2015 Update 2 (or later). (compiling source file ..\src\outputmessage.cpp)
1> C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\atomic(675): note: see reference to class template instantiation 'std::_Atomic_base<_Ty,4>' being compiled
1> with
1> [
1> _Ty=boost::lockfree::detail::tagged_index
1> ] (compiling source file ..\src\outputmessage.cpp)
1> C:\boost_1_60_0\boost/lockfree/detail/freelist.hpp(603): note: see reference to class template instantiation 'std::atomic<boost::lockfree::detail::tagged_index>' being compiled (compiling source file ..\src\outputmessage.cpp)
1> C:\boost_1_60_0\boost/lockfree/detail/freelist.hpp(604): note: see reference to class template instantiation 'boost::lockfree::detail::fixed_size_freelist<T,NodeStorage>' being compiled (compiling source file ..\src\outputmessage.cpp)
1> position.cpp

Update:

All Hail Fardos, creator of everything and all!


========== Rebuild All: 1 succeeded, 0 failed, 0 skipped ==========
 
Last edited:
You are not supposed to copy plus/or minus signs, so remove those, and you should be good to go.
 
I actually figured that out myself(after 2-3 attempts ;) )

========== Rebuild All: 1 succeeded, 0 failed, 0 skipped ==========

Thanks for being mr @Ninja ! :)



EDIT: ill update this tomorrow for whoever walks the same path in future or perhaps create a fresh tutorial for my setup(win10, weather-conditions etc :p )
 
Last edited:
show the error?
if it's still the same error you didn't do it correctly

Code:
Severity    Code    Description    Project    File    Line    Suppression State
Error    C2338    You've instantiated std::atomic<T> with sizeof(T) equal to 2/4/8 and alignof(T) < sizeof(T). Before VS 2015 Update 2, this would have misbehaved at runtime. VS 2015 Update 2 was fixed to handle this correctly, but the fix inherently changes layout and breaks binary compatibility. Please define _ENABLE_ATOMIC_ALIGNMENT_FIX to acknowledge that you understand this, and that everything you're linking has been compiled with VS 2015 Update 2 (or later). (compiling source file ..\src\outputmessage.cpp)    theforgottenserver    D:\Archivos de programa (x86)\Microsoft Visual Studio 14.0\VC\include\atomic    659


my forgottenserver-8.6\src\lockfree.h


Code:
/**
 * The Forgotten Server - a free and open-source MMORPG server emulator
 * Copyright (C) 2016  Mark Samman <[email protected]>
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License along
 * with this program; if not, write to the Free Software Foundation, Inc.,
 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
 */

#ifndef FS_LOCKFREE_H_8C707AEB7C7235A2FBC5D4EDDF03B008
#define FS_LOCKFREE_H_8C707AEB7C7235A2FBC5D4EDDF03B008




#if _MSC_FULL_VER == 190023918 // Workaround for VS2015 Update 2. Boost.Lockfree is a header-only library, so this should be safe to do.
#define _ENABLE_ATOMIC_ALIGNMENT_FIX
#endif


#include <boost/lockfree/stack.hpp>

template <typename T, size_t CAPACITY>
class LockfreePoolingAllocator : public std::allocator<T>
{
    public:
        template <typename U>
        explicit LockfreePoolingAllocator(const U&) {}
        typedef T value_type;

        T* allocate(size_t) const {
            T* p; // NOTE: p doesn't have to be initialized
            if (!getFreeList().pop(p)) {
                //Acquire memory without calling the constructor of T
                p = static_cast<T*>(operator new (sizeof(T)));
            }
            return p;
        }

        void deallocate(T* p, size_t) const {
            if (!getFreeList().bounded_push(p)) {
                //Release memory without calling the destructor of T
                //(it has already been called at this point)
                operator delete(p);
            }
        }

    private:
        typedef boost::lockfree::stack<T*, boost::lockfree::capacity<CAPACITY>> FreeList;
        static FreeList& getFreeList() {
            static FreeList freeList;
            return freeList;
        }
};

#endif
 
Back
Top