私はubuntu用のObjectiveCコンパイラをインストールしたかった。
このサイトは、ubuntuにGNUstepをインストールするために使用されました。
http://www.techotopia.com/index.php/Installing_and_Using_GNUstep_and_Objective-C_on_Linux
その後、コマンドはターミナルで次の順序で記述されました-
sudo apt-get install gnustep
sudo apt-get install gnustep-devel
次に、サンプルコードを作成し、hello.mとして保存しました。
#import <Foundation/Foundation.h>
int main (int argc, const char * argv[])
{
NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];
NSLog (@"hello world");
[pool drain];
return 0;
}
次に、ターミナルに入力しました
. /usr/share/GNUstep/Makefiles/GNUstep.
gcc `gnustep-config --objc-flags` -lgnustep-base hello.m -o hello
次に、エラーメッセージが表示されました
gcc: gnustep-config --objc-flags: No such file or directory
hello.m:1:23: fatal error: Foundation.h: No such file or directory
compilation terminated.
その後、私は書いた
sudo apt-get install gobjc
その後、ターミナルは示した
Reading package lists... Done
Building dependency tree
Reading state information... Done
gobjc is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 205 not upgraded.
その後、私は再びコンパイルしましたが、同じエラーが再び表示されました。
hp@ubuntu:~$ gcc 'gnustep-config --objc-flags' -lgnustep-base hello.m -o hello
gcc: gnustep-config --objc-flags: No such file or directory
hello.m:1:23: fatal error: Foundation.h: No such file or directory
compilation terminated.
だから、いくつかの助けが必要です。