FAQ Database Discussion Community


C sockets MinGW outputs lib.exe after build (not executable)

c,eclipse,sockets,mingw
While trying to write a C program that sends UDP through a socket, I encountered the following problem: After adding the line to create the socket SOCKET sock = socket(AF_INET, SOCK_DGRAM, 0); Eclipse reported the problem: undefined reference to `[email protected]' Obviously there were libraries missing, so I added ws2_32 and...

What is the difference between MinGW SEH and MinGW SJLJ?

c++,c,qt,mingw
I am just starting to learn C and installing now QT x64 (form here: http://tver-soft.org/qt64). I have two options to install: MinGW 4.9.2 SEH or MinGW 4.9.2 SJLJ. Question: Which is better to install and why? I read What is difference between sjlj vs dwarf vs seh? and https://wiki.qt.io/MinGW-64-bit#Exception_handling:_SJLJ.2C_DWARF.2C_and_SEH but...

Need help to compile jnlua with mingw

c,lua,mingw,jnlua
This problem has stucked me for days. I have very few knowledge on C, recently I downloaded "jnlua-0.9.6-src.zip" from "https://code.google.com/p/jnlua/downloads/list" and try to compile jnlua.c with following command: mingw32-gcc -m32 -O2 -c -o jnlua.o jnlua.c -Id:\luarock\lua -Id:\java\include\win32 -Id:\java\include As a result, the compiler prints several screens of error messages, below...

Header conflict error with mingw32 (ogre3d+cegui+glm application)

c++,mingw,glm,ogre,ogre3d
I'm in the process of upgrading an ogre application into using a newer version of ogre and have run into some issues compiling this on windows with mingw, due to the upgraded libraries now using glm. When compiling I run into a number of errors like this: In file included...

Qt : No rule to make target '../controlpanel.ui', needed by 'ui_controlpanel.h'. Stop

c++,qt,mingw,qt-creator
I met very strange problem on the Qt Creator. :-1: error: No rule to make target '../controlpanel.ui', needed by 'ui_controlpanel.h'. Stop. mingw32-make[1]: *** No rule to make target '../controlpanel.ui', needed by 'ui_controlpanel.h'. Stop. mingw32-make: *** [debug] Error 2 makefile:34: recipe for target 'debug' failed 22:43:11: The process "C:\Qt\Qt5.4.0\Tools\mingw491_32\bin\mingw32-make.exe" exited with...

Must compile Opencv with Mingw in order to use in QT under Winodws?

qt,opencv,mingw
I've visit these blogs https://zahidhasan.wordpress.com/2014/08/19/qt-5-3-1-64-bit-mingw-windows/ How to link opencv in QtCreator and use Qt library http://www.cnblogs.com/grandyang/p/4328896.html All of them are using Mingw to compile Opencv through Cmake. If I want to use Opencv in QT, is compiling with Mingw the only way? I have this question because I already compiled...

How to use use precompiled static libraries with MinGW?

c,linux,windows,gcc,mingw
I am trying to use MinGW to compile Linux project into Windows. I have been successful doing so with Cygwin, but I would match rather prefer to use MinGW so I the program does not end up having dozens of unnecessary dependencies. Unfortunately, I have run into a problem that...

Using GNU Scientific Library (GSL) under Windows x64 with MinGW

windows,mingw,linker-error,gsl
I have installed MinGW and MSYS on Microsoft Windows (64bit), inside directory C:\MinGW (MSYS directory is C:\MinGW\msys\1.0). I have downloaded the latest GNU Scientific Library (GNU GSL) package from the official ftp. I have used MSYS to perform configure and make successfully as described in the INSTALL file in the...

Does Mingw 4.8.2 support ' #pragma once'

gcc,mingw
I currently have the following mingw gcc --version gcc (x86_64-win32-seh-rev3, Built by MinGW-W64 project) 4.8.2 Copyright (C) 2013 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. My question is does...

Long double is printed incorrectly with iostreams on MinGW

c++,mingw,iostream
Consider the code #include <iostream> int main() { std::cout << 4.2L; } Compiling it on MinGW and running results in the following output: > g++ test.cc > a.exe -7.89773e-278 Is it a bug in MinGW and is there a fix or workaround? Update: There is a similar issue with printf...

C++ “No matching function for call” error

c++,c++11,mingw
I'm using MinGW compiler. I don't understand why I am getting an error. Error : Multiple markers at this line - candidate is: - no matching function for call to 'InsultGenerator::InsultGenerator()' - Line breakpoint: Insultgenerator_0hl14.cpp [line: 22] Here is the cpp file: #include <iostream> #include <fstream> #include <string> #include <vector>...

What's the proper way to link against an executable on Windows?

c++,windows,mingw,ld,mingw-w64
I need to use some symbols from the main executable in a plugin. Linking against the executable causes the following linker errors: i686-w64-mingw32-g++ example.cpp -shared -I.. -std=c++11 -o test.dll ../../test.exe -static-libgcc -static-libstdc++ -fvisibility=hidden [..]/test.exe:cygming-crtbegin.c:(.text+0x500): multiple definition of `__gcc_register_frame' /usr/lib/gcc/i686-w64-mingw32/5.1.0/crtbegin.o:cygming-crtbegin.c:(.text+0x0): first defined here [..]/test.exe:cygming-crtbegin.c:(.text+0x560): multiple definition of...

