Comments (10)
@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.
Yes. Please exec cmake .
and then exec make
.
from brynet.
I'm getting the missing file errors.
src/brynet/net/DataSocket.h:4:15: fatal error: any: No such file or directory
from brynet.
@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.
@IronsDu I'm using c++14 at the moment. I'll try what you suggested. Thanks!
from brynet.
@dyu Godd Job! I will modify README, tks.
I want compatible std::any and int64_t.
from brynet.
@dyu I done it of the commit : 19a24ee , Can you verify it ?
from brynet.
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.
@dyu Please try again , tks.
from brynet.
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)
- 在session->setDataCallback<brynet::net::TcpConnection::DataCallback>()函数中怎么获得session HOT 3
- 客户端一次性发送大量数据给服务端 HOT 3
- 请问有webSocket-Server的DEMO吗? HOT 6
- Crashing when session send response with post close HOT 7
- The package on Conan is not newest HOT 5
- Question to API “service->startWorkerThread(xxx)” HOT 2
- wss支持cdn转发吗 HOT 5
- multipart/form-data support HOT 23
- CodeQL没有正确配置 HOT 4
- 我在ue中尝试使用这个库,但是貌似它连上后就没什么反应了 HOT 1
- andorid ios support?
- No test target - the project only builds test executables but doesn't define the 'test' target to run tests HOT 2
- It doesn't make sense to have different C++ standard for different compilers HOT 4
- 关于IO线程的数量,最佳建议是几个呢? HOT 2
- brynet能否支持同步发送数据,阻塞式接收?并支持recv超时 HOT 1
- EventLoop 类可以脱离socket使用吗?比如我在其他业务场景使用 HOT 4
- Websocket/http over proxy HOT 4
- http压缩传输可以考虑加入吗,比如gzip、br HOT 1
- 在一个http session中,循环很多次调用session->send发送文件数据,内存占用会一直涨,需要关闭session之后才能释放 HOT 6
- I sugest change initSSL, as a client, it's not necessary use certificates when connecting to a SSL server . HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from brynet.