cygwin跨平台移植开发系列3--GCC+VC联合使用

本文介绍了如何在Cygwin环境下使用GCC编译SDK库为DLL,并通过转换为.lib文件在VC中调用接口。在实际应用中遇到崩溃问题,经过研究发现GCC与VC编译的库在同一进程中运行可能引发冲突。通过官方FAQ和进一步的调试,找到了解决方案,实现了GCC编译的DLL与VC编写的应用程序成功兼容。
摘要由CSDN通过智能技术生成

前几天做一个模拟器时要把sdk代码在从linux移植到windows,我当初选用方案使用cygwin,然而却碰到一个crash的问题而搁浅。于是上周发了一个email到cygwin 的maillist,没想到得到cygwin官方的回复,原来faq里早就有了。另外我补充了几点注意的地方,faq还是说的不严谨。

 

Re: gcc and vc compiled library problem

 

On 01/28/2010 08:14 PM, phil song wrote:
> Hi,cygwin!
>      pls forgive my poor english at first.
>
> I have compiled one sdk_lib dll using gcc in cygwin,and I writed a tool
> convert the dll to .lib so I can call the interface function in sdk_lib
> dll using vc. Then I wrote a application using VC2005,when  it ran at
> beginning,everything looks like ok,but when I call a function
> "tti_readfile" which call "open write close" in sdk_lib many times,The
> application exited.By debuging,I find the  it crashed  in function
> "_aclcheck" in "cygwin1.dll".  But I found the file had been write
> success,however,after the app called it,it crashed.
>
> who can tell me what cause this?How to resolve it?Can the dll(compiled by
> gcc) and app(compiled by vc) run in the same process?

<http://cygwin.com/faq/faq-nochunks.html#faq.programming.msvcrt-and-cygwin>
<

评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值