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

Build in windows. #6

Closed
MiaoDX opened this issue May 28, 2017 · 4 comments
Closed

Build in windows. #6

MiaoDX opened this issue May 28, 2017 · 4 comments
Assignees

Comments

@MiaoDX
Copy link
Contributor

MiaoDX commented May 28, 2017

Hei, it seems that you are making a tiny and neat library and it should be cross-platform since there are so many platform specific codes, I am looking for a small lib with cross-platform ability and your example code seems appealing, but I failed to build in windows10 with vs2015. 😢 , there are tons of mistakes.

cl : Command line warning D9002: ignoring unknown option '-m64',

it seems that -m64 -fPIC -pthread -lmbedtls -lmbedx509 -lmbedcrypto are for linux, but they are just warnning.

error C2556: 'float htonf(float)': overloaded function differs only by return type from 'unsigned int htonf(float)'
error C2371: 'htonf': redefinition; different basic types
[...]
[many many similar errors]
[...]
frnetlib\src\SSLSocket.cpp(7): fatal error C1083: Cannot open include file: 'mbedtls/net_sockets.h': No such file or directory

And the wrong messages is just too much, the first one I can understand, but I did not choose ssl at the very beginning, so why still need them? And the others just make me dizzy.

So,
1.have you build on windows, or am I missing something important? Hope will have a doc tell about how to build.
2.Can I choose not to compile ssl at all? (I am not so into cmake, so is it possible?)

Thanks for your time.

@Cloaked9000
Copy link
Owner

Ah, sorry. I've been using MinGW, the GCC port for my Windows builds, and there's a lot of little differences between the compilers.

The htonf() error for example, is because Visual C++ provides that function as standard, whereas it's not a standard POSIX function.

I'll have a look at fixing any compatability issues, and building it with Visual C++ later today, it shouldn't be too much work, I'll update this issue with an ETA once I've had a look. Thanks for your interest :)

@MiaoDX
Copy link
Contributor Author

MiaoDX commented May 28, 2017 via email

@Cloaked9000
Copy link
Owner

Hey, I've fixed the build errors, it was just a case of switching ssize_t's to int32_t's, and putting the network conversion code in ifdefs. However there are still build warnings which need to be fixed. Could you confirm that this builds properly and works for you?

@MiaoDX
Copy link
Contributor Author

MiaoDX commented May 29, 2017

Thanks, it can be built successfully and the main.cpp runs with no problem, I will try other examples.

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

No branches or pull requests

2 participants