开发者

Can't Include winhttp.h (with code::blocks/mingw) c++

I've been trying to include winhttp.h and I get this error:

Winhttp.h: No such file or directory

Mingw doesn't have it, how would I开发者_JAVA百科 add it?


You can use runtime dynamic linking to link to the function(s) you want directly. You can't use the plain winhttp.h that ships with the Windows SDK because it contains Microsoft-specific features. You could also compile with Visual C++ 2010 Express Edition which would include the header you want.

Hope that helps :)


I have copied the header from windows and it worked fine with the following addition:

#define __in
#define __out
#define __out_bcount(x)
#define __in_ecount(x)
#define __inout
#define __out_ecount_full_opt(x)
#define __in_opt
#define __out_data_source(x)
#include <winhttp.h>

hope this helps.


  1. GET: https://dev.eclipse.org/svnroot/technology/org.eclipse.higgins/trunk/app/org.eclipse.higgins.tcpserver/src/Third-party/VS2008/winhttp.h
  2. dlltool -z winhttp.def --export-all-symbol winhttp.dll
  3. dlltool -k -d winhttp.def -l libwinhttp.a
  4. Link against the libwinhttp.a you just generated.
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