Page 1 of 1

[PB 6.11 LTS] Linker error / undefined symbol

Posted: Mon Jul 22, 2024 6:42 am
by FS-1281
With the new version (change from 6.03 LTS to 6.11 LTS) I get an error dialog when compiling the exe
("Compile/Run" without the Option "Enable Debugger")

Strangely enough, the application runs with “Compile/Run” in debugging mode (Enable Debugger) without an error message
PureBasic - Linker error

error: undefined symbol:
_PB_DEBUGGER_SendTranslatedError@8
>>> referenced by
Gadget.lib(Gadget_DEBUG_COMMON_obj):(_IsCurrentObject)
>>>> referenced by
Gadget.lib(Gadget_DEBUG_COMMON_obj):(_CheckGadgetSize)
>>>> referenced by
Gadget.lib(Gadget_DEBUG_COMMON_obj):(_CheckGadgetSize)
>>>> referenced 3 more times

lld-ling: error: undefined symbol:
_PB_DEBUGGER_SendTranslatedErrorFucntion@12
...
I can't make much sense of the error message, except that it is probably related to a gadget.
Have any changes been made to the gadget functions that could indicate the error?

I have now tested it with version 6.04 LTS and it still compiles without problems, whether with or without “Debug Enabled”

Re: [PB 6.11 LTS] Linker error / undefined symbol

Posted: Mon Jul 22, 2024 6:53 am
by Bisonte
that looks like an outdated userlibrary....

Re: [PB 6.11 LTS] Linker error / undefined symbol

Posted: Mon Jul 22, 2024 7:05 am
by FS-1281
I don't actually use UserLibs.
I have already completely reinstalled Purebasic without success.


I only use a few C functions

Code: Select all

ImportC ""
   fopen(fname.p-ascii,fmode.p-ascii)
   fclose(c_stream.l)
   fread(*buf,size.l,count.l,c_stream.l)
   fwrite(*buf,size.l,count.l,c_stream.l)
;  fflush(c_stream.l)
   fseek(c_stream.l,offset.l,origin.l)
   ftell(c_stream.l)
   feof(c_stream.l)
   fgetc(c_stream.l)
   fgetsA(*str,num.l,c_stream.l) As "_fgets"
   fputs(str.p-ascii,c_stream.l) As "_fputs"
   fputc(ascii.a,c_stream.l)
;  ungetc(char.l,c_stream.l)
   ferror(c_stream.l)
   _fileno(c_stream.l)
   _fstat(c_stream.l , *buf)
   ;fprintf(c_stream.l, Format.p-ascii, Param1 = #Null, Param2 = #Null, Param3 = #Null, Param4 = #Null, Param5 = #Null, Param6 = #Null, Param7 = #Null) As "_fprintf"
   sscanf(str$,format$,*result1 ,*result2 = #Null,*result3 = #Null,*result4 = #Null,*result5 = #Null) As "_swscanf"
   sprintf(*Dest , Format$, value1 = #Null, value2 = #Null, value3 = #Null, value4 = #Null, value5 = #Null, value6 = #Null) As "_swprintf"
   ;strncpy(lpDestination.p-ascii, lpSource.p-ascii, lNum)
   wcsncpy(lpDestination, lpSource, lNum)
   _getpid()
   ;_chdir(dir$)
   _access(filename.p-ascii, amode.i) As "__access"
   _iob_func() As "__iob"
   ;strchr(lpStr, ascii.a)
   setlocale (category, locale$) As "__wsetlocale"
   _wcsupr(*szString)
   ;atoi(*szString.p-scii)
   ;atof.f(*szString)
   strlenA(*str.p-ascii) As "_strlen" 
   wcschr(lpStr, Char.c)
   wcsstr(*str, *strSarch)
 EndImport


Re: [PB 6.11 LTS] Linker error / undefined symbol

Posted: Mon Jul 22, 2024 7:14 am
by Fred
You can try to comment all these to see if it has an impact. Without reproducing code it won't be possible for us to fix it.

Re: [PB 6.11 LTS] Linker error / undefined symbol

Posted: Mon Jul 22, 2024 8:32 am
by FS-1281
I have been able to identify the problem.

It is caused by the ImportC function. sprintf

changed

Code: Select all

...

  ImportC ""
  ....
   sprintf(*Dest , Format$, value1 = #Null, value2 = #Null, value3 = #Null, value4 = #Null, value5 = #Null, value6 = #Null) As "_sprintf"
 EndImport
 
 ....
to

Code: Select all

...

  ImportC ""
  ....
   sprintf(*Dest , Format$, value1 = #Null, value2 = #Null, value3 = #Null, value4 = #Null, value5 = #Null, value6 = #Null) As "_swprintf"
 EndImport
 
 ....
and it works.

(I must have overlooked that when I changed to Unicod)

Re: [PB 6.11 LTS] Linker error / undefined symbol

Posted: Mon Jul 22, 2024 9:24 am
by Fred
The CRT has been changed with 6.10, that's why you got this issue (the linker error isn't very helpful though)