[Vm-dev] Accessing ux2sqPath and sq2uxPath

Alistair Grant akgrant0710 at gmail.com
Wed Aug 15 19:30:03 UTC 2018

Hi Everyone,

So that path names are encoded correctly on MacOS, the
FileAttributesPlugin needs to use ux2sqPath() and sq2uxPath().

On linux this "just works".  If I've read the build log correctly the
functions are included in vm.a, which is included when linking external

However I'm not able to get the symbols resolved on MacOS.

The routines are defined in:

platforms/Mac OS/plugins/FilePlugin/sqMacUnixFileInterface.c

declared in:

platforms/Mac OS/plugins/FilePlugin/sqMacUnixFileInterface.h

and are accessed in:

platforms/Mac OS/vm/sqMacNSPluginUILogic2.c
platforms/Mac OS/vm/sqMacImageIO.c
platforms/Mac OS/vm/sqMacMain.c

The following lines in build.macos64x64/common/Makefile.vm
look like they provide the required magic:

PluginIncludes := FilePlugin HostWindowPlugin SoundPlugin
OSPluginIncludes := FilePlugin HostWindowPlugin SoundPlugin

I attempted to create a plugin makefile:

platforms/Mac OS/plugins/FileAttributesPlugin/Makefile.plugin:
# FileAttributesPlugin uses sq2uxPath() and ux2sqPath(), provided by FilePlugin
include ../common/Makefile.plugin
PluginIncludes += FilePlugin

however this still results in:

Undefined symbols for architecture x86_64:

  "_sq2uxPath", referenced from:

      _squeakPathtoUnixmaxLen in FileAttributesPlugin.lib(FileAttributesPlugin.o)

  "_ux2sqPath", referenced from:

      _primitiveReaddir in FileAttributesPlugin.lib(FileAttributesPlugin.o)

ld: symbol(s) not found for architecture x86_64

clang: error: linker command failed with exit code 1 (use -v to see invocation)

make: *** [build/vm/Squeak] Error 1

The full source is available at:

Any suggestions?

Thanks very much,

More information about the Vm-dev mailing list