mingw

Do I really need malloc?

試著忘記壹切 提交于 2020-02-03 09:10:56
问题 I understand that malloc is used to dynamically allocate memory. In my code, I have the following function that I sometimes call: int memory_get_log(unsigned char day, unsigned char date, unsigned char month){ char fileName[11]; unsigned long readItems, itemsToRead; F_FILE *file; sprintf(fileName, "%s_%u%u%u%s", "LOG", day, date, month, ".bin"); file = f_open(fileName , "r"); itemsToRead = f_filelength( fileName ); //unsigned char *fileData = (unsigned char *) malloc(itemsToRead); unsigned

Is GCC 4.8.1 C++11 complete?

半城伤御伤魂 提交于 2020-02-03 06:41:57
问题 OS is windows. I'll start off by saying that I have no experience with C++, or any other compiled language. I've used CPython a bit and am familiar with that, but, until earlier today, I'd never even glanced at C++ source. I'm trying to teach myself C++, so I've been playing around with it a bit, and one problem I'm having is the error: error: 'to_string' was not declared in this scope Apparently, to_string is a C++11 thing, which should be fine. I downloaded the latest MinGW, added it to my

Is GCC 4.8.1 C++11 complete?

倾然丶 夕夏残阳落幕 提交于 2020-02-03 06:35:32
问题 OS is windows. I'll start off by saying that I have no experience with C++, or any other compiled language. I've used CPython a bit and am familiar with that, but, until earlier today, I'd never even glanced at C++ source. I'm trying to teach myself C++, so I've been playing around with it a bit, and one problem I'm having is the error: error: 'to_string' was not declared in this scope Apparently, to_string is a C++11 thing, which should be fine. I downloaded the latest MinGW, added it to my

MinGW lib files

半城伤御伤魂 提交于 2020-02-02 13:51:13
问题 Where can I download MinGW with .lib library files instead .a ? Or maybe I can build it? Thanks for any help. 来源: https://stackoverflow.com/questions/6243522/mingw-lib-files

MinGW的安装【解决:gcc.exe: error: CreateProcess: No such file or directory】

十年热恋 提交于 2020-02-02 02:02:31
今天想搭建一个mingw 平台,来测试一些code,搜索了百度置顶的几个方案后,均不能解决问题,总结的问题如下: 错误1:选择指定的模块安装后,出现 gcc.exe: error: CreateProcess: No such file or directory的错误 错误2:使用别人安装好的,出现 undefined reference to `__chkstk_ms'的错误 又搜索了一些方案:比如在环境路径下bin->bin\,以及选择安装所有的gcc模块,等等乱试一通,都没用! 突然意识到自己像一只没头苍蝇一样乱撞一气,很愚蠢!必须得搞清楚, MinGW-get-setup的基本逻辑 是什么? 基于这个思路,我对比了一下别人安装好的,和自己安装后的区别,发现自己比别人少很多东西,比如addr2line.exe等,之前安装的都没有这些,这个时候我意识到大概率是我少安装了什么东西。 那么首先需要解决的就是,到底需要安装哪些模块?如果我只需要C编译器和C++编译器分别应该选择哪些模块? 重新打开MingW32-get-setup.exe后,仔细看了所有的安装模块,心中大致分了几个类,然后发现如下图所示的选项: 这个mingw32-base-bin 就包含了C complier,linker 和其他binary tools,runtime libraries ,windows API

Windows10 环境下使用 Cmake 和 MinGW-w64 编译安装 OpenCV 4.0.1

时光毁灭记忆、已成空白 提交于 2020-01-31 15:20:13
一、系统及软件环境 Windows-10-64bit MinGW-w64-x86_64-8.1.0-release-posix-seh-rt_v6-rev0 CMake-3.13.1 opencv-4.0.1-vc14_vc15 二、安装 MinGW-w64 并配置其环境变量 通过 window 安装文件来安装 下载 MinGW-w64,下载地址: MinGW-w64 - for 32 and 64 bit Windows 安装 MinGW-w64。以管理员的身份执行安装程序,根据自己环境的情况选择安装包 然后执行下一步,如果这步出现错误就 通过离线的方式来配置 离线配置 MinGW-w64. 如果使用 .exe 文件安装出现错误,可以通过离线的方式来配置 MinGW-w64。具体步骤参考下面内容。 通过离线包进行安装 下载对应版本的离线包,下载地址: x86_64-8.1.0-release-posix-seh-rt_v6-rev0.7z 提取文件到任意路径,我是直接放在 C:\ 目录下; 配置环境变量,将 X:\mingw64\bin ( X 为提取目录) 添加到环境变量的 path 变量中,然后打开命令行执行器输入 gcc -v , 如果出现对应的版本号则表示配置成功。 三、使用 Cmake 生成 OpenCV 的 Makefile 下载对应平台的 cmake 并安装

MinGW, build GUI application with console

戏子无情 提交于 2020-01-30 19:28:01
问题 I'm using MinGW to build my application on Windows. When compiling and linking, the option "-mwindows" is put in command line to have Win32 API functions. To be more specific: when calling GCC of MinGW without "-mwindows" like this: c:\>g++ -c main.cpp c:\>g++ -o main.exe main.o The 'main.exe' after the 2 command lines above will run with a console, and Win32 API functions won't be usable. When calling GCC of MinGW with "-mwindows" like this: c:\>g++ -c main.cpp c:\>g++ -o main.exe main.o

Cannot find -lSDLmain and -lSDL when compiling simple SDL program with g++

橙三吉。 提交于 2020-01-30 11:39:48
问题 I installed SDL2 for mingw using this guide. However, when i try to compile using the compilation syntax and test code they provide, only with my own file names, I get the error shown here. I assume that this error has something to do with a problem in the way I installed SDL, as the installation instructions did not exactly match the files with which I was provided, but I did my best to follow them. Could they problem be something else? If not what is the correct way to install SDL2 for

CMake/MinGW unknown compilers, gcc.exe broken

半世苍凉 提交于 2020-01-30 06:35:48
问题 I am trying to install on my windows desktop, a software suite called NUPACK which is used to design nucleic acid reaction pathways. http://www.nupack.org/ This software requires CMake to install, and from my understanding, CMake does not have compilers by itself, and requires us to have compilers separately installed. As such, I downloaded MinGW to use as a C++ compiler. Prior to running, I have set the environment variables of both CMake and MinGW's bin. I am running CMake (version 3.11.1)

Can't install SDL on MinGW, getting `undefined reference to WinMain@16`

人走茶凉 提交于 2020-01-30 03:01:28
问题 I'm trying to install SDL on MinGW. I've downloaded SDL from here (the SDL2-devel-2.0.0-mingw.tar.gz link), then copied the contents of SDL2-2.0.0/x86_64-w64-mingw32/{bin,include,lib} into the matching directories in my MinGW installation. When I try to compile any file that contains #include ‹SDL2/SDL.h› using gcc test.c -lmingw32 -lSDL2main -lSDL2 -mwindows , GCC complains about undefined reference to WinMain@16 and undefined reference to some SDL functions. 回答1: SDL2-devel-2.0.0-mingw.tar