/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
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
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 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
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
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
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
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
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
Linker Error in linux build environment C++ server code
Hello Mr. Hassin Ayaz,
ANSI C is not open source at the moment.
BR,
Mikko
Linker Error in linux build environment C++ server code
Hello Mr Kurumi
Thanks a lot for your reply
BR
hassin ayaz