Page 1 of 1

Linker error

Posted: Thu Apr 18, 2024 6:49 pm
by jassing
Any idea how I can resolve this? I'm compiling a DLL. Nothing too special about it; just a collection of various functions.
Linker wrote:'Linker error
error: Unresolved external symbol 'PB_DEBUGGER_SendTranslatedError' - referenced from 'Thread.lib(Debug.obj)'.
POLINK: error: Unresolved external symbol 'PB_DEBUGGER_SendCommonError' - referenced from 'Thread.lib(Debug.obj)'.
POLINK: error: Unresolved external symbol 'PB_DEBUGGER_SendCommonErrorFunction' - referenced from 'Thread.lib(Debug.obj)'.
POLINK: error: Unresolved external symbol 'PB_DEBUGGER_Thread' - referenced from 'Thread.lib(Debug.obj)'.
POLINK: error: Unresolved external symbol 'PB_DEBUGGER_SendTranslatedWarning' - referenced from 'Thread.lib(Debug.obj)'.
POLINK: error: Unresolved external symbol 'PB_DEBUGGER_CheckProcedure' - referenced from 'Thread.lib(Debug.obj)'.
POLINK: error: Unresolved external symbol 'PB_DEBUGGER_SendCommonWarning' - referenced from 'Thread.lib(Debug.obj)'.
POLINK: error: Unresolved external symbol 'PB_DEBUGGER_RegisterObjectFunctions' - referenced from 'Thread.lib(Debug.obj)'.
POLINK: error: Unresolved external symbol 'PB_DEBUGGER_RegisterLibrary' - referenced from 'Thread.lib(Debug.obj)'.
POLINK: fatal error: 9 unresolved external(s).

Re: Linker error

Posted: Thu Apr 18, 2024 6:55 pm
by infratec
Comment out stuff in your dll sourcecode.

If you reduced it to a minimum with fault, show us the code.

Re: Linker error

Posted: Thu Apr 18, 2024 8:04 pm
by jassing
Calling this function generates the error. Outside of a DLL it works fine.

Code: Select all

    Procedure.s getDatetimeStr() ; higher resolution (milliseconds)
      Protected result.s
      Protected TINFO.SYSTEMTIME, *tinfo.SYSTEMTIME = @TINFO
      Protected *fmtd = Ascii(Space(100))
      GetSystemTime_(TINFO)
      
;>>>> SPECIFICALLY, this line: 
      !sprintf(p_fmtd, "%4d-%02d-%02dT%02d:%02d:%02d.%04dZ",
      !  p_tinfo->f_wyear,
      !  p_tinfo->f_wmonth, 
      !  p_tinfo->f_wday,
      !  p_tinfo->f_whour, 
      !  p_tinfo->f_wminute,
      !  p_tinfo->f_wsecond, 
      !  p_tinfo->f_wmilliseconds );
      
      result = PeekS(*fmtd,-1,#PB_Ascii) 
      FreeMemory(*fmtd) 
      ProcedureReturn result
    EndProcedure
    ;Debug getDatetimeStr()
    

Re: Linker error

Posted: Thu Apr 18, 2024 9:03 pm
by jassing
Seems using C in a dll is problematic...
This line works fine in an exe, but in a DLL; it generates those cryptic linker errors.

Code: Select all

  ! sprintf(p_uptime,"%d:%02d:%02d:%02d.%03d",v_d,v_h,v_m,v_s,v_ms);