Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

error: conflicting declaration 'typedef char int8_t' #55

Open
Kertopher opened this issue Jan 8, 2017 · 2 comments
Open

error: conflicting declaration 'typedef char int8_t' #55

Kertopher opened this issue Jan 8, 2017 · 2 comments

Comments

@Kertopher
Copy link

(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.

@dhbaird
Copy link
Owner

dhbaird commented Jan 8, 2017

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

@andrewpaulino
Copy link

@dhbaird Has this been optimized for windows yet?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants