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. Linker Error When Getting LibGuruxDLMSLib.so From GuruxDLMSLib

Linker error when getting libGuruxDLMSLib.so from GuruxDLMSLib

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 AhmedSamir , 30 May, 2015

hello Gurux staff , now i am trying to build as shared library from GuruxDLMSLib on Linux ( Ubuntu 14.4 ) i get this error on linking phase

----------------------------- console content -----------------------------
Building target: libGuruxDLMSLib.so
Invoking: GCC C++ Linker
g++ -shared -o "libGuruxDLMSLib.so" ./Objects/GXApplicationContextName.o ./Objects/GXAuthenticationMechanismName.o ./Objects/GXDLMSActionItem.o ./Objects/GXDLMSActionSchedule.o ./Objects/GXDLMSActionSet.o ./Objects/GXDLMSActivityCalendar.o ./Objects/GXDLMSAssociationLogicalName.o ./Objects/GXDLMSAssociationShortName.o ./Objects/GXDLMSAutoAnswer.o ./Objects/GXDLMSAutoConnect.o ./Objects/GXDLMSCaptureObject.o ./Objects/GXDLMSClock.o ./Objects/GXDLMSData.o ./Objects/GXDLMSDayProfile.o ./Objects/GXDLMSDayProfileAction.o ./Objects/GXDLMSDemandRegister.o ./Objects/GXDLMSDisconnectControl.o ./Objects/GXDLMSEmergencyProfile.o ./Objects/GXDLMSExtendedRegister.o ./Objects/GXDLMSGPRSSetup.o ./Objects/GXDLMSHdlcSetup.o ./Objects/GXDLMSIECOpticalPortSetup.o ./Objects/GXDLMSImageActivateInfo.o ./Objects/GXDLMSImageTransfer.o ./Objects/GXDLMSIp4Setup.o ./Objects/GXDLMSIp4SetupIpOption.o ./Objects/GXDLMSLimiter.o ./Objects/GXDLMSMBusClient.o ./Objects/GXDLMSMBusMasterPortSetup.o ./Objects/GXDLMSMBusSlavePortSetup.o ./Objects/GXDLMSMacAddressSetup.o ./Objects/GXDLMSMessageHandler.o ./Objects/GXDLMSModemConfiguration.o ./Objects/GXDLMSModemInitialisation.o ./Objects/GXDLMSMonitoredValue.o ./Objects/GXDLMSObject.o ./Objects/GXDLMSObjectCollection.o ./Objects/GXDLMSObjectDefinition.o ./Objects/GXDLMSPppSetup.o ./Objects/GXDLMSPppSetupIPCPOption.o ./Objects/GXDLMSPppSetupLcpOption.o ./Objects/GXDLMSProfileGeneric.o ./Objects/GXDLMSPushObject.o ./Objects/GXDLMSPushSetup.o ./Objects/GXDLMSQualityOfService.o ./Objects/GXDLMSRegister.o ./Objects/GXDLMSRegisterActivation.o ./Objects/GXDLMSRegisterMonitor.o ./Objects/GXDLMSSapAssignment.o ./Objects/GXDLMSSchedule.o ./Objects/GXDLMSScriptAction.o ./Objects/GXDLMSScriptTable.o ./Objects/GXDLMSSeasonProfile.o ./Objects/GXDLMSSecuritySetup.o ./Objects/GXDLMSSpecialDay.o ./Objects/GXDLMSSpecialDaysTable.o ./Objects/GXDLMSTcpUdpSetup.o ./Objects/GXDLMSWeekProfile.o ./Objects/GXSendDestinationAndMethod.o ./Objects/GXxDLMSContextType.o ./GXDLMS.o ./GXDLMSClient.o ./GXDLMSConverter.o ./GXDLMSLNSettings.o ./GXDLMSLimits.o ./GXDLMSObjectFactory.o ./GXDLMSSNSettings.o ./GXDLMSServerBase.o ./GXDLMSVariant.o ./GXDateTime.o ./GXOBISTemplate.o ./GXStandardObisCode.o ./GXStandardObisCodeCollection.o

