1

I am facing undefined reference issue while creating executable.

Error:

../build/kl/Release/test/maker/guibase.o: In function `decodeAddrList':
tree234.c:(.text+0xc): undefined reference to `ptritclStubsPtr'
tree234.c:(.text+0x20): undefined reference to `ptritclStubsPtr'
tree234.c:(.text+0x12c): undefined reference to `ptritclStubsPtr'
tree234.c:(.text+0x140): undefined reference to `ptritclStubsPtr'

Build Command:-

pkgs/gcc/v4.8.3/bin/gcc -L/usr/X11R6/lib -O2 -DUSE_FLEX -Wall -Wno-char-subscripts -fPIC -DLINUX -DG_DISABLE_CONST_RETURNS -fno-strict-aliasing -o ../build/kl/Release/test/bin/pure.exe -L../build/kl/Release/test/modules ../build/kl/Release/test/maker/constrfunc.TCL.o ../../build/kl/Release/test/maker/pvdbprocs.TCL.o .. ../build/kl/Release/test/maker/maker/memmaker.TCL.o .. ../build/kl/Release/test/maker/modules/libdenbase.a .. ../build/kl/Release/test/maker/guibase.o  -lcdnviptcl8.4 -ldenbase -lglib-2.0 -ldenbase -lX11 -ldl -lm -lviputil -lvippli -lcdsCommonMT_sh -lpthread  -L/home/dlb/extlibs/arm/lib 

I have that symbol defined in the library 'libcdnviptcl8.4' at path '/home/dlb/extlibs/arm/lib' . But still facing the same issue.

Symbol :- readelf -s libcdnviptcl8.4.so | grep ptritclStubsPtr

 636: 00000000000d8068     8 OBJECT  GLOBAL DEFAULT   24 itclStubsPtr
1240: 00000000000d8068     8 OBJECT  GLOBAL DEFAULT   24 ptritclStubsPtr

Am I missing some thing here? Please help

Quote from comment by OP:
"Due to some privacy issues...I am renaming the symbols.. It was edited by me... It was typo...I just corrected it...:)"
I.e. the identifiers in the error message and the grep line and the output of the grep line have been manually altered.

Yunnosch
  • 26,130
  • 9
  • 42
  • 54
  • Looks like the symbol isn't defined? Pay attention to the name. ptrtcl vs ptr***li***tcl – user253751 May 22 '18 at 05:27
  • @immibis, I am sorry just corrected the question. It is 'prtitclStubsPtr' – Harish Tadikamalla May 22 '18 at 05:36
  • @SantoshA, it was posted by me only yesterday... I did not get the answer for that... So, I raised new question. – Harish Tadikamalla May 22 '18 at 05:39
  • @jerry Well my comment still applies. The compiler is looking for ptr**li**tcl... and you only have ptr**i**tcl... – user253751 May 22 '18 at 05:44
  • Could you write your grep line by copying the symbol which the compiler explains about, instead of looking for the symbol you know is in the lib? Looks like you made that mistake twice now. – Yunnosch May 22 '18 at 05:47
  • readelf -s libcdnviptcl8.4.so | grep ptritclStubsPtr 1240: 00000000000d8068 8 OBJECT GLOBAL DEFAULT 24 ptritclStubsPtr – Harish Tadikamalla May 22 '18 at 05:50
  • Are other symbols from the same lib available and correctly linked? – Yunnosch May 22 '18 at 05:50
  • Please add to your question the info from your comment on my deleted answer, it is quite relevant for understanding your question. – Yunnosch May 22 '18 at 05:51
  • 1
    To avoid the privacy issues but support helping you, could you rename the identifiers in the actual code, build again and then show the result? Editing the outputs in the StackOverflow editor introduces too many variables. It makes debugging hard. By edting according to your understanding, you suffer the risk of unintentionally hiding the details which you yourself do not spot in the original. (And you were already caught by that trap twice.) – Yunnosch May 22 '18 at 05:52
  • Could you rename the identifiers in the actual code??? means you want to rename the identifiers in source code of that libraries ? Unfortunately we don't have source for those libraries. – Harish Tadikamalla May 22 '18 at 05:56
  • Ok, in that case you should dance very carefully in the minefield... ;-) Double and triple check all the edits you make.... – Yunnosch May 22 '18 at 05:57
  • Actually, you should go back to https://stackoverflow.com/questions/50445789/undefined-reference-to-function-issue-even-after-linking-the-library-which-has Edit that question to give more information. – Yunnosch May 22 '18 at 06:02
  • Yunnosh, is there any chance of getting this issue...if we compile the code with one versioned header files and library which we included is of different version. I.e tree234.c is compiled by including header files from version xxx say libcdnvip4.3.so & while creating some executable we are using libcdnvip8.4.so – Harish Tadikamalla May 22 '18 at 06:51
  • @jerry can you just use the copy-paste command to share information here. Every single time you post a comment, it is with a new spelling of `ptrctl...`. Same was the case in the previous question too. Also this question has been closed because it is an exact duplicate of the previous one. No, you cannot create a duplicate just because you didn't get a satisfying answer on the previous one. Edit that question to provide the necessary information. – Ajay Brahmakshatriya May 22 '18 at 08:21
  • And if you are editing the commands for privacy concerns and are sure you are editing it consistently, can you rename the function to something simple like `foo`? The last time in your question you had mentioned the binary as `libitcl.so`. This time it is `libcdnviptcl8.4.so`. Are you sure what you are doing? – Ajay Brahmakshatriya May 22 '18 at 08:24
  • on my Last question symbol was pointed as 'LOCAL' in that library. So it didn't work...Now I found the library 'libcdnviptcl8.4' which has the symbol 'GLOBAL' and still facing the issue. – Harish Tadikamalla May 22 '18 at 08:29

0 Answers0