Skip to main content
Home
for DLMS smart meters
Open source solutions for DLMS smart metering

Main navigation

  • Home
  • Products
  • About us
  • Open Source
  • Community
  • Forum
  • Downloads
User account menu
  • Log in

Breadcrumb

  1. Home
  2. Compile Errors In Last Commit (20240216.1)

Compile errors in last commit (20240216.1)

Profile picture for user Dmitry
By Dmitry , 19 February, 2024
Forums
Gurux.DLMS

Hi, Mikko!
I try to compile project with last changes in gurux.dlms.cpp but have compile errors (Linux).
1. In file GXAsn1Integer.h #include "GXBiginteger.h" but correct file name is "GXBigInteger.h"
2. In file GXx509Certificate.h #include "Enums.h" but correct file name is "enums.h"
3. Compile error in file GXPkcs.cpp:
SOCKET was not declared in this scope.
‘closesocket’ was not declared in this scope
cannot bind non-const lvalue reference of type ‘std::vector<std::__cxx11::basic_string<char> >&’ to an rvalue of type ‘std::vector<std::__cxx11::basic_string<char> >’

Thanks!

Profile picture for user Dmitry

Dmitry

2 years 3 months ago

On Linux function socket()…

On Linux function socket() returns int instead SOCKET, close() instead closecocket()

Profile picture for user Kurumi

Kurumi

2 years 3 months ago

Hi Dmitry, Thank you for…

Hi Dmitry,

Thank you for pointing this out. Those are now fixed to the latest version.

BR,
Mikko

Profile picture for user Dmitry

Dmitry

2 years 3 months ago

Thank you for fix. Also can…

Thank you for fix. Also can't compile for Windows (MinGW). Error in bool GXHelpers::DirectoryExists(const char* path) method.
no matching function for call to '_stat::_stat(const char*&, stat*).

Profile picture for user Kurumi

Kurumi

2 years 3 months ago

Hi, There is no easy way to…

Hi,

There is no easy way to solve this because _WIN32 is defined.

I need to think if IGNORE_CERTIFICATION_UPDATE is defined that can be used to ignore this functionality.

BR,
Mikko

Profile picture for user Dmitry

Dmitry

2 years 3 months ago

I think you can write like…

I think you can write like this:
#if defined(_WIN32) || defined(_WIN64)//Windows
#include <direct.h>
#include <sys/stat.h> //here _stat() for Windows
#endif
#if defined(__linux__)
#include <sys/stat.h>
#endif

bool GXHelpers::DirectoryExists(const char* path)
{

#if defined(_WIN32) || defined(_WIN64)//Windows
struct _stat sb;
if(_stat(path, &sb) == 0)
return true;
return false;
#else
struct stat sb;
if (stat(path, &sb) == 0)
{
return true;
}
return false;
#endif
}

This code compiles succsessfully.

Profile picture for user Kurumi

Kurumi

2 years 3 months ago

Hi Dmitry, Windows doesn't…

Hi Dmitry,

Windows doesn't normally use sys/stat.h. This doesn't work e.g. with Visual Studio,

#include <sys/stat.h>

I believe there will be a compiler option for this for the next release.

BR,
Mikko

Profile picture for user Kurumi

Kurumi

2 years 3 months ago

Hi, Get the latest version…

Hi,

Get the latest version and add DLMS_IGNORE_DIRECTORY for your make file.
That will solve this problem.

BR,
Mikko

Profile picture for user Dmitry

Dmitry

2 years 3 months ago

Thanks for your fix! I'll…

Thanks for your fix! I'll try it.

  • Create new account
  • Reset your password

Hire Us!

Latest Releases

  • Tue, 06/09/2026 - 11:16
    gurux.dlms.java 4.0.95
  • Tue, 06/09/2026 - 10:03
    Gurux.DLMS.Python 1.0.199
  • Mon, 06/08/2026 - 13:39
    gurux.dlms.cpp 9.0.2606.0801
  • Mon, 06/01/2026 - 10:15
    gurux.dlms.cpp 9.0.2606.0101
  • Thu, 05/28/2026 - 16:06
    gurux.dlms.java 4.0.94

New forum topics

  • Error reading L&G Meter
  • Pass a TCP Client to GXNet
  • Australian EDMI Mk10D (Essential Energy area)
  • Strange mix of data notificiation vs get response
  • DLMS Connection
More
RSS feed
Privacy FAQ GXDN Issues Contact
Follow Gurux on Twitter Follow Gurux on Linkedin