在Debian8

时间:2015-09-07 10:55:37

标签: c linux linker debian

我试图为debian 8重新编译我的软件,但是我遇到了libgssappi这个奇怪的问题,拒绝与任何东西联系。

>~/torque_github$ gcc test.c -lgssapi
/usr/bin/ld: cannot find -lgssapi
collect2: error: ld returned 1 exit status

该库存在于系统中,如下所示:

>~/torque_github$ /sbin/ldconfig -p | grep gssapi
        libgssapi_krb5.so.2 (libc6,x86-64) => /usr/lib/x86_64-linux-gnu/libgssapi_krb5.so.2
        libgssapi.so.3 (libc6,x86-64) => /usr/lib/x86_64-linux-gnu/libgssapi.so.3

1 个答案:

答案 0 :(得分:1)

在我的Debian / Jessie / x86-64系统上,/usr/lib/x86_64-linux-gnu/libgssapi_krb5.so包提供dpkg -S(根据libkrb5-dev),/usr/lib/x86_64-linux-gnu/libgssapi.so.3提供libgssapi3-heimdal libgssapi*dev包(我没有任何sudo aptitude install libkrb5-dev libgssapi3-heimdal包)。

您可能应该安装它们(使用pkg-config命令),并使用krb5-gssapigcc -Wall -g $(pkg-config --cflags krb5-gssapi) \ test.c \ $(pkg-config --libs krb5-gssapi) \ -o myprog 来获取编译和链接标记。

test.c

(如果某些API发生了变化,您可能需要更改#include <krb5/krb5.h>源代码;或许您需要gcc -v

您甚至可以使用gcc代替上面的gcc

请记住,gcc的参数顺序非常重要。您的初始问题有不同的顺序(这足以使-(void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo { NSLog(@"%@",userInfo); NSString *msg=[userInfo objectForKey:@"message"]; //Application is Running if ( application.applicationState == UIApplicationStateActive ){ if ([[userInfo objectForKey:@"id"]isEqualToString:@"1"]) { self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]]; YourViewController *obj = [[YourViewController alloc]initWithNibName:@"YourViewController" bundle:nil]; nav = [[UINavigationController alloc]initWithRootViewController:obj]; [self.nav setNavigationBarHidden:YES]; self.window.rootViewController = nav; [self.window makeKeyAndVisible]; } else if ([[userInfo objectForKey:@"id"]isEqualToString:@"2"]) { self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]]; YourViewController *obj = [[YourViewController alloc]initWithNibName:@"YourViewController" bundle:nil]; nav = [[UINavigationController alloc]initWithRootViewController:obj]; [self.nav setNavigationBarHidden:YES]; self.window.rootViewController = nav; [self.window makeKeyAndVisible]; } } //when Application in Background else{ if ([[userInfo objectForKey:@"id"]isEqualToString:@"1"]) { self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]]; YourViewController *obj = [[YourViewController alloc]initWithNibName:@"YourViewController" bundle:nil]; nav = [[UINavigationController alloc]initWithRootViewController:obj]; [self.nav setNavigationBarHidden:YES]; self.window.rootViewController = nav; [self.window makeKeyAndVisible]; } else if ([[userInfo objectForKey:@"id"]isEqualToString:@"2"]) { self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]]; YourViewController *obj = [[YourViewController alloc]initWithNibName:@"YourViewController" bundle:nil]; nav = [[UINavigationController alloc]initWithRootViewController:obj]; [self.nav setNavigationBarHidden:YES]; self.window.rootViewController = nav; [self.window makeKeyAndVisible]; } } } 失败)!