作者ChampYen (网路黑猫)
看板C_and_CPP
标题Re: [问题] Cygwin下用GCC编译的static library 如 …
时间Wed Feb 18 12:23:44 2009
※ 引述《tihctw (Howard)》之铭言:
: Hi,
: 我用C写了一个测试用的function, 叫test().然後在Cygwin下用GCC将它编译成 static library 如下.
: gcc -c foo.c -o foo.o
: ar rcs libfoo.a foo.o
: 然後我希望能在 Microsoft Visual Studio 2005 C++ 里面使用这个 test() function.
: 但是compile/link後,都会找不到test(). 我有extern test() 以及加入libfoo.a 到 linker 里.
: 请问一下我要如何才能在Cygwin下使用GCC 编译出一个可以在Visual Studio 里使用的 library?
: 谢谢!!!
: tihctw
For shared library
you can reference to this link.
http://www.cygwin.com/ml/cygwin/2004-06/msg00274.html
Why does the solution look a little complicated?
This question is related to GCC toolchain and Cygwin environment
on Win32 platform.
--
※ 发信站: 批踢踢实业坊(ptt.cc)
◆ From: 122.116.236.53
※ 编辑: ChampYen 来自: 122.116.236.53 (02/18 12:24)