作者ChampYen (网路黑猫)
看板C_and_CPP
标题Re: [问题] Cygwin下用GCC编译的static library 如 …
时间Wed Feb 18 12:39:01 2009
※ 引述《ChampYen (网路黑猫)》之铭言:
: ※ 引述《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.
问了一下原PO, 会想要这麽做的原因是要使用FFMpeg
那麽可以不用Cygwin, 使用MinGW
http://www.mingw.org
这里有相关的说明
http://www.salyens.com/mingw/
对於MSVC使用MinGW compiled DLL
http://www.geocities.com/yongweiwu/dllfaq.htm
http://www.nabble.com/Link-against-a-MSVC-object-file-library-td18837721.html
(说明在MinGW的FAQ上, 目前似乎由於sourceforge缘故, 无法看到)
Updated
只是要使用可以考虑ffdshow
http://sourceforge.net/projects/ffdshow-tryout/
http://www.codecs.com/download/FFDShow.htm
--
※ 发信站: 批踢踢实业坊(ptt.cc)
◆ From: 122.116.236.53
1F:→ ChampYen:如果只是要用, 还可以找ffmpeg directshow相关资源 02/18 12:49
※ 编辑: ChampYen 来自: 122.116.236.53 (02/18 12:54)