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 9 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 9 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 9 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

  • 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

Who's new

  • Tuanhgg
  • Adel
  • charnon
  • Paddles
  • Miguel Ángel
RSS feed
Privacy FAQ GXDN Issues Contact
Follow Gurux on Twitter Follow Gurux on Linkedin