我正在使用Fedora(laughlin)。我在这个发行版中用c和java编写了很多程序。 所以我决定在linux中尝试一些Objective-C编程。我在互联网上搜索了很多页面,最终找到了一个。objective-c编译错误
http://www.techotopia.com/index.php/Building_and_Installing_GNUstep_on_Linux
我就按照这个网页上给出的安装GNUstep
的说明。
安装过程中一切顺利。但写一个小块的代码,并使用命令编译之后:
gcc gnustep-config --objc-flags` -L/usr/GNUstep/System/Library/Libraries -lgnustep-base hello.m -o hello
它给了我下面的错误:
/usr/bin/ld: /usr/GNUstep/System/Library/Libraries/libgnustep-base.so: undefined reference to symbol 'objc_msg_lookup' /usr/bin/ld: note: 'objc_msg_lookup' is defined in DSO /usr/lib/libobjc.so.2 so try adding it to the linker command line /usr/lib/libobjc.so.2: could not read symbols: Invalid operation collect2: ld returned 1 exit status
我是新来的Objective-C。我不知道链接器命令存在的位置。我尝试将/usr/lib
添加到env.
变量中。但它没有解决。 我也试图找出他们的论坛上的解决方案(如果他们有一个!)。但他们没有。
任何人都可以帮助我吗?
在此先感谢!
谢谢,我真是个傻瓜!那太简单了!我认为有些文件丢失了。非常感谢! – AnnGM 2012-08-01 19:51:25