在AndeSight的project裡如果要加入.o檔一起compile,
可以用下面的方法。
下圖中,我們有一個.o檔要一起編譯。
Attachment:
p1.gif [ 4.63 KiB | Viewed 7079 times ]
下面是相對路徑的寫法,加在linker選項裡,
建議用這種寫法,具有可攜性,到其他user的電腦裡直接import就可以使用。
路徑的寫法是相對於makefile的位置。
Attachment:
p3.gif [ 14.78 KiB | Viewed 7079 times ]
這是另一種寫法,採用絕對路徑。
注意,這是cygwin的path。
Attachment:
p2.gif [ 22.16 KiB | Viewed 7079 times ]
下面是example code
Attachment:
Hello1.zip [39.7 KiB]
Downloaded 708 times
我們建議將.o檔編譯static library。
可參考下面的pdf檔。
Attachment:
靜態函式庫建立與使用.pdf [915.63 KiB]
Downloaded 849 times