第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號(hào)安全,請(qǐng)及時(shí)綁定郵箱和手機(jī)立即綁定
已解決430363個(gè)問(wèn)題,去搜搜看,總會(huì)有你想問(wèn)的

使用 cgo 包裝 <dispatch/dispatch.h> 時(shí)構(gòu)建錯(cuò)誤

使用 cgo 包裝 <dispatch/dispatch.h> 時(shí)構(gòu)建錯(cuò)誤

Go
達(dá)令說(shuō) 2021-06-17 22:21:06
我正在嘗試使用 XPC、GCD 并繼續(xù)運(yùn)行,但是當(dāng)我的代碼無(wú)法編譯時(shí)出現(xiàn)以下錯(cuò)誤消息(我不明白),我很快就遇到了問(wèn)題:main(__DATA/__const): unexpected reloc for dynamic symbol _NSConcreteGlobalBlock main(__DATA/__const): unhandled relocation for _NSConcreteGlobalBlock (type 28 rtype 120)我正在使用go build以下代碼進(jìn)行編譯:main.gopackage main/*#include <xpc/xpc.h>#include "wrapper.h"*/import "C"import (    "fmt")//export HandleXPCEventfunc HandleXPCEvent(event C.xpc_object_t) {    fmt.Println("Event was handled")}func main() {    name := C.CString("com.example.xpc")    queue := C.dispatch_queue_create(name, nil)    conn := C.xpc_connection_create(name, queue)    C.set_event_handler(conn)    //C.xpc_connection_resume(conn)}包裝器.h#ifndef _WRAPPER_H_#define _WRAPPER_H_#include <stdlib.h>#include <stdio.h>#include <xpc/xpc.h>xpc_connection_t connect( char* name);void set_event_handler(xpc_connection_t connection);#endif包裝器#include "wrapper.h"#include <dispatch/dispatch.h>extern void HandleXPCEvent(xpc_object_t);xpc_connection_t connect( char* name) {    dispatch_queue_t queue = dispatch_queue_create(name,0);    return xpc_connection_create(name,queue);}void set_event_handler(xpc_connection_t connection) {    xpc_connection_set_event_handler(connection, ^(xpc_object_t event) {        xpc_retain(event);        // Call Go function        HandleXPCEvent(event);    });}我是不是做錯(cuò)了什么?這是某種 go 錯(cuò)誤還是如何修復(fù)?
查看完整描述

2 回答

  • 2 回答
  • 0 關(guān)注
  • 277 瀏覽
慕課專欄
更多

添加回答

舉報(bào)

0/150
提交
取消
微信客服

購(gòu)課補(bǔ)貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動(dòng)學(xué)習(xí)伙伴

公眾號(hào)

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號(hào)