libimobiledevice / libplist

A library to handle Apple Property List format in binary or XML
https://libimobiledevice.org
GNU Lesser General Public License v2.1
532 stars 304 forks source link

create module xcode not found cstddef #191

Closed zhuamaodeyu closed 2 years ago

zhuamaodeyu commented 3 years ago

I am creating a private swift pods lib,incloud libplist, I need to initialize libplist as a module, but i create modulemap file, is not work,

error: 'cstddef' file not found

Steps:

  1. run pod lib create XXX, swift version.

  2. build libplist to static library

  3. copy static library to pod

  4. create module.modulemap.

    module libplist  [system] {
    header "plist/plist++.h"
    export *
    }
  5. build example

result. failed: 'cstddef' file not found

Schlaubischlump commented 2 years ago

Take a look at my profile. I made a swift wrapper for libplist. Its called CPlist. I do not plan to maintain it, but you can fork it. Your problem is, that you must not include C++ header files in your swift module. Swift only supports plain C. That means, symlink plist.h to the include folder of the swift module and ignore all other headers. Only compile the C files, not the C++ files.

@nikias I think you can close this issue.

nikias commented 2 years ago

@zhuamaodeyu see @Schlaubischlump's response.