Comments (5)
@DJuego, thanks for the error report!
I just found the following stackoverflow post. (etr/libhttpserver#71 (comment))
It seems like it would be better to use getnameinfo
since the function is supported on all platforms.
I'll give it a try when I have time this weekend.
from cpp-httplib.
Congrats! It works like a charm in x86_64-7.3.0-release-posix-seh-rt_v5-rev0 (MinGW with POSIX) and Visual Studio 2017, @yhirose
Thank you! Good work! I guess in the next days i am going to test it more thoroughly. :-)
In an anecdotal note I have problems with x86_64-7.3.0-release-win32-seh-rt_v5-rev0.
I had to add for building:
#ifdef MINGW_WIN32
#include "mingw.mutex.h"
#include "mingw.thread.h"
#else
#include <mutex>
#include <thread>
#endif
However the application crashed. Anyway, I do not think the problem is cpp-httplib. I have to investigate it more deeply. At the moment you can close the issue, Thanks again!
.
from cpp-httplib.
@DJuego, I made the change at issue-60
branch. When you have time, could you test the httplib.h
on the branch with your MinGW? (I don't have the compiler.) Thanks!
from cpp-httplib.
Thank you for your effort, @yhirose ! :-)
Well I have changed the old folder cpp-httplib with the new folder cpp-httplib in my project:
I get (MinGW)
[...]
from P:\Mis-Proyectos\Profesional\procesarpeticiones\src\main.cpp:5:
..\..\inc\cpp-httplib/httplib.h: In instantiation of 'socket_t httplib::detail::create_socket(const char*, int, Fn, int) [with Fn = httplib::Server::create_server_socket(const char*, int, int) const::<lambda(socket_t, addrinfo&)>; socket_t = long long unsigned int]':
..\..\inc\cpp-httplib/httplib.h:1582:24: required from here
..\..\inc\cpp-httplib/httplib.h:552:17: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
if (sock == -1) {
~~~~~^~~~~
..\..\inc\cpp-httplib/httplib.h: In instantiation of 'socket_t httplib::detail::create_socket(const char*, int, Fn, int) [with Fn = httplib::Client::create_client_socket() const::<lambda(socket_t, addrinfo&)>; socket_t = long long unsigned int]':
..\..\inc\cpp-httplib/httplib.h:1825:10: required from here
..\..\inc\cpp-httplib/httplib.h:552:17: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
obj\Debug\src\main.o: In function `httplib::detail::read_content_with_length(httplib::Stream&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&, unsigned long long, std::function<void (unsigned long long, unsigned long long)>)':
P:\Mis-Proyectos\Profesional\procesarpeticiones\prj\procesarpeticiones_mingwcdb/../../inc/cpp-httplib/httplib.h:771: multiple definition of `httplib::detail::read_content_with_length(httplib::Stream&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&, unsigned long long, std::function<void (unsigned long long, unsigned long long)>)'
obj\Debug\src\GestorDePeticiones.o:P:\Mis-Proyectos\Profesional\procesarpeticiones\prj\procesarpeticiones_mingwcdb/../../inc/cpp-httplib/httplib.h:771: first defined here
obj\Debug\src\main.o: In function `httplib::detail::read_content_without_length(httplib::Stream&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&)':
P:\Mis-Proyectos\Profesional\procesarpeticiones\prj\procesarpeticiones_mingwcdb/../../inc/cpp-httplib/httplib.h:791: multiple definition of `httplib::detail::read_content_without_length(httplib::Stream&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&)'
obj\Debug\src\GestorDePeticiones.o:P:\Mis-Proyectos\Profesional\procesarpeticiones\prj\procesarpeticiones_mingwcdb/../../inc/cpp-httplib/httplib.h:791: first defined here
obj\Debug\src\main.o: In function `httplib::detail::read_content_chunked(httplib::Stream&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&)':
P:\Mis-Proyectos\Profesional\procesarpeticiones\prj\procesarpeticiones_mingwcdb/../../inc/cpp-httplib/httplib.h:807: multiple definition of `httplib::detail::read_content_chunked(httplib::Stream&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&)'
obj\Debug\src\GestorDePeticiones.o:P:\Mis-Proyectos\Profesional\procesarpeticiones\prj\procesarpeticiones_mingwcdb/../../inc/cpp-httplib/httplib.h:807: first defined here
collect2.exe: error: ld returned 1 exit status
Process terminated with status 1 (0 minute(s), 20 second(s))
7 error(s), 28 warning(s) (0 minute(s), 20 second(s))
And i get (Visual Studio 2017):
[...]
1>main.obj : error LNK2005: "bool __cdecl httplib::detail::read_content_chunked(class httplib::Stream &,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > &)" (?read_content_chunked@detail@httplib@@YA_NAEAVStream@2@AEAV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z) already defined in GestorDePeticiones.obj
1>main.obj : error LNK2005: "bool __cdecl httplib::detail::read_content_with_length(class httplib::Stream &,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > &,unsigned __int64,class std::function<void __cdecl(unsigned __int64,unsigned __int64)>)" (?read_content_with_length@detail@httplib@@YA_NAEAVStream@2@AEAV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@_KV?$function@$$A6AX_K0@Z@5@@Z) already defined in GestorDePeticiones.obj
1>main.obj : error LNK2005: "bool __cdecl httplib::detail::read_content_without_length(class httplib::Stream &,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > &)" (?read_content_without_length@detail@httplib@@YA_NAEAVStream@2@AEAV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z) already defined in GestorDePeticiones.obj
1>P:\Mis-Proyectos\Profesional\procesarpeticiones\prj\procesarpeticiones_msvc2017\x64\Debug\procesarpeticiones_msvc2017.exe : fatal error LNK1169: one or more multiply defined symbols found
1>Done building project "procesarpeticiones_msvc2017.vcxproj" -- FAILED.
========== Rebuild All: 0 succeeded, 1 failed, 0 skipped ==========
from cpp-httplib.
@DJuego, I forgot to include #59 and I fixed it just now...
Could you get the latest httpib.h on issue-60 branch, and test it again?
from cpp-httplib.
Related Issues (20)
- req.params decoded russian symbols invalid, but req.target gave correct info HOT 2
- The URL regular expression cannot match an IPv6 address
- Client is throwing `READ` error when requesting healthy HTTP endpoints. HOT 1
- IPV6_V6ONLY is a little weird on freebsd
- how to download a file in android ? HOT 1
- about the `:` in path param
- Arguments of type form-data could not be resolved
- Incorrect handling of `Expect: 100-continue` during large file uploads HOT 4
- Cache response to respond to request later HOT 1
- Cancel a Http Request HOT 1
- pre routing handler with body available (or a catch all route) HOT 2
- any possible way to get the request stream? HOT 1
- Does cpp-httplib have plan to support websocket? HOT 2
- Feature request: Client: Post with content receiver HOT 3
- ssl server name indication HOT 1
- form-data not working in C++ in request when body has text fields HOT 4
- Support MinGW HOT 1
- Request Lost when using SSL HOT 4
- unexpected 2000ms delay when connecting by localhost HOT 1
- DataSink outputstream fails handling single chars
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 cpp-httplib.