gpt4 book ai didi

Objective-C 和 C

转载 作者:行者123 更新时间:2023-11-30 18:08:18 25 4
gpt4 key购买 nike

我尝试使用“libmsrp”,但是当我尝试编译该库时,出现以下错误:

$ make so
gcc -ggdb -shared -Wl,-soname,libmsrp.so.0 -o libmsrp.so.0.0.2 msrp.o msrp_session.o msrp_message.o msrp_relay.o msrp_switch.o msrp_callback.o msrp_network.o msrp_utils.o -Wall -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -lpthread
ld: unknown option: -soname
collect2: ld returned 1 exit status
make: *** [so] Error 1

因此,我将 -soname 选项更改为 -dylib_install_name -Wl。编译后出现以下错误:

$ make so
gcc -ggdb -shared -Wl,-dylib_install_name -Wl,libmsrp.dylib.0.0.2 -o libmsrp.dylib.0.0.2 msrp.o msrp_session.o msrp_message.o msrp_relay.o msrp_switch.o msrp_callback.o msrp_network.o msrp_utils.o -Wall -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -lpthread <p>
Undefined symbols:<p>
"_main", referenced from:
start in crt1.10.5.o
ld: symbol(s) not found
collect2: ld returned 1 exit status
make: *** [so] Error 1

所以,我尝试在 Objective-C 项目中进行编译。我添加源文件和头文件并编译项目。

我收到以下错误:

command: MSRP_LIST_FREE(sessions, sessions_lock);

msrp.c:75: error: expected ';' before 'temp'
msrp.c:75: error: 'temp' undeclared (first use in this function)
msrp.c:75: error: 'next' undeclared (first use in this function)
msrp.c:75: error: expected ';' before 'temp'
msrp.c:75: error: 'previous' undeclared (first use in this function)

声明:

#define MSRP_LIST_FREE(list, lock
if(!(list))
return 0;
else {
typeof((list)) temp = list, next = NULL;
while(temp) {
next = temp->next;
MSRP_LIST_REMOVE((list), (lock), temp);
temp = next
}
}

有什么想法吗?

最佳答案

makefile 可能会处理一些在您从源代码进行编译时未设置的定义。你应该继续与 make 斗争以使其编译;)也许,您应该尝试使用 gmake 而不是 make。

关于Objective-C 和 C,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3554574/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com