PLUGIN - Am I using the correct includes?
#1

Hello.

I recently started working on my own plugin aaand I'm facing some issues. So here is the problem, following this tutorial: https://sampforum.blast.hk/showthread.php?tid=295798

Now, I downloaded "Invoke.h" file and put it right place. It required additional include so I've placed it inside "Invoke.h". No errors highlighting found. But there are some on my main .cpp file (PluginSAMP.cpp) So here is the full error list https://pastebin.com/wb0pC6bz

The code can be found on bottom of the shared tutorial.

Do I need to download some other file or something? My current Invoke.h file has this
Код:
#ifndef _GLIBCXX_INVOKE_H
#define _GLIBCXX_INVOKE_H 1

#pragma GCC system_header

#if __cplusplus < 201103L
#ifndef _CXX0X_WARNING_H
#define _CXX0X_WARNING_H 1

#endif
#else

#include <type_traits>

namespace std _GLIBCXX_VISIBILITY(default)
{
_GLIBCXX_BEGIN_NAMESPACE_VERSION

  /**
   *  @addtogroup utilities
   *  @{
   */

  // Used by __invoke_impl instead of std::forward<_Tp> so that a
  // reference_wrapper is converted to an lvalue-reference.
  template<typename _Tp, typename _Up = typename __inv_unwrap<_Tp>::type>
    constexpr _Up&&
    __invfwd(typename remove_reference<_Tp>::type& __t) noexcept
    { return static_cast<_Up&&>(__t); }

  template<typename _Res, typename _Fn, typename... _Args>
    constexpr _Res
    __invoke_impl(__invoke_other, _Fn&& __f, _Args&&... __args)
    { return std::forward<_Fn>(__f)(std::forward<_Args>(__args)...); }

  template<typename _Res, typename _MemFun, typename _Tp, typename... _Args>
    constexpr _Res
    __invoke_impl(__invoke_memfun_ref, _MemFun&& __f, _Tp&& __t,
		  _Args&&... __args)
    { return (__invfwd<_Tp>(__t).*__f)(std::forward<_Args>(__args)...); }

  template<typename _Res, typename _MemFun, typename _Tp, typename... _Args>
    constexpr _Res
    __invoke_impl(__invoke_memfun_deref, _MemFun&& __f, _Tp&& __t,
		  _Args&&... __args)
    {
      return ((*std::forward<_Tp>(__t)).*__f)(std::forward<_Args>(__args)...);
    }

  template<typename _Res, typename _MemPtr, typename _Tp>
    constexpr _Res
    __invoke_impl(__invoke_memobj_ref, _MemPtr&& __f, _Tp&& __t)
    { return __invfwd<_Tp>(__t).*__f; }

  template<typename _Res, typename _MemPtr, typename _Tp>
    constexpr _Res
    __invoke_impl(__invoke_memobj_deref, _MemPtr&& __f, _Tp&& __t)
    { return (*std::forward<_Tp>(__t)).*__f; }

  /// Invoke a callable object.
  template<typename _Callable, typename... _Args>
    constexpr typename __invoke_result<_Callable, _Args...>::type
    __invoke(_Callable&& __fn, _Args&&... __args)
    noexcept(__is_nothrow_invocable<_Callable, _Args...>::value)
    {
      using __result = __invoke_result<_Callable, _Args...>;
      using __type = typename __result::type;
      using __tag = typename __result::__invoke_type;
      return std::__invoke_impl<__type>(__tag{}, std::forward<_Callable>(__fn),
					std::forward<_Args>(__args)...);
    }

_GLIBCXX_END_NAMESPACE_VERSION
} // namespace std

#endif // C++11

#endif // _GLIBCXX_INVOKE_H
I spent some time downloading multiple files and checking it over and over again but nothing came up.

NOTE 1: All error highlights are on "&PAWN" and "g_Invoke".
Reply
#2

i would suggest you not to do your own plugins and use those, what are posted.
Reply
#3

But I just started learning from the code I've been given. Now this isn't really a way to learn but I wanted to check if everything is working properly and I can jump into plugin journey and this came up.
Reply
#4

That's not the invoke header you're looking for.
Anyway, better use sampgdk if you wanna call pawn natives from inside your plugin. Here's a tutorial: https://github.com/Zeex/sampgdk/wiki...GDK-with-CMake
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)