Build Gurux.DLMS cpp lib for Windows

5 posts / 0 new
Last post
Dmitry
Dmitry's picture
Build Gurux.DLMS cpp lib for Windows

Hi!
I downloaded Gurux.DLMS cpp from github.
Created empty project (Qt Creator) and added all sources lib files to project. Then run building but failed.
Error: 'inet_ntop' was not declared in this scope
..\guruxlib_test\guruxlib\src\GXDLMSIp6Setup.cpp:97:13: error: 'inet_ntop' was not declared in this scope
inet_ntop(AF_INET6, &(*it), tmp, sizeof(tmp));
^~~~~~~~~
..\guruxlib_test\guruxlib\src\GXDLMSIp6Setup.cpp:97:13: note: suggested alternative: 'inet_ntoa'
inet_ntop(AF_INET6, &(*it), tmp, sizeof(tmp));
^~~~~~~~~
inet_ntoa

Windows 10, MinGW
How to fix it?
Thanks!

For Linux - OK.

Kurumi
Kurumi's picture

Hi,

You need to add Ws2_32.lib to your linker inputs.

BR,
Mikko

________________________________________
Mikko Kurunsaari
Gurux Ltd
http://www.gurux.fi

Dmitry
Dmitry's picture

Hi!
Thanks for you reply.
I added to .pro-file

win32: LIBS += -lWS2_32

but nothing. What i'm doing wrong? Thanks!

Kurumi
Kurumi's picture

Hi,

I add DLMS_IGNORE_IP6_SETUP to compiler flags to ignore IPv6 functionality. I believe it's the easiest way to solve this.

BR,
Mikko

________________________________________
Mikko Kurunsaari
Gurux Ltd
http://www.gurux.fi

Dmitry
Dmitry's picture

Yes, it works.
I added to .pro file
DEFINES += DLMS_IGNORE_IP6_SETUP
Thanks!