I think i'm walk arround the problem and didn't find it

Code: Select all
#TESTDLL = 0
CompilerIf #TESTDLL = 1
  ; Real code start here..
  ;
  Global TestReport.s
  
  ProcedureCDLL.s Testcall(Test.s)
    
    TestReport = "Test Report"
    ProcedureReturn TestReport.s
  EndProcedure
CompilerElse
  
  PrototypeC.s Test_dll(test.s)
  
  OpenLibrary(0, "PureBasic.so")
  Define.Test_dll Testtodll = GetFunction(0, "Testcall")
  Response.s = Testtodll("Das ist Original")
  NewString.s = PeekS(@Response,-1,#PB_Ascii)
  MessageRequester("Info", "As Var:"+ Response)
  MessageRequester("Info", "Direct function:" + Testtodll("Das ist Original"))
    
CompilerEndIf
Once Compiled with #TESTDLL = 1 to a .so and executed with #TESTDLL=0 (PB 6.01LTS on Linux x64) Both ASM and C Backend
 
 Greeting



 Now a external library can be configured
 Now a external library can be configured  