Tag: mingw w64

如何使用Msys2和MinGW在Windows上构建OpenLDAP库?

我正在尝试在Windows上构建OpenLDAP。 我这样做非常困难。 我开始按照这里列出的指示,但很快意识到它已经过时了。 然后我发现了这一点 ,并意识到它也不是很正确。 我终于找到了这个 ,并且经历了这个家伙正在经历的确切错误。 然而,当我尝试他的工作时(在portable.h中评论第1116行)我遇到了更多的问题。 是否有用于构建此库的规范来源? 我正在使用: Windows 7专业版。 Msys2(x86_64 20160205来自这里 ) OpenSSL(版本1.0.1r从这里 ) rxspencer(alpha 3.8.g7 from here ) OpenLDAP(版本2.4.44从这里开始 ) 第0步: 编译rxspencer ./configure make make check make install 步骤1: 使用Visual Studio 2010 x64命令提示符编译OpenSSL perl Configure no-ssl2 VC-WIN64A –prefix=d:\temp\openssl\x64 ./ms/do_win64a.bat nmake -f ms\nt.mak nmake -f ms\ntdll.mak cd out32 ..\ms\test 第2步: 修改路径,以便configure能够看到rxspencer PATH=$PATH:/usr/local/lib […]

为什么isnormal()说值不正常?

#include #include #include #include void PrintBytes( const float value ) { const char* const byte = ( const char* )&value ; for( size_t i = 0 ; i < sizeof( value ) ; i++ ) { printf( "%02hhx" , byte[i] ); } } int main(void) { float value = FLT_MIN; while( 1 ) { printf( […]

对CLSID_MMDeviceEnumerator和IID_IMMDeviceEnumerator的未定义引用

尝试使用COM和CoCreateInstance()在C中使用MinGW-w64编译示例代码失败。 #include #include #include #include #include extern const CLSID CLSID_MMDeviceEnumerator; extern const IID IID_IMMDeviceEnumerator; int main( void ) { CoInitialize( NULL ); LPVOID device = NULL; const HRESULT ok = CoCreateInstance( &CLSID_MMDeviceEnumerator, NULL, CLSCTX_INPROC_SERVER, &IID_IMMDeviceEnumerator, &device ); CoUninitialize(); return EXIT_SUCCESS; } 编译:gcc main.c libole32.a -Wall -Wextra -oa 即使在mmdeviceapi.h中定义了CLSID_MMDeviceEnumerator,也找不到它。 实际上从示例代码中删除我的extern定义会得到相同的结果,因为两个externs似乎都在mmdeviceapi.h中定义 当我使用__uuidof并使用g ++编译代码时,但__uuidof的这个C“替换”却没有。 为什么没有找到COM标识符?

在Windows7 Py_InitModule4上使用mingw_x64编译的python_x64 + C库

我正在尝试使用mingw-x64在Windows7(64位)上为python编译C库。 这一切都像32位版本的魅力。 我以前使用gcc -shared -IC编译我的库:\ Python27 \ include -LC:\ Python27 \ libs myModule.c -lpython27 -o myModule.pyd 它适用于32位版本。 相同的过程适用于64位Linux。 但是在64位windows7上(使用64位x86_64-w64-mingw32和64位python 2.7.5)我遇到了一个问题: C:\Users\sergej\AppData\Local\Temp\cci8TbXw.o:myModule.c:(.text+0x267): undefined reference to `__imp_Py_InitModule4′ collect2: ld returned 1 exit status 我检查了C:/Python27/libs/modsupport.h,它已经包含了 #if SIZEOF_SIZE_T != SIZEOF_INT /* On a 64-bit system, rename the Py_InitModule4 so that 2.4 modules cannot get loaded into a 2.5 interpreter […]

如何在Win64上使用Varargs和C中的函数指针一起使用?

考虑以下C程序: #include #include typedef void (callptr)(); static void fixed(void *something, double val) { printf(“%f\n”, val); } static void dynamic(void *something, …) { va_list args; va_start(args, something); double arg = va_arg(args, double); printf(“%f\n”, arg); } int main() { double x = 1337.1337; callptr *dynamic_func = (callptr *) &dynamic; dynamic_func(NULL, x); callptr *fixed_func = (callptr *) &fixed; […]

clang / clang ++在Windows中找不到C / C ++头文件?

1小时前我从http://llvm.org/pre-releases/3.6.0/下载了llvm-3.6.0-rc4-win32.exe。 我试图编译只打印“hello”的简单C代码,但它没有编译,因为clang.exe找不到stdio.h。 当我使用clang-cl.exe和相同的代码时,它工作。 我对clang ++也有同样的问题,即使使用iostream,我在GCC(4.9.1)C ++标题中添加了-I标志,结果如下: C:\Users\One\Desktop>clang++ -I c:\MinGW\x86_64-w64-mingw32\include\c++ main.cpp -lib=libstdc++ In file included from main.cpp:1: c:\MinGW\x86_64-w64-mingw32\include\c++\iostream:38:10: fatal error:’bits/c++config.h’ file not found #include 1 error generated. 有人知道怎么修这个东西吗 ? 编辑:我在MinGW文件夹中找到bits / c ++ config.h我将它添加到-I标志和其他。 我导致链接错误: C:/MinGW/bin/../lib/gcc/x86_64-w64-mingw32/4.9.1/../../../../x86_64-w64-mingw32/ bin/ld.exe: cannot find -lib=libstdc++ C:/MinGW/bin/../lib/gcc/x86_64-w64-mingw32/4.9.1/../../../../x86_64-w64-mingw32/ bin/ld.exe: skipping incompatible C:/MinGW/bin/../lib/gcc/x86_64-w64-mingw32/4.9 .1//libstdc++.dll.a when searching for -lstdc++ C:/MinGW/bin/../lib/gcc/x86_64-w64-mingw32/4.9.1/../../../../x86_64-w64-mingw32/ bin/ld.exe: skipping incompatible C:/MinGW/bin/../lib/gcc/x86_64-w64-mingw32/4.9 .1//libstdc++.a […]