value noise random function strange output

c++,c,gcc,random,mingw
I am trying to implement this random function that I will use for Value Noise : float random(int x, int y){ int r; float s; srand(y*hgrid+x+seed); r=rand(); s = (float)(r & 0x7fff)/(float)0x7fff; return (s); } As the author of this function said it ( https://code.google.com/p/fractalterraingeneration/wiki/Value_Noise ) : It is important...

Compiling standalone Qt application using MinGW

c++,windows,qt,dll,mingw
I am trying to build a standalone Qt app without any DLLs needed. I recompiled Qt 5.4.1 statically. When I compile and run an application, it doesn't require any Qt DLLs, but it requires libgcc_s_dw2-1.dll instead. I have also edited my mkspecs before configuring and building Qt, I edited these...

Role of __WORDSIZE in compilation

c,linux,mingw
Below are the contents of /usr/include/x86_64-linux-gnu/gnu/stubs-32.h file: #include <bits/wordsize.h> #if __WORDSIZE == 32 # include <gnu/stubs-32.h> #elif __WORDSIZE == 64 # include <gnu/stubs-64.h> #else # error "unexpected value for __WORDSIZE macro" #endif I am on 64 Bit machine, so the result of #include<stdio.h> main() { printf("Word size : %d\n",__WORDSIZE); }...

Calling Compiled C++ exe file from java not working

java,c++,mingw,exe
I am trying to call a C++ program from java and my C++ program as follows: // A hello world program in C++ // hello.cpp #include<iostream> using namespace std; int main() { cout << "Hello World!"; return 0; } What I did was I am using minGW compiler for compiling...

How to specify including path in MinGW?

c++,path,mingw
I tried to follow steps in the answer to this post:"Building Mesa for windows 7. Mesa 9.1". But when I run scons.py, I got the following error: $ scons.py build=release machine=x86 platform=windows MSVC_VERSION=12.0 libgl-gdi scons: Reading SConscript files ... scons: warning: VC version 12.0 not installed. C/C++ compilers are most...

as.exe - entry point not found the procedure entry point __printf__ could not be located in the dynamic link library

windows,mingw
Yt works early.when I try to use gcc commend it show me. I already uninstalled and re-installed gcc 4.8. this is error: as.exe - entry point not found the procedure entry point __printf__ could not be located in the dynamic link library c:\mingw\bin..\lib\gcc\mingw32\4.8.1\..\..\..\..\mingw32\bin\as.exe" this is code: #include <stdio.h> int main(){...

How to compile qtwebkit plugins?

c++,qt,mingw,qtwebkit,qwebview
QtWebkit-plugins is a library that provides features to the QWebView, eg SpellCheck and Notification Web API. Read about: SpellCheck Notification Web API I tried to compile the code in Windows, but my QWebView not working as expected, in other words, SpellCheck and Notification Web API not working. It's like I've...

Link target to libraries

makefile,cmake,mingw,cmake-gui
I have a "CMakified" version of CryptoPP and I am using CMake-GUI to create a MakeFile which ming-make could process as shown in the image below. The "MakeFile" creation was successful but when I executed mingw32-make.exe I got below errors at the very end. Linking CXX executable cryptest.exe CMakeFiles\cryptest.dir/objects.a(test.cpp.obj):test.cpp:(.text+0x8e82): undefined...

i operator is not working with Vim in MINGW

vim,input,mingw
I installed MINGW onto my machine to open my project file. I believe I have installed everything correctly. I can open the files I need to edit and running $make and $./volume runs the program I'ù supposed to edit perfectly. However, when I run $vim volume.c I can open the...

How to install MinGW-w64 and MSYS2?

cygwin,mingw,msys,mingw-w64,msys2
I am trying to build some open source library. I need package management system to easily download the dependencies. At first I am using MinGW+MSYS. But the included packages are limited. Someone told me to use MinGW-w64 + MSYS2. I downloaded the mingw-w64-install from here. When running, it reports the...

How to prevent MSYS to convert the file path for an external program

mingw,filepath,mingw-w64
I'm porting a Linux script to Windows & MinGW, which accesses the Android phone through ADB. Sometime I need to pass the Android's file path as ADB command line option. However, when invoking the ADB.exe, MinGW translates it to Windows' path. For example, adb shell cat /proc/version Is translated as...

Strange gdb c++ error

debugging,g++,mingw
I am making a commandline program in C++ and have run into some strange problems. I am very new to C++, so this is probably why I am so baffled. I am using MinGW to compile and debug. Here is the current code: #include <string> #include <vector> #include <iostream> #include...

Can't link wxWidgets app with Code::Blocks / MinGW

c++,linker,mingw,codeblocks,wxwidgets
I have an already working c++ + wxWidgets app built in Eclipse, with wxWidgets built using MSYS. Now i'd like to try different IDEs, like CodeLite and Code::Blocks, but when i tried them they did'nt work 'cause i was lacking a build.cfg file they wants. So i tried a "clean"...

Adding pointers to chars

c,pointers,mingw,addition
I suspect when for reasons of portability adding pointers is making underlying assumptions regarding the implementation, but can someone please explain why under MinGW GCC I am unable to do the following, due to the following error "invalid operands to binary + (have char * and char *)" char *cbase;...

Do I really need __declspec(dllexport) when cross-compiling a DLL with MinGW and wclang?

c++,dll,mingw,wclang
There are similar questions here but they don't quite answer my question: When to use __declspec(dllexport) in C++ Why do I need __declspec(dllexport) to make some functions accessible from ctypes? When I cross-compile a DLL from Mac OS X using MinGW and wclang, why does my DLL work fine without...

undefined reference to `KSDATAFORMAT_SUBTYPE_PCM'

c++,visual-studio,audio,mingw
I am porting some code from Visual Studio to Mingw . When attempting to build the code I got the following linker error undefined reference to `KSDATAFORMAT_SUBTYPE_PCM' This is the piece of code that is causing the problem WAVEFORMATEXTENSIBLE *pex = reinterpret_cast<WAVEFORMATEXTENSIBLE*>(new char[sizeof(WAVEFORMATEXTENSIBLE)]); ZeroMemory( pex, sizeof(*pex)); pex->Format.nChannels = channels; pex->Format.nSamplesPerSec...

Add punctuation to string in c++

c++,mingw
I am making a function that adds punctuation to a string if the string has none. I think I have done everything correctly and the program compiles fine but no matter what I set the string to, an extra punctuation is always added. source code: // Word Parsing if( str_input.substr(str_input.length()-1,...

Building Qscintilla2 python bindings on Windows7 with MinGW (PyQt4.11, Qt4.8.6)

python,qt,pyqt,mingw,qscintilla
I've tried to resolve this prolem for about 3days, and I'd finally felt that I need to ask for help by creating my own question. I have Windows 7x64 and Qt4.8.6 installed. I need Python with PyQt and Qscintilla2 to be installed and working. Now I wil describe my last...

Error while using Boost Asio

c++,boost,mingw,boost-asio,codeblocks
I get "::UnregisterWaitEx is not declared" inside win_object_handle_service.ipp whenever I try to include < boost/asio.hpp > into my code. Currently I am using Code::Blocks, MinGW compiler (which didn't come bundled with IDE) on Windows 8.1. Boost is built outside of mingw include folder, though is included in project settings. Exact...

Linking issue with libcrypto: undefined reference to `__imp__CertFreeCertificateContext'

c++,qt,mingw,cross-compiling,bitcoin
I'm trying to cross-compile cachecoin binaries on a linux host using gitian and i686-w64-mingw for a windows target. The compilation works fine until the final step of static linking of the dependencies. This is what I get: /home/ubuntu/staging32/lib/libcrypto.a(e_capi.o):e_capi.c:(.text+0x1ff): undefined reference to `[email protected]' Google suggests it's a missing -lcrypto link or...

Linux install command for mingw?

windows,make,install,mingw,mingw32
When trying to build a library from source using make and MinGW, I realized (from errors) that I don't have the install command, which I understand to be a combination of cp, chown, chmod, strip, and maybe some other stuff. I figured, hey, someone's got to have a copy of...

How to convert a msys shell script into a windows exe file

c++,shell,mingw,msys
Is there a generic way to convert a shell script under MSYS/MinGW into a windows .exe file (which calls the shell script behind the scene)? The specific problem I am facing is that I have a shell script lein from Leiningen (clojure tool chain). I installed it to the default...

ming32-make is using g++ instead of cc or gcc to compile a .c source file

c++,c,gcc,mingw
I recently installed mingw-w64 to learn c without needing cygwin. The issue is that mingw32-make is using g++ to compile my .c source, but I don't really know why. The behavior is illustrated here: here's the source: #include <stdio.h> int main(int argc, char *argv[]) { puts("Hello world."); return 0; }...

enable c++1y in qt (mingw)

c++,qt,mingw,qmake,c++14
I'm trying ton enable CONFIG += c++14 in qmake (using mingw), but I always get -std=c++0x in the makefiles generated. the only workaround I found is to add in my .pro file QT_GCC_MAJOR_VERSION = 4 and QT_GCC_MINOR_VERSION = 9, then I get properly -std=c++1y. Those variables should be set automatically...

How to cross-compile with MinGW on Linux for Windows?

linux,mingw,qt5,cross-compiling,travis-ci
I'm trying to compile a Qt5 application for Windows on Linux with MinGW. I'm using Travis-CI to get continuous builds of two windows executables (win32, win64). I've set up a build matrix, which contains the definition of the different MinGW dependencies. The before-install section defines the Qt, MinGW and gcc...

Vim: Space bar in insert mode creates integers

vim,amazon-ec2,mingw,vi
I'm using MINGW on a Windows 7 machine to ssh to an EC2 instance (Ubuntu) on which I would like to use vim as my text editor. If I run vim test.txt, enter Insert mode, and type this is a test, however, vim interprets each of the spaces in that...

OpenCV mingw-make32 Makefile:12: *** multiple target patterns. Stop

c++,opencv,makefile,make,mingw
I installed mingw gcc, g++ compiler. I downloaded the opencv source for 2.4.10. Then I used the following commands to compile the source: cmake -G "MinGW Makefiles" -D CMAKE_CXX_COMPILER=mingw32-g++.exe -D CMAKE_MAKE_PROGRAM=mingw32-make.exe .. mingw32-make mingw32-make install Then I added the lib to my windows PATH. I use the following Makefile to...

mingw installer virus detected on virustotal. false positive? [closed]

mingw,antivirus,virus,virus-scanning
A virus has been detected in mingw installer. Mainly in Virobot and TheHacker antivirus scanners. https://www.virustotal.com/en/file/aab27bd5547d35dc159288f3b5b8760f21b0cfec86e8f0032b49dd0410f232bc/analysis/1430491365/ I have searched on google as to why this is happening. I have found this. http://mingw-users.1079350.n2.nabble.com/Explanation-of-false-positives-for-viruses-in-mingw-get-setup-exe-td7582442.html It seems that i'm not convinced with the answers to the topic. Because the third poster's opinion conflicts...

mingw and msvcrt.dll confusion

c++,c,windows,mingw,msvcrt
I am coding for winapi in mingw One thing i stil not fully understood is vc redistribuable, I got a whole pack of question to it Some say afaik that such program need msvcrt.dll 1) is it the same lib needed for bot c++ and c compilaton? 2) is this...

