mingw

MinGW GCC wildcard

那年仲夏 提交于 2021-02-10 06:26:26
问题 I'm using MinGW GCC compiler on windows how to compile all C files in a directory. I used gcc *.c -o Output after I entered the required folder and I got this error gcc: error: *.c: Invalid argument gcc: fatal error: no input files compilation terminated. the used version of GCC is 4.7.1 回答1: For anyone else like me who's come across this problem: I ran into this problem when I installed MinGW-w64 on my tablet after having run it for a few years on my desktop. Basically, I have a ruby script

Negation inside printf

陌路散爱 提交于 2021-02-09 10:57:08
问题 I have the below code and I am not sure why negation inside printf is different from doing negation outside? char d=0x04; printf("Value of d= %X\n",~d); d=~d; printf("Value of d= %X\n",d); The result printed is FFFFFFFB and FB. That means can I say that, inside printf, expressions are converted to integer type (default promotion) and hence 4 bytes are appearing! 回答1: Before the operation of the ~ operator is performed, the type of the operand it promoted to int . This means the result of:

Negation inside printf

好久不见. 提交于 2021-02-09 10:56:36
问题 I have the below code and I am not sure why negation inside printf is different from doing negation outside? char d=0x04; printf("Value of d= %X\n",~d); d=~d; printf("Value of d= %X\n",d); The result printed is FFFFFFFB and FB. That means can I say that, inside printf, expressions are converted to integer type (default promotion) and hence 4 bytes are appearing! 回答1: Before the operation of the ~ operator is performed, the type of the operand it promoted to int . This means the result of:

Negation inside printf

笑着哭i 提交于 2021-02-09 10:56:23
问题 I have the below code and I am not sure why negation inside printf is different from doing negation outside? char d=0x04; printf("Value of d= %X\n",~d); d=~d; printf("Value of d= %X\n",d); The result printed is FFFFFFFB and FB. That means can I say that, inside printf, expressions are converted to integer type (default promotion) and hence 4 bytes are appearing! 回答1: Before the operation of the ~ operator is performed, the type of the operand it promoted to int . This means the result of:

mingw building error: undefined reference to `__chkstk_ms'

冷暖自知 提交于 2021-02-08 19:29:42
问题 I've just installed mingw in windows, and I write a helloWorld program to test it. Code: #include <stdio.h> int main(){ printf("hello, world!\n"); return 0; } Result: C:/MinGW/lib/crt2.o:crt1.c:(.text+0x1f1): undefined reference to `__chkstk_ms' C:/MinGW/lib/libmingwex.a(glob.o):glob.c:(.text+0x5e3): undefined reference to `__chkstk_ms' C:/MinGW/lib/libmingwex.a(glob.o):glob.c:(.text+0x690): undefined reference to `__chkstk_ms' C:/MinGW/lib/libmingwex.a(glob.o):glob.c:(.text+0x7e9): undefined

How to increase stack size when compiling a C++ program using MinGW compiler

最后都变了- 提交于 2021-02-08 09:55:48
问题 I am trying to compile a program that was provided to me. The program tests the run time of the algorithm quicksort when provided different values. I need to increase the size of the stack to run really large numbers. I read to use the following command: g++ -Wl,--stack,<size> where size is the number to increase the stack. However, this isn't working for me. In command prompt when I typed exactly the following: g++ -Wl,--stack,1000000000 and then hit enter, I get the following message: C:

“cannot find -lcrypto -lssl” with OpenSSL on Windows with MinGW

拜拜、爱过 提交于 2021-02-08 03:50:13
问题 Trying out a c code for openssl, and this error showed up while compiling it in the command prompt. c:\openssl>gcc -lssl -lcrypto -o test test.c -IC:\openssl\include\ c:/mingw/bin/../lib/gcc/mingw32/4.8.1/../../../../mingw32/bin/ld.exe: cannot find -lssl c:/mingw/bin/../lib/gcc/mingw32/4.8.1/../../../../mingw32/bin/ld.exe: cannot find -lcrypto collect2.exe: error: ld returned 1 exit status now what should i do, please help. Edit: Even these didn't help: c:\openssl>gcc -o test test.c -lssl

“cannot find -lcrypto -lssl” with OpenSSL on Windows with MinGW

回眸只為那壹抹淺笑 提交于 2021-02-08 03:48:07
问题 Trying out a c code for openssl, and this error showed up while compiling it in the command prompt. c:\openssl>gcc -lssl -lcrypto -o test test.c -IC:\openssl\include\ c:/mingw/bin/../lib/gcc/mingw32/4.8.1/../../../../mingw32/bin/ld.exe: cannot find -lssl c:/mingw/bin/../lib/gcc/mingw32/4.8.1/../../../../mingw32/bin/ld.exe: cannot find -lcrypto collect2.exe: error: ld returned 1 exit status now what should i do, please help. Edit: Even these didn't help: c:\openssl>gcc -o test test.c -lssl

XML parsing with PugiXML, infinite loop

ぐ巨炮叔叔 提交于 2021-02-08 03:36:05
问题 this is pretty much the first C++ program that I ever made, it should display a list of xml nodes in the document. I made an exact same thing work using TinyXML, but I find Pugi much nicer and would like to continue using it. Program code: #include <iostream> #include <string> #include <vector> using namespace std; #include "pugixml/src/pugixml.hpp" #include "pugixml/src/pugiconfig.hpp" #include "pugixml/src/pugixml.cpp" using namespace pugi; const char * identify(xml_node node) { const char

Run MinGW gcc compiler in Windows 7 without setting environment variables

痞子三分冷 提交于 2021-02-07 18:30:11
问题 I have a MinGW folder in Windows and I didn't set any paths in environment variables. When I run the following command: D:\toolchains\MinGW\bin>gcc.exe hw.c -o hw I got this error: gcc.exe: error: CreateProcess: No such file or directory As far as I understand, this problem caused by that I didn't add this path to environment variables. How can I solve this problem without adding this path to environment variables, because I'm planning to run this command from Python script. 回答1: You either