mingw-w64

Cross Compiling Python setup

我怕爱的太早我们不能终老 提交于 2020-02-28 21:20:45
问题 I am trying to build GObject-Introspection on Ubuntu 14.04 using Mingw-w64. I am currently running 64bit Linux and trying to build for a 32bit Windows target. My first attempt used Python 2.7.8 installed in Wine, however, this did not work because Python's path separator was set to '\' (well '\') instead of Linux's '/'. Due to this I tried using the Python 2.7 in Ubuntu. Using the Python provided by Ubuntu doesn't get past the configuration step. Config.log shows the following: In file

Cross Compiling Python setup

假装没事ソ 提交于 2020-02-28 21:20:25
问题 I am trying to build GObject-Introspection on Ubuntu 14.04 using Mingw-w64. I am currently running 64bit Linux and trying to build for a 32bit Windows target. My first attempt used Python 2.7.8 installed in Wine, however, this did not work because Python's path separator was set to '\' (well '\') instead of Linux's '/'. Due to this I tried using the Python 2.7 in Ubuntu. Using the Python provided by Ubuntu doesn't get past the configuration step. Config.log shows the following: In file

vscode c++调试

こ雲淡風輕ζ 提交于 2020-02-27 15:02:02
装MinGW-w64并设好环境变量 打开官方网站 点击下面的SourceForge链接 拉到最下面,这里列出的是已经编译好的MinGW-w64压缩包,选择合适的下载解压就可以用了。根据大神的文章,如果你像我一样是Windows 64位系统,推荐选择最新版本的 x86_64-win32-seh 来下载。 下载压缩文件并解压到合适的位置,在系统环境变量添加\bin目录 运行CMD或者Windows PowerShell,测试一下是否可用。命令:gcc -v Using built-in specs. COLLECT_GCC=gcc COLLECT_LTO_WRAPPER= 原文链接:https://blog.csdn.net/Leo_LiangXuYuan/article/details/86763735 VS Code 的C/C++ 插件 VS Code 的 Code Runner 插件 第二步,设置C/C++配置(c_cpp_properties.json) 据笔者个人经验,c_cpp_properties.json文件关系到编写代码的时候能否自动查找头文件、能否显示函数或变量的提示信息和能否实时检查出代码的语法错误等,这些都需要头文件和编译器的支持。在没有c_cpp_properties.json文件的情况下,默认会使用Visual Studio的相关配置

C/C++ 开发利器 CLion安装与配置

送分小仙女□ 提交于 2020-02-27 03:41:17
概述 CLion是Jetbrains公司旗下新推出的一款专为开发C/C++所设计的跨平台IDE,它是以IntelliJ为基础设计的,同时还包含了许多智能功能来提高开发人员的生产力,提高开发人员的工作效率。这个强大的IDE不仅可以帮助开发人员在Linux、OS X和Windows上来开发C/C++,同时它还使用智能编辑器来提高代码质量、自动代码重构并且深度整合CMake编译系统,从而提高开发人员的工作效率。使用过Android Studio的开发者相信会非常容易上手。 下载 首先去Jetbrains官网下载CLion https://www.jetbrains.com/clion/download/ 安装 然后继续点Install 安装完成后提示需要重启电脑,一般来说不用重启,点Finish 激活 下载完后启动你会发现还未激活,那么接下来在浏览器的地址栏输入: http://idea.lanyus.com/ 将0.0.0.0 https://account.jetbrains.com:443加入hosts,不需要0.0.0.0 www.jetbrains.com,不然会影响idea的某些功能 打开cmd终端,输入ipconfig /flushdns,然后回车刷新dns缓存 输入lanyu序列号,成功开车。 在激活窗口中选择Activation code 激活完毕 下载安装MinGW

Go实现的库的跨平台编译调用

