Before commenting read Forum rules
Don't comment the topic if you have a new question.
You can create a new topic selecting correct category from Gurux Forum and then create a new topic selecting "New Topic" from the top left.
Before commenting read Forum rules
Don't comment the topic if you have a new question.
You can create a new topic selecting correct category from Gurux Forum and then create a new topic selecting "New Topic" from the top left.
Dear Sir.
Thank you for your great projects for DLMS c++ library. I want to read the data of the wattmeter operated by dlms protocol. So I built the development to make the "libgurux_dlms_cpp.a"
During compiling steps, I revised the original source in some places like these.
1) Ignoring the IP6 setup
2) switching the function "fopen_s /fopen", "sscanf_s / sscanf" because of not-finding function error
3) adding "#define ERROR_INVALID_FUNCTION 1, #define ERROR_IO_PENDING 976" in communication.h
I tried to make the build the "GuruxDLMSClientExample.cpp" but the compile error was shown as belows.
My pc condition is "Windows 10, MinGW(32 bit)". Pleas help me and thank you for your kindness.
---------------------------------------------------------------------------
obj/GuruxDLMSClientExample.o:GuruxDLMSClientExample.cpp:(.text+0x226): undefined reference to `WSAStartup@8'
obj/GuruxDLMSClientExample.o:GuruxDLMSClientExample.cpp:(.text+0x1563): undefined reference to `WSACleanup@0'
obj/communication.o:communication.cpp:(.text+0x61e): undefined reference to `closesocket@4'
obj/communication.o:communication.cpp:(.text+0x6ed): undefined reference to `socket@12'
obj/communication.o:communication.cpp:(.text+0x708): undefined reference to `WSAGetLastError@0'
obj/communication.o:communication.cpp:(.text+0x72e): undefined reference to `htons@4'
obj/communication.o:communication.cpp:(.text+0x746): undefined reference to `inet_addr@4'
obj/communication.o:communication.cpp:(.text+0x770): undefined reference to `gethostbyname@4'
obj/communication.o:communication.cpp:(.text+0x781): undefined reference to `WSAGetLastError@0'
obj/communication.o:communication.cpp:(.text+0x7d1): undefined reference to `htons@4'
obj/communication.o:communication.cpp:(.text+0x7e9): undefined reference to `WSAGetLastError@0'
obj/communication.o:communication.cpp:(.text+0x843): undefined reference to `setsockopt@20'
obj/communication.o:communication.cpp:(.text+0x864): undefined reference to `connect@12'
obj/communication.o:communication.cpp:(.text+0x875): undefined reference to `WSAGetLastError@0'
obj/communication.o:communication.cpp:(.text+0xa62): undefined reference to `WSAGetLastError@0'
obj/communication.o:communication.cpp:(.text+0xaf3): undefined reference to `WSAGetLastError@0'
obj/communication.o:communication.cpp:(.text+0xb73): undefined reference to `WSAGetLastError@0'
obj/communication.o:communication.cpp:(.text+0x104e): undefined reference to `WSAGetLastError@0'
obj/communication.o:communication.cpp:(.text+0x2105): more undefined references to `WSAGetLastError@0' follow
obj/communication.o:communication.cpp:(.text+0x21c1): undefined reference to `send@16'
obj/communication.o:communication.cpp:(.text+0x21d3): undefined reference to `WSAGetLastError@0'
obj/communication.o:communication.cpp:(.text+0x240c): undefined reference to `recv@16'
obj/communication.o:communication.cpp:(.text+0x242b): undefined reference to `WSAGetLastError@0'
../development/lib/libgurux_dlms_cpp.a(GXDLMSIp4Setup.o):GXDLMSIp4Setup.cpp:(.text+0x7b6): undefined reference to `inet_addr@4'
../development/lib/libgurux_dlms_cpp.a(GXDLMSIp4Setup.o):GXDLMSIp4Setup.cpp:(.text+0x7c8): undefined reference to `gethostbyname@4'
../development/lib/libgurux_dlms_cpp.a(GXDLMSIp4Setup.o):GXDLMSIp4Setup.cpp:(.text+0x9a6): undefined reference to `inet_addr@4'
../development/lib/libgurux_dlms_cpp.a(GXDLMSIp4Setup.o):GXDLMSIp4Setup.cpp:(.text+0x9b8): undefined reference to `gethostbyname@4'
../development/lib/libgurux_dlms_cpp.a(GXDLMSIp4Setup.o):GXDLMSIp4Setup.cpp:(.text+0xa68): undefined reference to `inet_addr@4'
../development/lib/libgurux_dlms_cpp.a(GXDLMSIp4Setup.o):GXDLMSIp4Setup.cpp:(.text+0xa7a): undefined reference to `gethostbyname@4'
../development/lib/libgurux_dlms_cpp.a(GXDLMSIp4Setup.o):GXDLMSIp4Setup.cpp:(.text+0xb08): undefined reference to `inet_addr@4'
../development/lib/libgurux_dlms_cpp.a(GXDLMSIp4Setup.o):GXDLMSIp4Setup.cpp:(.text+0xb1a): undefined reference to `gethostbyname@4'
../development/lib/libgurux_dlms_cpp.a(GXDLMSIp4Setup.o):GXDLMSIp4Setup.cpp:(.text+0xbc8): undefined reference to `inet_addr@4'
../development/lib/libgurux_dlms_cpp.a(GXDLMSIp4Setup.o):GXDLMSIp4Setup.cpp:(.text+0xbda): undefined reference to `gethostbyname@4'
../development/lib/libgurux_dlms_cpp.a(GXDLMSIp4Setup.o):GXDLMSIp4Setup.cpp:(.text+0xc68): undefined reference to `inet_addr@4'
../development/lib/libgurux_dlms_cpp.a(GXDLMSIp4Setup.o):GXDLMSIp4Setup.cpp:(.text+0xc7a): undefined reference to `gethostbyname@4'
collect2.exe: error: ld returned 1 exit status
make: *** [bin/gurux.dlms.client.bin] Error 1
---------------------------------------------------------------
Hi,
Hi,
You are using MinGW and it doesn't support Windows sockets. Check how to use sockets in MinGW and replace those functions (socket, closesocket, etc.).
BR,
Mikko