mingw-w64

How do I invoke the MinGW cross-compiler on Linux?

邮差的信 提交于 2019-12-20 17:06:13
问题 I have a project that I want to cross-compile for Windows. I have the appropriate Makefile and everything works with g++ . I've run $ apt install mingw-w64 and downloaded 500 MB of packages, but I cannot find out how to actually run it. There is no mingw executable, so how do I actually compile with it? 回答1: If you look at the file lists on the Ubuntu package webserver for mingw-w64 's constituent packages: gcc-mingw-w64-x86-64 g++-mingw-w64-x86-64 binutils-mingw-w64-x86-64 mingw-w64-x86-64

How do I invoke the MinGW cross-compiler on Linux?

蹲街弑〆低调 提交于 2019-12-20 17:06:06
问题 I have a project that I want to cross-compile for Windows. I have the appropriate Makefile and everything works with g++ . I've run $ apt install mingw-w64 and downloaded 500 MB of packages, but I cannot find out how to actually run it. There is no mingw executable, so how do I actually compile with it? 回答1: If you look at the file lists on the Ubuntu package webserver for mingw-w64 's constituent packages: gcc-mingw-w64-x86-64 g++-mingw-w64-x86-64 binutils-mingw-w64-x86-64 mingw-w64-x86-64

Building 64-bit Python extensions with f2py on Windows

萝らか妹 提交于 2019-12-20 10:37:18
问题 I'm attempting to build a Python extension from Fortran source using Numpy's f2py.py script. I'm following the steps from http://www.scipy.org/F2PY_Windows (web archive). My system is Windows 7 64-bit, and I primarily use Python 2.7.3 [MSC v.1500 64 bit (AMD64)]. I have Numpy-MKL 1.7.1, from http://www.lfd.uci.edu/~gohlke/pythonlibs/#numpy Here is what I've tried: Choose a Fortran compiler. Since I'm using 64-bit Python, a 64-bit Fortran compiler is required. From MinGW-w64, I've tried a few

Program with protocol-buffers don't compile with MinGW-w64: “undefined reference to google::protobuf:: …”

懵懂的女人 提交于 2019-12-20 04:28:09
问题 I have installed the libprotobuf-dev=2.6.0-4 and protobuf-compiler=2.6.0-4 packages from Debian Jessie repository. Now I'm trying to compile a program that use the 'addressbook.proto' file from the Google Developers example with the MinGW-w64 compiler. I'm using Ubuntu 14.04. With this command the program works: $ g++ main.cpp addressbook.pb.cc -lprotobuf But I want to compile for Windows too. I added the symlink: /usr/include/google -> /usr/i686-w64-mingw32/include/google . $ i686-w64

Why is a static thread_local object in C++ constructed twice?

别等时光非礼了梦想. 提交于 2019-12-19 17:38:18
问题 This code: #include <iostream> #include <thread> #include <mutex> struct Singl{ Singl(Singl const&) = delete; Singl(Singl&&) = delete; inline static thread_local bool alive = true; Singl(){ std::cout << "Singl() " << std::this_thread::get_id() << std::endl; } ~Singl(){ std::cout << "~Singl() " << std::this_thread::get_id() << std::endl; alive = false; } }; static auto& singl(){ static thread_local Singl i; return i; } struct URef{ ~URef(){ const bool alive = singl().alive; std::cout << alive

Configuring Eclipse for using with MSYS2

匆匆过客 提交于 2019-12-19 09:42:34
问题 My I use Eclipse Mars and MSYS2. Eclipse does not recognize my MSYS2 installation. It contains Mingw-w64 for 32 bit compilation. Things I have found on the Internet did not work. What should I do? 回答1: Well, a bit late to the party, but it looks like there is nothing special about MSYS2: the usual procedure of setting up Eclipse to work with MinGW-w64 installation worked for me just fine. The main issue is that as described in Eclipse CDT FAQ to detect MinGW toolchain CDT tries to find

Obtaining current GCC exception model

匆匆过客 提交于 2019-12-18 12:26:43
问题 g++ is built using either the DWARF2 , sjlj or seh exception model. MinGW-builds provide various builds of g++ that have different exception models. I would like to be able to determine from the gcc toolchain what exception model is being used. Is there a g++ argument that will dump the default exception model of the compiler? 回答1: Edit: Originally, I was testing for the configuration flags that are described in g++ -v . As Jonathon Wakely points out in the comments, this is not a good thing

MinGW-w64's gcc and Address Sanitizer

烂漫一生 提交于 2019-12-18 12:18:19
问题 Installing MinGW-w64 5.1 I find -fsanitize=address is available. It compiles fine, and when it starts linking I get thousands of: undefined reference to '__asan_report_load1' undefined reference to '__asan_report_load4' I googled and found libasan referenced various places, but also comments that when you include -fsanitize=address it automatically includes that library for linking. I searched the MinGW-w64 5.1 install dirctory for "asan" and it was not found anywhere. What do I need to add

clang/clang++ doesn't find C/C++ headers in windows?

守給你的承諾、 提交于 2019-12-18 04:34:30
问题 1 hour ago I downloaded llvm-3.6.0-rc4-win32.exe from http://llvm.org/pre-releases/3.6.0/ . I tried to compile simple C code that just print "hello" , but it didn't compile , because clang.exe can't find stdio.h. when I use clang-cl.exe with the same code , it worked . I also have the same problem with clang++ even with iostream , I add -I flag to GCC (4.9.1) C++ headers , the result: C:\Users\One\Desktop>clang++ -I c:\MinGW\x86_64-w64-mingw32\include\c++ main.cpp -lib=libstdc++ In file

MinGW-w32 vs. MinGW

前提是你 提交于 2019-12-17 22:57:26
问题 What's the difference between the MinGW project and the 32-bit portion of the MinGW-w64 project? Does the 32-bit portion of MinGW-w64 have any relation to x64 at all? It seems like their compilers do the exact same things... 回答1: One looks like it "cross compiles", from 64 bit to 32 bit, whereas the other looks native. That was just a quick look though, so I could be a long long way off the mark here...... EDIT: This is only somewhat true. A better explanation is provided here 回答2: The MinGW