easywsclient icon indicating copy to clipboard operation
easywsclient copied to clipboard

error: conflicting declaration 'typedef char int8_t'

Open Kertopher opened this issue 7 years ago • 2 comments

(Note that I'm a bit noobish to c++, especially when it comes to using other people's libraries.)

Using example windows code (with the included cpp), the program broke on run time.

Here's the full error: ||=== Build: Debug in ClientTest (compiler: GNU GCC Compiler) ===| easywsclient.cpp|12|warning: ignoring #pragma comment [-Wunknown-pragmas]| main.cpp|4|warning: ignoring #pragma comment [-Wunknown-pragmas]| easywsclient.cpp|33|error: conflicting declaration 'typedef char int8_t'| stdint.h|27|error: 'int8_t' has a previous declaration as 'typedef signed char int8_t'| easywsclient.cpp|35|error: conflicting declaration 'typedef long int int32_t'| stdint.h|31|error: 'int32_t' has a previous declaration as 'typedef int int32_t'| easywsclient.cpp|36|error: conflicting declaration 'typedef long unsigned int uint32_t'| stdint.h|32|error: 'uint32_t' has a previous declaration as 'typedef unsigned int uint32_t'| easywsclient.cpp||In function 'socket_t {anonymous}::hostname_connect(const string&, int)':| easywsclient.cpp|92|error: '_snprintf_s' was not declared in this scope| easywsclient.cpp|93|error: 'getaddrinfo' was not declared in this scope| easywsclient.cpp|108|error: 'freeaddrinfo' was not declared in this scope| easywsclient.cpp||In function 'easywsclient::WebSocket* {anonymous}::from_url(const string&, bool, const string&)':| easywsclient.cpp|468|error: '_snprintf_s' was not declared in this scope| ||=== Build failed: 10 error(s), 2 warning(s) (0 minute(s), 1 second(s)) ===|

It's probably me doing something stupid, but I was just wondering what went wrong here. (Again, using the example code and including the cpp file.)

Windows 10, using Code Blocks.

Kertopher avatar Jan 08 '17 21:01 Kertopher

Hi @Kertopher, this code hasn't been yet written to work with the Code::Blocks / MinGW compiler; But let me know what steps you do to get it working. And adding these compiler flags might help you get a head start. Let me know:

-Dsnprintf=snprintf
-D_WIN32_WINNT=0x0501
-D_MSC_VER=1600

dhbaird avatar Jan 08 '17 21:01 dhbaird

@dhbaird Has this been optimized for windows yet?

andrewpaulino avatar Nov 27 '19 08:11 andrewpaulino