/usr/bin/ld: ./Objects/GXApplicationContextName.o: relocation R_X86_64_32 against `.rodata' can not be used when making a shared object; recompile with -fPIC
./Objects/GXApplicationContextName.o: error adding symbols: Bad value
collect2: error: ld returned 1 exit status

-------------------------- end of console content --------------------------

i need some help to handle his error
thanks in advance

Profile picture for user Kurumi

Kurumi

10 years 12 months ago

Linker error when getting libGuruxDLMSLib.so from GuruxDLMSLib

Hi,

Can you post your build parameters here. We will check it and let you know.

BR,

Mikko

Profile picture for user hassin Ayaz

hassin Ayaz

8 years 3 months ago

Linker Error in linux build environment C++ server code

Hello Mr Kurumi

i am facing problem at linking the Gurux.DLMS.cpp server example code in linux environment
I have opened the project in eclipse under lubuntu
at compile the following linking error occurs
---------------------------------------------------------------------------------------

16:20:02 **** Build of configuration Build (GNU) for project GuruxDLMSServerExample ****
make
src/GXDLMSBase.cpp: In function ‘CGXDLMSData* AddLogicalDeviceName(CGXDLMSObjectCollection&, long unsigned int)’:
src/GXDLMSBase.cpp:346:33: warning: format ‘%d’ expects argument of type ‘int’, but argument 3 has type ‘long unsigned int’ [-Wformat=]
sprintf(buff, "GRX%.13d", sn);
^
src/GXDLMSBase.cpp: In function ‘void AddElectricityID1(CGXDLMSObjectCollection&, long unsigned int)’:
src/GXDLMSBase.cpp:377:33: warning: format ‘%d’ expects argument of type ‘int’, but argument 3 has type ‘long unsigned int’ [-Wformat=]
sprintf(buff, "GRX%.13d", sn);
^
Compiled src/GXDLMSBase.cpp successfully!
Compiled src/main.cpp successfully!
/usr/bin/ld: cannot find -lgurux_dlms_cpp
collect2: error: ld returned 1 exit status
makefile:27: recipe for target 'bin/gurux.dlms.server.bin' failed
make: *** [bin/gurux.dlms.server.bin] Error 1
--------------------------------------------------------------------------------------
can you kindly guide me through

thanks in advance

Profile picture for user hassin Ayaz

hassin Ayaz

8 years 3 months ago

Linker Error in linux build environment C++ server code

Hello Mr Kurumi

I have solved the problem ,
I went back and build the development project first , then resumed the server example build , and this time linker found it

Thanks

Profile picture for user Kurumi

Kurumi

8 years 3 months ago

Linker Error in linux build environment C++ server code

Hello Hassin,

I'm glad to hear that you solve your problem.

Original problem was that you don't have bin folder.

BR,
Mikko

Profile picture for user hassin Ayaz

hassin Ayaz

8 years 3 months ago

Linker Error in linux build environment C++ server code

Hello Mr Kurumi

thanks for your reply
yes i had to make bin, obj and lib directories , before compilation .

by the way i have a question : is the gurux dlms C component open source ? i tried to find it but could not found any resources , only was able to find the documentation

it would be great if you kindly answer

Thank you & best regards
Hassin Ayaz

Profile picture for user Kurumi

Kurumi

8 years 3 months ago

Linker Error in linux build environment C++ server code

Hello Mr. Hassin Ayaz,

ANSI C is not open source at the moment.

BR,

Mikko

Profile picture for user hassin Ayaz

hassin Ayaz

8 years 3 months ago

Linker Error in linux build environment C++ server code

Hello Mr Kurumi

Thanks a lot for your reply

BR
hassin ayaz

  • 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