Deadly 提交于 2020-02-26 10:30:38
通过cgo可以将go的程序编译成库,在其他程序,如C程序中调用。cgo本身就提供了多平台的支持。不过对于每个平台还需要有相应的C编译工具链的支持,对不同平台的支持程度也不一致,需要针对每个平台单独处理。 新建文件 lib.go ,通过import C启用cgo,export指定需要导出的方法。cgo编译后会生成相应的头文件,在C程序中包含这个头文件,链接时链接生成的库即可使用。 package main import "C" //export add func add(a, b C.int) C.int { return a + b } func main() { } 编译Linux平台的库 Linux平台的编译最为顺利,有其实就在Linux上操作,只要安装gcc即可。 安装C编译器 因为本身就64位的系统,默认安装gcc即可,如果需要编译32位的库,则需要单独安装针对32位版本的gcc。 $ sudo apt install gcc 编译静态库 $ CGO_ENABLED=1 GOOS=linux GOARCH=amd64 CC=gcc go build -buildmode=c-archive -o libcgotest.a lib.go 编译动态库 $ CGO_ENABLED=1 GOOS=linux GOARCH=amd64 CC=gcc go build

How to link to an xxx.dll when the provider only ships it with an xxx.lib and you are using MinGW-w64 and not MSVC?

こ雲淡風輕ζ 提交于 2020-02-23 07:50:29
问题 Firebird and Boost communities only provide the xxx.lib for their pre-built xxx.dll binaries, and I am using MinGW-w64 v7.0.0 with GCC v8.1.0 , and this last one expects a libxxx.a file containing all the xxx.dll function symbols to link with. For Boost , I can build it from the source code for MinGW-w64 (though I still prefer using the pre-built ones, because the build process for big toolkits like this one takes forever). As for Firebird , it is not buildable using MinGW-w64 at all, except

POCO libraries: MinGW (MSYS2) compilation has generated libPocoDataODBC.dll with missing entry points (Poco::Data::ODBC::Connector::registerConnector)

依然范特西╮ 提交于 2020-01-25 09:28:14
问题 I have succeeded compiling POCO libraries with MinGW64 (MSYS2). To build it, I installed Windows SDK and added to the PATH environment the path to mc.exe , so I executed: pacman -S mingw-w64-x86_64-cmake # Get POCO git clone -b master https://github.com/pocoproject/poco.git # set Windows SDK to the PATH export PATH="/c/Program Files (x86)/Windows Kits/10/bin/10.0.18362.0/x64:$PATH" # Prepare compilation cd poco /mingw64/bin/cmake -G "MSYS Makefiles" .. # Compile make The compilation succeeded

Compiling Google test with Mingw-w64

妖精的绣舞 提交于 2020-01-25 04:16:25
问题 I'm trying to compile Google Test with Mingw-w64 in a Windows 10 machine but I always get the error: C:\git\tdd\googletest>cmake CMakeLists.txt -G "MinGW Makefiles" CMake Error: CMake was unable to find a build program corresponding to "MinGW Makefiles". CMAKE_MAKE_PROGRAM is not set. You probably need to select a different build tool. CMake Error: CMake was unable to find a build program corresponding to "MinGW Makefiles". CMAKE_MAKE_PROGRAM is not set. You probably need to select a

CMake 3.8.0 generates wrong link command in makefiles

心不动则不痛 提交于 2020-01-23 02:47:12
问题 Problem: After I run cmake to generate a project with a STATIC library, which completes successfully, both ninja and mingw32-make fail to make their targets at linking. For SHARED libraries or executables this same setup worked fine. I've tried this both for "Ninja" and "MinGW Makefiles" generators: ninja output: [2/2] Linking CXX static library hello_wsl.lib FAILED: hello_wsl.lib cmd.exe /C "cd . && "C:\Program Files\CMake\bin\cmake.exe" -E remove hello_wsl.lib && "" qc hello_wsl.lib

libtool: undefined symbols not allowed in i686-pc-mingw32 shared

烈酒焚心 提交于 2020-01-22 15:16:12
问题 I'm using autotools as build system for a library of mine. Recently library is ported to Windows. Library compiles and links successfully though I encountered a strange error. There is only static libraries after configure and make. Evertything looks OK except a warning from libtool : libtool: undefined symbols not allowed in i686-pc-mingw32 shared I have exported all symbols for Windows machines by this code: #ifdef _WIN32 # ifdef DLL_EXPORT # define LIBRARY_API __declspec(dllexport) # else