mingw

MinGW 5.3.0-2 not working

北战南征 提交于 2019-12-30 11:09:37
问题 I get a bizzare error after upgrading to MinGW 5.3.0-2(actual version) I checked everything because It's the 5th time i reinstall it and thought it would help Code::Blocks outputs this: mingw32-g++.exe -Wall -fexceptions -g -c C:\Users\Tudor\Documents\C++\test\main.cpp -o obj\Debug\main.o mingw32-g++.exe -o bin\Debug\test.exe obj\Debug\main.o c:/mingw/bin/../lib/gcc/mingw32/5.3.0/../../../../mingw32/bin/ld.exe: cannot find -lpthread collect2.exe: error: ld returned 1 exit status Process

How to prevent MSYS to convert the file path for an external program

烈酒焚心 提交于 2019-12-30 08:53:25
问题 I'm porting a Linux script to Windows & MinGW, which accesses the Android phone through ADB. Sometime I need to pass the Android's file path as ADB command line option. However, when invoking the ADB.exe, MinGW translates it to Windows' path. For example, adb shell cat /proc/version Is translated as follows, resulting "No such file or directory" error in Android. adb shell cat C:/Program Files (x86)/Git/proc/version I found double-quotation helps to prevent that. adb shell "cat /proc/version"

Automated C unit testing

早过忘川 提交于 2019-12-30 08:39:07
问题 I have a C library compiled with MinGW, Eclipse C project. Library consists of many modules, each module can be tested. What is the best way (using MACROS or something) how to write tests for this library, compile it a run it in Eclipse/CDT IDE? EDIT: I've seen that some people use #ifdef TEST int main(void) { ...TEST LOGIC... } #endif but don't know how to plug it into Eclipse. 回答1: I'd suggest to use CuTest with a Makefile. 来源: https://stackoverflow.com/questions/6794999/automated-c-unit

Setting up GLFW with MinGW

旧巷老猫 提交于 2019-12-30 06:36:45
问题 I'm trying to learn OpenGL with GLFW, but I'm having some problems. This is my main.cpp: #include <GL/glfw.h> int main() { glfwInit(); glfwSleep( 1.0 ); glfwTerminate(); } This is my project's folder structure: Project +- glfw.dll +- main.cpp This is where I extracted the GLFW files: MinGW +- include | +- GL | +- glfw.h +- lib +- libglfw.a +- libglfwdll.a And this is how I try to build the program: g++ main.cpp -o main.exe -lglfwdll And these are the errors I'm getting: C:\Users\Dark\AppData

Unable to link to SDL2 functions using MinGW

痴心易碎 提交于 2019-12-30 05:57:11
问题 I'm relatively new to programming and I've decided to give SDL a try, but I'm a bit stuck. I haven't been able to build the project in codeblocks and I get 'undefined reference' to all SDL functions. I've seen a lot of similar questions here, but none of the solutions seems to help. I've already added the \include\SDL2 and the \lib folders to search directories, I've added SDL2Main and SDL2 to link libraries in linker options, I've even added -mwindows to other linker options. Also, I tried

MS vs Non-MS C++ compiler compatibility

放肆的年华 提交于 2019-12-30 05:06:13
问题 Thinking of using MinGW as an alternative to VC++ on Windows, but am worried about compatibility issues. I am thinking in terms of behaviour, performance on Windows (any chance a MinGW compiled EXE might act up). Also, in terms of calling the Windows API, third-party DLLs, generatic and using compatible static libraries, and other issues encountered with mixing parts of the same application with the two compilers. 回答1: First, MinGW is not a compiler, but an environment, it is bundled with gcc

MinGW not defining WIN32, error in preprocessor directives

爱⌒轻易说出口 提交于 2019-12-30 04:24:51
问题 I am using mingw32-make to compile a project to Windows, which depends on a project called libevent2. I keep receiving this error - util.h:69:25: fatal error: sys/socket.h: No such file or directory Obviously a file from the Linux API is trying to be included, which won't work on Windows. Upon further investigation I find however that this file should only be included if WIN32 isn't defined. #ifdef WIN32 #include <winsock2.h> #else #include <sys/socket.h> #endif 回答1: You should use _WIN32 and

Getting mingw-get to install correctly - mingw/msys path missing plus more!

∥☆過路亽.° 提交于 2019-12-30 03:12:25
问题 I'm running windows XP. I have been following this tutorial and so downloading mingw-get-inst here. I've done this a couple times and the last time I checked boes to install EVERYTHING including, but not limited to, gcc, g++, MSYS and the MinGW Compiling Suite. I told it to make a program menu shortcut, too. I believe I have correctly added MinGW/bin to the Environment Settings' Path . So I have the shortcut to the MSYS shell now. It goes to C:\MinGW\msys\1.0\msys.bat, but the whole msys

I got 'duplicate section' errors when compiling boost_regex with size optimization (-Os)

▼魔方 西西 提交于 2019-12-30 03:11:05
问题 compiler: http://sourceforge.net/projects/mingwbuilds/files/host-windows/releases/4.7.2/32-bit/threads-posix/sjlj/x32-4.7.2-release-posix-sjlj-rev6.7z boost: http://sourceforge.net/projects/boost/files/boost/1.52.0/boost_1_52_0.7z (both on D: drive) boost_regex compiled with: b2 --prefix=D:\boost toolset=gcc --with-regex --layout=tagged release code: #include <boost\regex.hpp> int main() { boost::regex reg("[a-z]+"); } compiled with parameters: g++ -I "d:\boost" -Os -o test.exe test.cpp

How to compile googletest on windows using mingw with msys?

你。 提交于 2019-12-30 00:05:32
问题 My need is simple. I have to compile and use googletest on windows using MinGW with msys. Has anyone some experience doing this? Thanks for answers. 回答1: It took me some time but I figured it out. Here is the guide for anyone who face the same problem. To be able to compile GoogleTest on Windows follow this instructions: I assume you have MinGW with MSYS istalled. Download and install CMake from the official site http://www.cmake.org/. Use the Win32 installer version. Once you have completed