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

6 years 2 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

6 years 2 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

6 years 2 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

  • Thu, 11/19/2026 - 10:57
    Gurux.DLMS.Python 1.0.204
  • Thu, 11/19/2026 - 10:12
    gurux.dlms.c 9.0.2611.1901
  • Tue, 10/13/2026 - 12:00
    gurux.dlms.java 4.0.97
  • Tue, 09/22/2026 - 14:02
    Gurux.DLMS.Net 9.0.2609.2201
  • Mon, 09/21/2026 - 10:18
    Gurux.DLMS.Net 9.0.2609.2101

New forum topics

  • Landis E650 meter reading over DLMS
  • class_id = 40, version = 2, pushsetup Unparsed data frame
  • GXObisValueItem entries without MaskSize appear to be interpreted as bit flags
  • CheckedListBox incorrectly selects GXObisValueItem Value=0 for non-zero values
  • UIValueType=TextBox is rendered as CheckedListBox when Values are defined
More

Who's new

  • Sayang
  • q80435762@gmail.com
  • ONCAK
  • Berhasil
  • ratirvivege1979
RSS feed
Privacy FAQ GXDN Issues Contact
Follow Gurux on Twitter Follow Gurux on Linkedin