Why is getchar() being skipped?

c,io,mingw,mingw32,getchar
This is my code below, which I was working on. The output is this: Enter Nums: 20 4 OP: Which option was that? The op = getchar(); part is being entirely ignored. Why? I'm using gcc 4.6.2 MinGW. #include <stdio.h> int add(int num1, int num2) { return num1 + num2;...

MinGW's ld cannot perform PE operations on non PE output file

gcc,assembly,mingw,nasm,osdev
I know there are some other similar questions about this out there, be it StackOverflow or not. I've researched a lot for this, and still didn't find a single solution. I'm doing an operative system as a side project. I've been doing all in Assembly, but now I wanna join...

Why is this makefile not creating an executable with MinGW?

makefile,make,mingw
I am trying out MinGW on windows. I've been able to use GCC to create a executable from a C source file. main.c is this: #include <stdio.h> int main() { int this_is_a_number; printf("Please enter a number: "); scanf("%d", &this_is_a_number); printf("You entered: %d", this_is_a_number); getchar(); return 0; } the makefile has...

Assigning a default value to a LONGLONG type. Mingw GCC

c++,visual-studio,mingw
I am porting some code and came across this class Someclass { void Restart (IN TIMEX_STAMP rtMinTime = 0I64); }; This code works fine in visual studio however in Mingw GCC I get the error error: expected ')' before ';' token| error: unable to find numeric literal operator 'operator"" I64'|...

Kg to pounds converter build error (CLion)

c++,mingw,clion
I've just started to learn the C++ programming language by reading the book "C++ Primer Plus 5th addition" but I'm coming across a problem. The book just started to go into detail with functions, function prototypes, function headers and such.I decided to try and make a KG --> Pounds converter...

“dereferencing type-punned pointer” error when compiling Go 1.4.2

windows,go,mingw
I'm compiling Go from source on Windows with MinGW. When running make.bat, I get the following error: # Building C bootstrap tool. cmd/dist cmd/dist/windows.c: In function `errstr`: cmd/dist/windows.c:119: warning: deferencing type-punned pointer will break strict-aliasing rules I'm not very experienced with compiling on Windows, and it appears like this issue...

Is there any package management system for MinGW+MSYS?

gcc,mingw,apt-get,package-managers,msys
I am trying to compile some open source libraries in MinGW+MSYS. During the configure phase, I kept seeing some 3rd party libraries are missing. For now, my solution is to download the source of the missing libraries and follow the GNU build process to compile and install them into my...

COM : convert 'const GUID*' to const wchar_t*

c++,visual-studio,com,mingw
I am porting some code from VS to mingw C++ . One of the statements in my code is CFactoryTemplate g_Templates[1] = { {&CLSID_SystemClock, CSystemClock::CreateInstance} }; int g_cTemplates = sizeof(g_Templates) / sizeof(g_Templates[0]); I am getting the following error on the first statement error: cannot convert 'const GUID* {aka const _GUID*}'...

Why can't I read a C constant from Golang properly?

c,go,mingw,hdf5
I am using go-hdf5 to read an hdf5 file into golang. I am on windows7 using a pretty recent copy of mingw and hdf5 1.8.14_x86 and it seems like trying to use any of the predefined types doesn't work, let's focus for example on T_NATIVE_UINT64. I have reduced the issue...

Error using range-based for loop - Eclipse CDT Luna

templates,c++11,for-loop,mingw,eclipse-luna
I am a beginner at C++ programming. I tried to write a very simple program that combines the use of templates, passing arrays as arguments to a function and a range-based for loop. This is the program that I wrote and compiled using the Eclipse Luna CDT software. #include <iostream>...

Meteor in Git Shell (mingw)

javascript,meteor,path,mingw
I am trying to do the tutorial for Meteor JS but I can't get it to work properly using the Git Shell that comes with Github for Windows. It can't find the meteor command. It works in cmd and it is in the Windows environment path. What am I doing...