Skip to content

it show "mach-o, but wrong architecture " when try to run demos/button.js 【macOs M1 arm64】 #9

@fanzhiri

Description

@fanzhiri

我先修改了awtk/awtk_config.py中TARGET_ARCH

if is32bit:
if MACH == 'i686' or MACH == 'i386' or MACH == 'x86':
TARGET_ARCH='x86'
else:
TARGET_ARCH='arm'
else:
TARGET_ARCH='' 这一句改为如下
TARGET_ARCH='arm64'

编译好awtk再去编译awtk-nodejs
然后想运行demo,就看到如下错误了

fanzhiri@fanzhirideAir awtk-nodejs % node demos/button.js
/Users/fanzhiri/GitHub/awtk-nodejs/node_modules/bindings/bindings.js:121
throw e;
^
Error: dlopen(/Users/fanzhiri/GitHub/awtk-nodejs/build/Release/awtk.node, 1): no suitable image found. Did find:
/Users/fanzhiri/GitHub/awtk-nodejs/build/Release/awtk.node: mach-o, but wrong architecture
/Users/fanzhiri/GitHub/awtk-nodejs/build/Release/awtk.node: mach-o, but wrong architecture
at Object.Module._extensions..node (internal/modules/cjs/loader.js:1122:18)
at Module.load (internal/modules/cjs/loader.js:928:32)
at Function.Module._load (internal/modules/cjs/loader.js:769:14)
at Module.require (internal/modules/cjs/loader.js:952:19)
at require (internal/modules/cjs/helpers.js:88:18)
at bindings (/Users/fanzhiri/GitHub/awtk-nodejs/node_modules/bindings/bindings.js:112:48)
at Object. (/Users/fanzhiri/GitHub/awtk-nodejs/awtk.js:1:31)
at Module._compile (internal/modules/cjs/loader.js:1063:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1092:10)
at Module.load (internal/modules/cjs/loader.js:928:32)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions