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. Forums
  3. Error Compile In Arduino Sketch

Error Compile in Arduino Sketch

Forum Rules

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.

By rndsmi , 3 September, 2020
Forums
Gurux.DLMS

Dear DLMS Experts,

I try to compile DLMS source code with Arduino Mega 2560. I already copy the src and include folder from development folder into the Arduino_IDE server folder. I click the compile button then Arduino IDE displays an error. Please see my attachments.
Is there any file to edit ? Hope my attachment could help you to find the problem. Thank you.

The error :
------------------
C:\Users\RNDSMI\AppData\Local\Temp\arduino_build_405699\sketch\include/variant.h:98:9: note: type 'union <anon>' itself violates the C++ One Definition Rule
{
^
C:\Users\RNDSMI\AppData\Local\Temp\arduino_build_405699\sketch\include/variant.h:139:7: note: type 'struct dlmsVARIANT' should match type 'struct dlmsVARIANT'
} dlmsVARIANT;
^
C:\Users\RNDSMI\AppData\Local\Temp\arduino_build_405699\sketch\include/gxvalueeventargs.h:127:7: note: type 'struct gxValueEventCollection' itself violates the C++ One Definition Rule
} gxValueEventCollection;
^
C:\Users\RNDSMI\AppData\Local\Temp\arduino_build_405699\sketch\include/variant.h:139:7: note: type 'struct dlmsVARIANT' should match type 'struct dlmsVARIANT'
} dlmsVARIANT;
^
C:\Users\RNDSMI\AppData\Local\Temp\arduino_build_405699\sketch\include/dlmssettings.h:183:7: note: type 'struct dlmsSettings' itself violates the C++ One Definition Rule
} dlmsSettings;
^
C:\Users\RNDSMI\AppData\Local\Temp\arduino_build_405699\sketch\include/dlmssettings.h:240:7: note: type 'struct dlmsServerSettings' itself violates the C++ One Definition Rule
} dlmsServerSettings;
^
C:\Users\RNDSMI\AppData\Local\Temp\arduino_build_405699\sketch\include/gxarray.h:58:7: note: type 'struct gxArray' itself violates the C++ One Definition Rule
} gxArray;
^
C:\Users\RNDSMI\AppData\Local\Temp\ccLCni3n.ltrans2.ltrans.o: In function `sendPush(dlmsSettings*, gxPushSetup*) [clone .part.39] [clone .constprop.103]':

D:\SMI\Modem\GuruxDLMS.c-master\Arduino_IDE\server/server.ino:1559: undefined reference to `mes_attach'

collect2.exe: error: ld returned 1 exit status

Using library EEPROM at version 2.0 in folder: C:\Program Files (x86)\Arduino\hardware\arduino\avr\libraries\EEPROM

exit status 1

Error compiling for board Arduino Mega or Mega 2560.
------------------

Regards,
Mahendra

rndsmi

5 years 11 months ago

Dear DLMS Experts,

Dear DLMS Experts,

I add this attachment to make sure I copied the folder correctly. Thank you.

Regards,
Mahendra

Profile picture for user Kurumi

Kurumi

5 years 11 months ago

Hi,

Hi,

I believe this is the reason:

Because you can't give compiler parameters for Arduino IDE, you need to un-comment those lines from gxignore.h file.

#define DLMS_IGNORE_SERVER
#define GX_DLMS_MICROCONTROLLER
#define DLMS_IGNORE_MALLOC

BR,
Mikko

rndsmi

5 years 11 months ago

Dear DLMS Experts,

Dear DLMS Experts,

#define DLMS_IGNORE_SERVER
#define GX_DLMS_MICROCONTROLLER
#define DLMS_IGNORE_MALLOC

Those lines are un-commented right now. The problem is solved. Thank you.

Regards,
Mahendra

  • Create new account
  • Reset your password

Hire Us!

Latest Releases

  • Mon, 07/27/2026 - 12:37
    gurux.dlms.cpp 9.0.2607.2701
  • Thu, 07/23/2026 - 16:19
    gurux.dlms.java 4.0.96
  • Thu, 07/09/2026 - 14:34
    Gurux.DLMS.Python 1.0.201
  • Fri, 06/26/2026 - 16:32
    Gurux.Service 3.0.2606.2601
  • Wed, 06/24/2026 - 08:36
    Gurux.DLMS.Python 1.0.200

New forum topics

  • Version mismatch between Gurux.DLMS 9.x and Gurux.Common/Gurux.Serial 8.x
  • Service not known error on gprs communication
  • Help Needed: Interfacing Saral 100 Energy Meter with Microcontroller via RS232
  • Connecting Meter to Agent via serial
  • Reading block profile with Compact array
More

Who's new

  • nostra
  • cuiVEAwINCoyynjjn
  • qlMlMNfbqjNumKgGFIo
  • randx-super.ru
  • Arturolooth
RSS feed
Privacy FAQ GXDN Issues Contact
Follow Gurux on Twitter Follow Gurux on Linkedin