mingw

std::unordered_map::emplace issue with private/deleted copy constructor

浪尽此生 提交于 2020-01-03 08:09:40
问题 The following code compiles fine with gcc 4.7.2 (mingw) #include <unordered_map> #include <tuple> struct test { test() =default; private: test(test const&) =delete; }; int main() { std::unordered_map<char, test> map; map.emplace( std::piecewise_construct, std::forward_as_tuple('a'), std::forward_as_tuple() ); } If I change the copy constructor in test from test(test const&) =delete; to test(test const&) =default; however, the template error vomit seems to complain about const test& not being

C++ qt embedded mysql server

 ̄綄美尐妖づ 提交于 2020-01-03 06:35:13
问题 I'm using QT 5 with MingW 4.7 and i'm trying to start a program with an embedded mysql server. My current program uses a mysql server, but the server has to be manually started (so out of the program). This isn't user friendly of-course. I did some research and I need to use the libmysqld library . But I don't know how. Can anyone give me an example how to use this? 回答1: You can use an embedded mysql server within Qt. There are no that many difficulties with that at all. If you could point

How can I #include a file with encrypted string?

拥有回忆 提交于 2020-01-03 05:20:07
问题 I am writing a C app on Windows with MinGW/gcc. I need to use the #include directive to include a file that contains an encrypted string. The string will be decrypted at runtime. I want to do this so the string will not be visible if looking at the executable with a hex editor. I tried this, but it doesn't work. You get the idea, though: char *hidden_str = #include "encrypted_text.dat" There may be unescaped stuff in there that's confusing the compiler. I don't know. I don't know what happens

MinGW libraries issues

核能气质少年 提交于 2020-01-03 05:04:06
问题 In the process of porting a C project from Linux to Windows Have installed MinGW Have compiled my shared library using a Makefile This produces libExample.so Now I'm trying to link this shared library to a test harness so I can see if everything is working as expected In the harness Makefile I specify the location of the library, e.g. -LE:/libExample_dir and the name of the library -lExample but its complaining it cannot find the library, i.e. linker is failing with cannot find -lExample - is

'make clean' not working

允我心安 提交于 2020-01-03 04:51:30
问题 so I made a makefile for a c program. For some reason my 'clean' is not working. Here's a little bit of my makefile: CC=gcc FLAGS=-c -Wall -I. CLEANC=rm -rf *.o move.o: move.c $(CC) $(FLAGS) move.c /*Lot more codes like this^^^*/ clean: $(CLEANC) When I run 'make clean' in command prompt, I'm shown the following: rm -rf *.o process_begin: CreateProcess(NULL, rm -rf *.o, ...) failed. make (e=2): The system cannot find the file specified. makefile:116: recipe for target 'clean' failed make: ***

Final Setup of gcc in Notepad++ [using nppexec]

ぃ、小莉子 提交于 2020-01-03 02:59:07
问题 I downloaded notepad++, and MinGW also I installed the nppexec plugin in order to use npp as fully functional IDE. the command i entered into the nppexec is npp_save cd $(FULL_CURRENT_PATH) gcc -o $(NAME_PART) $(FILE_NAME) $(CURRENT_DIRECTORY)\$(NAME_PART).exe now, every time I hit "f6", it lets me to set the command, every single time, how do i stop it? I want to do that if I press F6 the command automatically be executed second question. my code, 4 example is: printf("please enter num\n\n")

MinGW parallel make: CreateProcess error

房东的猫 提交于 2020-01-02 14:33:02
问题 I am using MinGW under Windows 10 for my development tools. I have a C project with ~100 source files. I created a makefile to build the project, and it worked fine, every time. But then I tried to speed up the build by passing -j4 to mingw32-make , telling it to use four processors in parallel. This did indeed speed up the build, but only for a while: after a seemingly random number of compilations (the number changes every time), I get the error gcc.exe: error: CreateProcess: No such file

MinGW parallel make: CreateProcess error

倾然丶 夕夏残阳落幕 提交于 2020-01-02 14:32:18
问题 I am using MinGW under Windows 10 for my development tools. I have a C project with ~100 source files. I created a makefile to build the project, and it worked fine, every time. But then I tried to speed up the build by passing -j4 to mingw32-make , telling it to use four processors in parallel. This did indeed speed up the build, but only for a while: after a seemingly random number of compilations (the number changes every time), I get the error gcc.exe: error: CreateProcess: No such file

Poor _rotl performance under minGW

[亡魂溺海] 提交于 2020-01-02 09:36:15
问题 I've got a program which is performance-reliant on the rotate-left instruction. Under MSVC, it works fairly well, just define the _rotl() intrinsic as the target for rotate left. Under GCC for Linux, it also works well. Here it is enough to define the equivalent software construction rotl32(x,r) = ((x << r) | (x >> (32 - r))) , the compiler is clever enough to recognize this is a 32-bits rotate left, and automatically replace it by its intrinsic equivalent (to be fair, MSVC is also able to

Segmentation fault when compiling mysql2 with mingw

扶醉桌前 提交于 2020-01-02 09:31:52
问题 When I try to create a Rails server this is what I get. It instantly runs over 500+ lines of code and comes back with this message. This is my first Ruby on Rails project. I am pretty new to coding as well. Would love some help if possible. Thank you! C:/Ruby200-x64/lib/ruby/gems/2.0.0/extensions/x64-mingw32/2.0.0/mysql2-0.3.15/my sql2/mysql2.so: [BUG] Segmentation fault ruby 2.0.0p451 (2014-02-24) [x64-mingw32] 0 enumerator.so 1 C:/Ruby200-x64/lib/ruby/2.0.0/x64-mingw32/enc/encdb.so 2 C: