mingw32

-O1/2/3 with -std=c++1y/11/98 - If <cmath> is included i'm getting error: '_hypot' was not declared in this scope

假如想象 提交于 2019-11-28 10:07:31
I've just updated MinGW using mingw-get-setup and i'm unable to build anyting that contains <cmath> header if I use anything larger than -O0 with -std=c++1y . (I also tried c++11 and c++98 ) I'm getting errors like this one: g++.exe -pedantic-errors -pedantic -Wextra -Wall -std=c++1y -O3 -c Z:\Projects\C++\L6\src\events.cpp -o obj\src\events.o In file included from z:\lander\mingw\lib\gcc\mingw32\4.8.1\include\c++\cmath:44:0, from Z:\Projects\C++\L6\src\utils.h:4, from Z:\Projects\C++\L6\src\events.cpp:10: z:\lander\mingw\include\math.h: In function 'float hypotf(float, float)': z:\lander

ld.exe: cannot open output file … : Permission denied

心已入冬 提交于 2019-11-27 18:07:07
I recently installed CodeBlocks with mingw32 on Windows 7 Ultimate 32bit in order to dust off my c skills, but this problem has me somewhat stumped. I decided to fire off a short Fibonacci generator to make sure my setup was working, but I ran into a hurdle. The program compiles, links and whatnot like a charm and I get a corresponding executable which runs as expected. The problems occur if I try to compile again, then I get the following: c:/codeblocks/mingw/bin/../lib/gcc/mingw32/4.4.1/../../../../mingw32/bin/ld.exe: cannot open output file bin\Debug\Fibonacci.exe: Permission denied I can't

Where is vimrc or vim profile for github's mingw32 shell on a Windows machine?

末鹿安然 提交于 2019-11-27 17:28:42
问题 Cygwin has a home directory where I can store a .vimrc file to set up syntax highlighting. I know on linux machines this file is usually in a home directory and that it can be stored globally (although I haven't figure out how the global thing works yet). I'm windows user (I apologize), so I use different shells for different things, and am not all too sure why syntax highlighting is not working when I launch it from the git bash shell. It works fine for cygwin and for putty. but not so much

Massive fprintf speed difference without “-std=c99”

无人久伴 提交于 2019-11-27 14:46:34
问题 I had been struggling for weeks with a poor-performing translator I had written. On the following simple bechmark #include<stdio.h> int main() { int x; char buf[2048]; FILE *test = fopen("test.out", "wb"); setvbuf(test, buf, _IOFBF, sizeof buf); for(x=0;x<1024*1024; x++) fprintf(test, "%04d", x); fclose(test); return 0 } we see the following result bash-3.1$ gcc -O2 -static test.c -o test bash-3.1$ time ./test real 0m0.334s user 0m0.015s sys 0m0.016s As you can see, the moment the "-std=c99"

msys path conversion (or cygpath for msys?)

左心房为你撑大大i 提交于 2019-11-27 11:55:23
I need to pass /DEF:c:\filepath\myLib.def" command line option from a bash script to MS compiler/linker. The path is generated as part of build process by a bash script. Basically, the argument that my script passes is: -DEF:/c/filepath/myLib.def MSYS path conversion can't handle it properly because it doesn't understand /DEF: part. It works if I do -DEF=/c/filepath/myLib.def but then ms tools don't understand this parameter. In short, what's the proper way to write that parameter in MSYS bash so that it converts it to proper argument? On cygwin I could use cygpath, but there is no equivalent,

Multiple “could not be resolved” problems using Eclipse with minGW

若如初见. 提交于 2019-11-27 08:40:13
I have recently installed (the latest builds of) 'Eclipse IDE for C/C++ Developers' and minGW (4.8.1) to help me to get back into C++ after a long time away. I have added -std=c++11 to Other flags at C/C++ Build/Settings/Tool Settings/GCC C++ Compiler/Miscellaneous I have a small program utilizing a number of C++11 features (e.g. using the chrono library, .emplace_back ). After Run I get multiple unresolved issues in the Problems window, as Pasted below). Interestingly, the program does compile and run ok. With this, is there something I'm not setting up in Eclipse to resolve these issues?

Undefined reference to `_imp__glewInit@0'

♀尐吖头ヾ 提交于 2019-11-27 06:12:19
问题 I have built the glew lib so many times. My last build removed the undefined references to all the shader functions such as glCreateShader() . I think this build is the correct one cause I found out that Code:Blocks can open Visual Studio 6.0 projects so it had everything laid out for me. I can compile my app without calling glewInit() but it results in a SEGFAULT right when glCreateShader() is called. Which is caused by not Initializing glew. I need to turn it on but it wont let me XD links:

-O1/2/3 with -std=c++1y/11/98 - If <cmath> is included i'm getting error: '_hypot' was not declared in this scope

匆匆过客 提交于 2019-11-27 03:25:01
问题 I've just updated MinGW using mingw-get-setup and i'm unable to build anyting that contains <cmath> header if I use anything larger than -O0 with -std=c++1y . (I also tried c++11 and c++98 ) I'm getting errors like this one: g++.exe -pedantic-errors -pedantic -Wextra -Wall -std=c++1y -O3 -c Z:\Projects\C++\L6\src\events.cpp -o obj\src\events.o In file included from z:\lander\mingw\lib\gcc\mingw32\4.8.1\include\c++\cmath:44:0, from Z:\Projects\C++\L6\src\utils.h:4, from Z:\Projects\C++\L6\src

undefined reference to `getline' in c

大兔子大兔子 提交于 2019-11-26 22:51:23
I am learning to use getline in C programming and tried the codes from http://crasseux.com/books/ctutorial/getline.html #include <stdio.h> #include <stdlib.h> #include <string.h> int main(int atgc, char *argv[]) { int bytes_read = 1; int nbytes = 10; char *my_string; my_string = (char *)malloc(nbytes+1); puts("Please enter a line of text"); bytes_read = getline(&my_string, &nbytes, stdin); if (bytes_read == -1) { puts ("ERROR!"); } else { puts ("You typed:"); puts (my_string); } return 0; } However, the problem is that the compiler keeps returning errors of this: undefined reference to

Change the location of the ~ directory in a Windows install of Git Bash

本秂侑毒 提交于 2019-11-26 17:30:24
问题 I am not even sure I am asking the right question. Let me explain my situation: This is about Git on Windows 7. My company sets up the Windows user directory on a network drive, not on the local hard drive (for backup and other purposes beyond the scope of this question). I cannot change that policy. I CAN have local files outside of that scheme however and that is how my Apache server is set up. Entirely local. I installed Git. It installs Bash. When I fire up Bash and cd ~ (change to the