mingw

Multiple “multiple definition of …” while compiling simple Hello World

▼魔方 西西 提交于 2019-12-25 04:09:23
问题 I was compiling the simple Hello World in Eclipse C/C++ Mars Edition using MinGW. Code: #include <iostream> using namespace std; int main(){ cout << "Hello World!" << endl; } Compiler flags: -I"H:\Eclipse\Workspace\Project" -O0 -Wall -static -static-libgcc Errors: multiple definitions of '__gcc_deregister_frame' multiple definitions of '__gcc_register_frame' multiple definitions of '_argc' multiple definitions of '_argv' multiple definitions of '_mingw32_init_mainargs' multiple definitions of

How to use cUrl and OpenSSL

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-25 03:47:34
问题 I downloaded everything from this page http://curl.haxx.se/download.html . Build libcurl with mingw32-make mingw32-ssl-zlib , put received libcurl.a and libcurldll.a into my lib folder. I also added into my include folder all OpenSSL headers. I must mentioned, that before I build cUrl without OpenSSL, and it worked. I tried to compile with g++ -DCURL_STATICLIB -DUSE_SSLEAY -DUSE_OPENSSL -ID:\Workspacee\Uploader\src\openssl -O0 -g3 -Wall -c -fmessage-length=0 -osrc\main.o ..\src\main.cpp but I

Use of #elif in mingw

杀马特。学长 韩版系。学妹 提交于 2019-12-25 03:36:15
问题 I am currently porting some code from Visual studio to mingw and apparently the following code seems to work in Visual Studio but fails in Mingw #if defined(BATCH_TRIANGLESTRIP) static const size_t VERT_COUNT = 4; #elif defined(BATCH_TRIANGLELIST) static const size_t VERT_COUNT = 6; #elif //error here on mingw #error BATCH_TRIANGLESTRIP or BATCH_TRIANGLELIST need to be defined #endif My question is with the last #elif I looked over at the documentation of msdn and apparently they dont have a

Qt 5.3.1 application error: Could not find or load the Qt platform plugin “windows”

て烟熏妆下的殇ゞ 提交于 2019-12-25 03:35:22
问题 Precompiled Qt 5.3.1 with dynamic libraries, MinGW 32, Windows 8.1 x64 The deployed application cannot start on another computer giving the error: Could not find or load the Qt platform plugin "windows" 回答1: Solved by copying DLL from Qt's folder to ../MyApp/platforms/qwindows.dll. Note: there is no "plugins" directory in path 来源: https://stackoverflow.com/questions/25012347/qt-5-3-1-application-error-could-not-find-or-load-the-qt-platform-plugin-windo

QT Creator 5.7 did not build all modules as static lib

…衆ロ難τιáo~ 提交于 2019-12-25 02:47:28
问题 Couldn't find answer myself. I try to use a power shell script windows-build-qt-static.ps1 to build QT from sources. It's did not working as is, so I modify it. I have download sources manualy, unzip them, place into properly dirrectory, manually patch mkspecs with # [QT-STATIC-PATCH] QMAKE_LFLAGS += -static -static-libgcc QMAKE_CFLAGS_RELEASE -= -O2 QMAKE_CFLAGS_RELEASE += -Os -momit-leaf-frame-pointer DEFINES += QT_STATIC_BUILD and finally I start the power shell script, which contains only

OpenCV 2.1 with Qt Creator on Windows

匆匆过客 提交于 2019-12-25 02:37:10
问题 I have OpenCV 2.1 and Qt (Creator) installed on Windows. Using the OpenCV C API I can link, build and run apps in Qt using OpenCV. However, the when using the OpenCV C++ API, I am getting linking problems. This is probably due to C++ ABI problems, since I'm using the pre-built binaries (built with MSVC-2008) for Windows and Qt Creator uses MinGW. How do I configure CMake to rebuild OpenCV 2.1 so that the resulting .lib s are compatible with Qt? Thanks! 回答1: You need to make sure that CMake

Python XDECREF failing on 64bit mingw

穿精又带淫゛_ 提交于 2019-12-25 01:47:05
问题 I am calling a python method from C using the following code: #include "Python.h" char *find_site(void) { char *app_site_dir = 0; PyObject *module = 0; PyObject *result = 0; PyObject *module_dict = 0; PyObject *func = 0; module = PyImport_ImportModule((char *)"Site"); /* new ref */ if (module == 0) { PyErr_Print(); printf("Couldn't find python module Site\n"); goto out; } printf("module = %p\n", module); module_dict = PyModule_GetDict(module); /* borrowed */ if (module_dict == 0) { PyErr

apache under msys2: how could one setup httpd to load its modules on MSYS2 (generate .so instead of .a)?

♀尐吖头ヾ 提交于 2019-12-25 01:27:38
问题 I could build httpd as described here but when trying to execute it, httpd claim for a missing *.so library: $ ./httpd httpd: Syntax error on line 66 of /home/username/httpd/conf/httpd.conf: Cannot load modules/mod_authn_file.so into server: No such file or directory I thus renamed the module library names referenced in httpd.conf (.so -> .la , then -> .a) but httpd complains about an exec format error: $ ./httpd httpd: Syntax error on line 66 of /home/username/httpd/conf/httpd.conf: Cannot

Global overload operator new/delete in MinGW

孤人 提交于 2019-12-24 21:28:57
问题 I want to overload new/delete operators in my application to catch all memory leaks. It works on Linux fine. But I got a problems on Windows. New/delete overloading works only for .exe but not for calls from .dll files. Furthemore if some object is created in my code but is deleting from .dll file it leads to app crash. Cppreference here says Versions (1-8) are replaceable: a user-provided non-member function with the same signature defined anywhere in the program, in any source file,

C++ SFML with MinGW version 8.2.0 and Atom text editor

大憨熊 提交于 2019-12-24 19:08:15
问题 I am trying to learn to make 2d games using c++ with the SFML library. I am using windows, but I would prefer to use the Atom text editor instead of Visual Studio. I did a lot of research on how to do this, but I still do not know how to use the SFML library with Atom. So, how would I go about implementing the SFML library in my c++ project written in Atom. Thank you! 回答1: This answer supposes that you've downloaded the 32-bit MinGW version of SFML, and you'd like to compile programs written