[PB 6.11 LTS] Linker error / undefined symbol

Just starting out? Need help? Post your questions and find answers here.
User avatar
FS-1281
New User
New User
Posts: 5
Joined: Mon Jul 22, 2024 5:51 am

[PB 6.11 LTS] Linker error / undefined symbol

Post 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”
User avatar
Bisonte
Addict
Addict
Posts: 1305
Joined: Tue Oct 09, 2007 2:15 am

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

Post by Bisonte »

that looks like an outdated userlibrary....
PureBasic 6.21 (Windows x64) | Windows 11 Pro | AsRock B850 Steel Legend Wifi | R7 9800x3D | 64GB RAM | RTX 5080 | ThermaltakeView 270 TG ARGB | build by vannicom​​
English is not my native language... (I often use DeepL.)
User avatar
FS-1281
New User
New User
Posts: 5
Joined: Mon Jul 22, 2024 5:51 am

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

Post 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

Fred
Administrator
Administrator
Posts: 18161
Joined: Fri May 17, 2002 4:39 pm
Location: France
Contact:

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

Post 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.
User avatar
FS-1281
New User
New User
Posts: 5
Joined: Mon Jul 22, 2024 5:51 am

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

Post 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)
Fred
Administrator
Administrator
Posts: 18161
Joined: Fri May 17, 2002 4:39 pm
Location: France
Contact:

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

Post 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)
Post Reply