Skip to content

building with clang 15 on OSX #609

@jkhoogland

Description

@jkhoogland

Hi,
I use javacpp to build a java wrapper around a c++ library.
With the standard apple clang everything builds fine.

When I tried building using clang 15.0 on OSX, it fails out with the following message:

jnilibrary.cpp:66:29: error: 'TARGET_OS_IPHONE' is not defined, evaluates to 0 [-Werror,-Wundef-prefix=TARGET_OS_]
#if defined(__ANDROID__) || TARGET_OS_IPHONE
                            ^
1 error generated.

I tried to insert a line in the preset file to define TARGET_OS_IPHONE but that did not help.

define = {
    "TARGET_OS_IPHONE 0"
    },

There is some SO answer which suggests to include

#include <TargetConditionals.h>

but I am not sure where I would put that as this seems something deep inside the javacpp magic.

Did anybody hit this problem and find a fix ?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions