Quantcast
Channel: 睿论坛 - 最新话题
Viewing all articles
Browse latest Browse all 5739

提问,关于如何启动一个App的问题

$
0
0

@xiongzhend wrote:

大家好,

小弟最近遇到一个需要从外部启动自己App的问题,搜索了论坛发现可以使用dlopen来做,代码如下:

int (*openApp)(CFStringRef, Boolean);
void *hndl = dlopen("/System/Library/PrivateFrameworks/SpringBoardServices.framework/SpringBoardServices", RTLD_LAZY);
openApp = (int(*)(CFStringRef, Boolean)) dlsym(hndl, "SBSLaunchApplicationWithIdentifier");
openApp(CFSTR("com.xxxxx.xxxxx"), FALSE);
dlclose(hndl);

编译报main.mm:9:112: error: use of undeclared identifier 'RTLD_LAZY',于是我就导入了头文件

#include <dlfcn.h>

结果又报Unsupported architecture

我尝试了7.1 、 8.4 、9.2三种SDK,都是报这个错误,求大家指点一下??

Posts: 8

Participants: 2

Read full topic


Viewing all articles
Browse latest Browse all 5739

Latest Images

Trending Articles



Latest Images