visual c++ - C++ MSVC dll compiling error missing type specifier and redefinition -


i'm using microsoft visual studio community 2015 update 3 , im compiling dll. want call function initpreysplitpipe have tried calling ::pr::initpreysplitpipe , copied interprocess.cpp code game_local.cpp , interprocess.hpp code game_local.h , call there didnt work either.

i have set github repository code if 1 interested.

thanks reading , sorry bad english :/

compiler output:

error c4430 missing type specifier - int assumed. note: c++ not support default-int error c2371 'pr::initpreysplitpipe': redefinition; different basic types error c2556 'int initpreysplitpipe(void)': overloaded function differs return type 'void pr::initpreysplitpipe(void)' 

interprocess.hpp

namespace pr { (...) void initpreysplitpipe(); (...) } 

interprocess.cpp

#include "interprocess.hpp"  namespace pr { (...)     void initpreysplitpipe()     {         pipe_preysplit = createnamedpipe("\\\\.\\pipe\\" preysplit_pipe_name,pipe_access_outbound | file_flag_overlapped, pipe_type_message | pipe_reject_remote_clients, 1, 256 * 1000, 0, 0, null);         if (pipe_preysplit == invalid_handle_value)         {             return;         }          std::memset(&overlapped, 0, sizeof(overlapped));         overlapped.hevent = createevent(null, true, true, null);         if (overlapped.hevent == null)         {             pipe_preysplit = invalid_handle_value;         }     } (...) } 

// function shoud called

game_local.cpp

(...) #include "../preyrun/interprocess.hpp" pr::initpreysplitpipe(); (...) 

in game_local.cpp:

// preyrun begin #include "../preyrun/interprocess.hpp" pr::initpreysplitpipe(); // preyrun end 

you not calling function within anything, compiler thinks it's new function declaration. type int assumed, of overloaded function int pr:initpreysplitpipe() conflicts void pr::initpreysplitpipe(). explains 3 error messages.


Comments

Popular posts from this blog

mysql - Dreamhost PyCharm Django Python 3 Launching a Site -

java - Sending SMS with SMSLib and Web Services -

java - How to resolve The method toString() in the type Object is not applicable for the arguments (InputStream) -