mingw32

Cannot run my exe file on another computer. “Application requested the runtime to terminate it in an unusual way” error

寵の児 提交于 2019-12-05 02:01:02
My exe runs completely fine on the computer I programmed it on. It debugs fine, releases fine, and I can move the exe file from the 'release' folder into a new file, locate the needed .dll files from C:\pathtoqt\ming47_32\bin and it still runs fine. However, when I attempt to run this program on another computer with the .dll files included, I cannot do it and I get the "Application has requested the runtime to terminate it in an unusual way". I have tested this on 2 windows 7 computers and 1 windows xp. I used dependency walker and downloaded a bunch of .dll's and it still didn't work. I

does fopen return NULL pointer if file is already open

徘徊边缘 提交于 2019-12-04 05:51:17
问题 I was assuming that fopen returns NULL pointer if file is already open. But it looks fopen does not return NULL in case file is already open in "w" mode. Below is the code that I used to try this and I do not get any errors. I tried with mingw32 as well as TDM-GCC-64 compilers. If I am not mistaken, C++ gives error if file is already open. #include<stdio.h> int main() { FILE *fp1, *fp2; fp1=fopen("file1.txt", "w"); fp2=fopen("file1.txt", "w"); if(fp2==NULL) { printf("Error in opening file\n")

MinGW64 cannot compile 32bit code

為{幸葍}努か 提交于 2019-12-03 21:00:55
I've downloaded MinGW from this link x64-4.8.1-posix-sjlj-rev1 but when I try to build for x86 target I've lots of linkage errors... seems that only x64 lib are installed... I've need to build for x86 and x64 platforms on windows... Have I to download both x64 and x86 or are some simpler ways? Edit I'm using eclipse keplero as IDE I've tryed to build myself a simple hello world program with g++ -m32 -std=c++11 test.cpp -o test32.exe and g++ -m64 -std=c++11 test.cpp -o test64.exe . And all is ok... So the problem was with eclipse... After a little a discovered that I need to use MYSY ( set in

Is there a better way to remove all of the three buttons on the title-bar and remove the scroll-bar using Windows API?

浪子不回头ぞ 提交于 2019-12-03 20:28:30
The code removing all of the three buttons on the title-bar and removing the scroll-bar I use in "Windows 7" so far is listed: #define WINVER 0x0501 // WinXP and UP #include <windows.h> int main ( void ) { //Get a console handle HWND ConsoleWindow = GetConsoleWindow(); //Change Settings SetWindowLong (ConsoleWindow, GWL_STYLE, WS_THICKFRAME); SetWindowLong (ConsoleWindow, GWL_STYLE, WS_CAPTION); SetWindowPos (ConsoleWindow, HWND_TOPMOST, 0, 0, 0, 0, SWP_FRAMECHANGED | SWP_SHOWWINDOW); //Resize system ("mode con cols=75 lines=50"); system ("pause>nul"); return 0; } Compiling Command: mingw32

How to add a path to LDFLAGS

霸气de小男生 提交于 2019-12-03 19:04:59
问题 I'm trying to set up a library called PBC (Pairing-based cryptography). And this library requires another library called GMP -(GNU Multiple-Precision Library). My problem is after installing GMP correctly, PBC gives an error of: gmp library not found add its path to LDFLAGS I have no idea what LDFLAGS is and how to add it to the path. PS: I'm using MinGW. 回答1: The question is not really descriptive enough for anyone to answer well, but.... On a Unix-based system you would likely do something

How to use inet_pton() with the mingw compiler?

狂风中的少年 提交于 2019-12-03 09:47:33
问题 I'm trying to add IPv6 compatibility to an already IPv4-compatible program in C, but having some problems with the compiler. Currently compiling with mingw32-gcc-4.6.2, which gives me a linking error when using the function inet_pton. I've tried making it compile for vista(as inet_pton is a vista function), but it seems like the whole function is missing from mingw. Is there any way to add it to mingw, or any other options I may have missed? 回答1: Looking in my past codes - Tested in MinGW/GCC

Automake error './ltmain.sh' not found

蓝咒 提交于 2019-12-03 03:13:46
问题 I've installed mingw and msys by using mingw-get-setup.exe . I've also installed Autotools(autoconf, automake,m4,libtool) into C:\/opt/autotools . When I run automake, the following error always occurs: configure.ac:11: error: required file './ltmain.sh' not found If I copy ltmain.sh from libtool’s installed tree, execution will finish normally. How can I configuure automake to find ltmain.sh without copying? 回答1: In an autoconf / automake / libtool project you have to invoke: libtoolize :

How to use inet_pton() with the mingw compiler?

谁说胖子不能爱 提交于 2019-12-03 01:25:17
I'm trying to add IPv6 compatibility to an already IPv4-compatible program in C, but having some problems with the compiler. Currently compiling with mingw32-gcc-4.6.2, which gives me a linking error when using the function inet_pton. I've tried making it compile for vista(as inet_pton is a vista function), but it seems like the whole function is missing from mingw. Is there any way to add it to mingw, or any other options I may have missed? Looking in my past codes - Tested in MinGW/GCC: int inet_pton(int af, const char *src, char *dst) { switch (af) { case AF_INET: return inet_pton4(src, dst

Why is getchar() being skipped? [duplicate]

送分小仙女□ 提交于 2019-12-02 17:28:29
问题 This question already has answers here : scanf getchar function is skipped (2 answers) Closed 3 years ago . This is my code below, which I was working on. The output is this: Enter Nums: 20 4 OP: Which option was that? The op = getchar(); part is being entirely ignored. Why? I'm using gcc 4.6.2 MinGW. #include <stdio.h> int add(int num1, int num2) { return num1 + num2; } int subs(int num1, int num2) { return num1 - num2; } int mul(int num1, int num2) { return num1 * num2; } float div(int num1

Automake error './ltmain.sh' not found

强颜欢笑 提交于 2019-12-02 16:44:05
I've installed mingw and msys by using mingw-get-setup.exe . I've also installed Autotools(autoconf, automake,m4,libtool) into C:\/opt/autotools . When I run automake, the following error always occurs: configure.ac:11: error: required file './ltmain.sh' not found If I copy ltmain.sh from libtool’s installed tree, execution will finish normally. How can I configuure automake to find ltmain.sh without copying? In an autoconf / automake / libtool project you have to invoke: libtoolize : this copies/links a few support scripts, including ltmain.sh (which is the main component of libtool). aclocal