Giter Site home page Giter Site logo

miss many files. about brynet HOT 10 CLOSED

mensong avatar mensong commented on August 15, 2024
miss many files.

from brynet.

Comments (10)

dyu avatar dyu commented on August 15, 2024 1

@IronsDu I was able to compile and run your examples with c++14 (dyu@55892d0)

Btw, your README says c++11. Might wanna change that to c++17 to avoid confusion.

from brynet.

IronsDu avatar IronsDu commented on August 15, 2024

Yes. Please exec cmake . and then exec make.

from brynet.

dyu avatar dyu commented on August 15, 2024

I'm getting the missing file errors.

src/brynet/net/DataSocket.h:4:15: fatal error: any: No such file or directory

from brynet.

IronsDu avatar IronsDu commented on August 15, 2024

@dyu sorry, brynet must use C++ 17. If you not have VS2017(and GCC 7.0) , you can modify code by self (use int64_t instead of std::any , and remove std::shared_mutex) .

from brynet.

dyu avatar dyu commented on August 15, 2024

@IronsDu I'm using c++14 at the moment. I'll try what you suggested. Thanks!

from brynet.

IronsDu avatar IronsDu commented on August 15, 2024

@dyu Godd Job! I will modify README, tks.
I want compatible std::any and int64_t.

from brynet.

IronsDu avatar IronsDu commented on August 15, 2024

@dyu I done it of the commit : 19a24ee , Can you verify it ?

from brynet.

dyu avatar dyu commented on August 15, 2024

Still getting errors.

In file included from /data/dyu/dev/github-cpp/brynet/src/brynet/net/WrapTCPService.cpp:1:0:
/data/dyu/dev/github-cpp/brynet/src/brynet/net/WrapTCPService.h:30:48: error: ‘std::any’ has not been declared
             void                    setUD(std::any ud);
                                                ^
In file included from /data/dyu/dev/github-cpp/brynet/src/brynet/net/WrapTCPService.cpp:1:0:
/data/dyu/dev/github-cpp/brynet/src/brynet/net/WrapTCPService.h:65:18: error: ‘any’ in namespace ‘std’ does not name a type
             std::any                    mUD;
                  ^
/data/dyu/dev/github-cpp/brynet/src/brynet/net/WrapTCPService.cpp: In member function ‘const BrynetAny& brynet::net::TCPSession::getUD() const’:
/data/dyu/dev/github-cpp/brynet/src/brynet/net/WrapTCPService.cpp:20:12: error: ‘mUD’ was not declared in this scope
     return mUD;
            ^
/data/dyu/dev/github-cpp/brynet/src/brynet/net/WrapTCPService.cpp: At global scope:
/data/dyu/dev/github-cpp/brynet/src/brynet/net/WrapTCPService.cpp:23:6: error: prototype for ‘void brynet::net::TCPSession::setUD(brynet::net::BrynetAny)’ does not match any in class ‘brynet::net::TCPSession’
 void TCPSession::setUD(BrynetAny ud)
      ^
In file included from /data/dyu/dev/github-cpp/brynet/src/brynet/net/WrapTCPService.cpp:1:0:
/data/dyu/dev/github-cpp/brynet/src/brynet/net/WrapTCPService.h:30:37: error: candidate is: void brynet::net::TCPSession::setUD(int)
             void                    setUD(std::any ud);
                                     ^
make[2]: *** [CMakeFiles/promisereceive.dir/src/brynet/net/WrapTCPService.cpp.o] Error 1
make[1]: *** [CMakeFiles/promisereceive.dir/all] Error 2
make: *** [all] Error 2

from brynet.

IronsDu avatar IronsDu commented on August 15, 2024

@dyu Please try again , tks.

from brynet.

dyu avatar dyu commented on August 15, 2024

Successfully built with this small change

diff --git a/CMakeLists.txt b/CMakeLists.txt
index da0f784..965975e 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -4,11 +4,7 @@ project(brynet)
 if(WIN32)
   set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /std:c++latest")
 elseif(UNIX)
-  if (CMAKE_COMPILER_IS_GNUCC AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS 7.0)
-    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
-  else()
-    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++17")
-  endif()
+  set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++14")
 endif()
 
 set(net_src_list

Otherwise, I get:

In file included from /data/dyu/dev/github-cpp/brynet/src/brynet/net/DataSocket.h:12:0,
                 from /data/dyu/dev/github-cpp/brynet/src/brynet/net/DataSocket.cpp:8:
/data/dyu/dev/github-cpp/brynet/src/brynet/net/Any.h:33:38: error: ‘cast’ function uses ‘auto’ type specifier without trailing return type
         auto cast(const BrynetAny& ud)
                                      ^
/data/dyu/dev/github-cpp/brynet/src/brynet/net/Any.h:33:38: note: deduced return type only available with -std=c++14 or -std=gnu++14
/data/dyu/dev/github-cpp/brynet/src/brynet/net/DataSocket.cpp: In member function ‘void brynet::net::DataSocket::sendPacket(const PACKET_PTR&, const PACKED_SENDED_CALLBACK&)’:
/data/dyu/dev/github-cpp/brynet/src/brynet/net/DataSocket.cpp:139:38: warning: lambda capture initializers only available with -std=c++14 or -std=gnu++14
     mEventLoop->pushAsyncProc([this, packetCapture = packet, callbackCapture = 
                                      ^
/data/dyu/dev/github-cpp/brynet/src/brynet/net/DataSocket.cpp:139:62: warning: lambda capture initializers only available with -std=c++14 or -std=gnu++14
     mEventLoop->pushAsyncProc([this, packetCapture = packet, callbackCapture = 
                                                              ^
make[2]: *** [CMakeFiles/promisereceive.dir/src/brynet/net/DataSocket.cpp.o] Error 1
make[1]: *** [CMakeFiles/promisereceive.dir/all] Error 2
make: *** [all] Error 2

from brynet.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.