Author Topic: Dynamic shared DLL library Interface simple.cpp for MacOSX sample  (Read 729 times)

Tommy6502

  • Community Member
  • Posts: 15
  • Hero Points: 2
I would like to create an extension shared library on MacOSX.  I found the simple.cpp file in the samples directory.

When I try to build it using this command, I received unresolved external symbols:

clang++ -fPIC -I/Applications/SlickEditPro2016.app/Contents/h simple.o -dynamiclib -o libsimple.so
Undefined symbols for architecture x86_64:
  "_vsDeleteLine", referenced from:
      _dllcommand in simple.o
  "_vsDllExport", referenced from:
      _vsDllInit in simple.o
  "_vsExecute", referenced from:
      _dllcommand in simple.o
  "_vsInsertLine", referenced from:
      _dllcommand in simple.o
  "_vsMessageBox", referenced from:
      _dllcommand in simple.o
  "_vsPropSetI64", referenced from:
      _dllcommand in simple.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

I know the symbols are in the vs binary.  How do I tell the linker to link to it? Is there a SlickEdit library I need to link with? Does anyone have a working makefile for MacOS that will successfully build the shared extension library interface to SlickEdit?

Is this known to work on MacOSX?

Thank you.

Tommy6502

  • Community Member
  • Posts: 15
  • Hero Points: 2
Re: Dynamic shared DLL library Interface simple.cpp for MacOSX sample
« Reply #1 on: February 08, 2017, 05:28:46 pm »
I am able to build it using this command:

gcc -bundle simple.o -o simple -bundle_loader /Applications/SlickEditPro2016.app/Contents/MacOS/vs

It successfully builds the bundle binary file simple:

# file simple
simple: Mach-O 64-bit bundle x86_64

How do I load it into SlickEdit?


patrick

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 767
  • Hero Points: 39
Re: Dynamic shared DLL library Interface simple.cpp for MacOSX sample
« Reply #2 on: February 09, 2017, 05:27:25 pm »
Sorry in the delay in answering this, I started to look into it, and then fell down a rabbit hole.

The dload command is used to load extension DLL's, but it is not implemented for Unix & MacOS.  I do not know yet why that sample has *nix makefiles, that's probably a mistake.

Clark

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 3827
  • Hero Points: 250
Re: Dynamic shared DLL library Interface simple.cpp for MacOSX sample
« Reply #3 on: February 10, 2017, 02:39:51 am »
Like Patrick said, the DLL interface is currently only supported on windows.

What feature are you trying to add?

Tommy6502

  • Community Member
  • Posts: 15
  • Hero Points: 2
Re: Dynamic shared DLL library Interface simple.cpp for MacOSX sample
« Reply #4 on: February 14, 2017, 01:34:10 am »
Thank you for the response.  After learning more about SlickC, I actually figured out how to implement it with SlickC.