开发者

Linking Objective-C project on Windows

开发者 https://www.devze.com 2023-02-10 00:58 出处:网络
i have compiled t开发者_高级运维wo classes (Etudiant.m) and (main.m) and i obtain successufully the two .o files (Etudiant.o) and (main.o).

i have compiled t开发者_高级运维wo classes (Etudiant.m) and (main.m) and i obtain successufully the two .o files (Etudiant.o) and (main.o). However when linking with this command :

gcc -c -o prog -Wno-import Etudiant.o main.o -lobjc

i got this :

gcc.exe : Etudiant.o : linker input file unused because linking not done

gcc.exe : main.o : linker input file unused because linking not done

can anybody help me to find out how to solve linking issues ?? THX in advance.


Don't use -c. That tells the gcc frontend not to perform the linking. So, instead of

 gcc -c -o prog -Wno-import Etudiant.o main.o -lobjc

just do

 gcc -o prog -Wno-import Etudiant.o main.o -lobjc
0

精彩评论

暂无评论...
验证码 换一张
取 消