mingw

How to add 3rd party libraries to MinGW?

人走茶凉 提交于 2020-01-02 01:07:09
问题 I've just set up MinGW environment following this post But how to add 3rd party libraries to it? 回答1: A library consists of two main components - the C header files and the compiled object code archive. GCC has a bewildering array of ways of specifying these things, but let's say you are using a library foo.a which lives in the relative directory path foo/lib , and a header foo.h which lives in foo/inc . Your own C code lives in main.c and looks like this: #include "foo.h" int main() { return

Build protobuf on Windows with MinGW

送分小仙女□ 提交于 2020-01-01 15:36:19
问题 I have been following the steps in Peter's answer to How to build Google's protobuf in Windows using MinGW? but make does not complete and errors out. I am on Win64 and have MinGW with installed the mingw-developer-toolkit , mingw32-base , mingw-gcc-g++ , msys-base and additionally mingw32-phtreads-w32 . Under MinGW/msys/1.0 I create the folder /home/<username> and paste the protobuf-3.1.0 source downloaded from github. I open an MSYS shell, cd into the protobuf dir and run ./autoconfig : the

Cannot find -lpthread?

浪尽此生 提交于 2020-01-01 11:58:12
问题 I am new to C programming. I was trying to use the pthread API to write some concurrent program. I downloaded eclipse IDE for C/C++ Developers, MinGW. I have put all the library, header files into the corresponding location of the MinGW file. When I tried to build the project, there is always an error "cannot find -lpthread", what happened? I have added the "-pthread" to the GCC compiler. I have searched a lot in Google but seems no one have similar problem as me. 回答1: The answer to this

Maven error in MINGW Git bash: Could not find or load main class org.codehaus.plexus.classworlds.launcher.Launcher

陌路散爱 提交于 2020-01-01 07:57:08
问题 I'm aware of the fact that this issue has been discussed in several questions but no answer solved my specific issue. I have installed Git bash and Maven and I'm trying to execute Maven with Git bash. It aborts with the mentioned error. My system environment: Windows 7 Git 2.13.3 Maven 3.5.0 The required user variables: HOME=%HOMEPATH% M3_HOME=%MAVEN_HOME% MAVEN_HOME=path-with-no-blanks Path=%MAVEN_HOME%\bin Maven works fine on Windows command prompt and Cygwin. Only MINGW-based Git bash

unable to see the output of c++ program in the console

删除回忆录丶 提交于 2020-01-01 07:23:10
问题 I have installed the eclipse ide(cdt) on my windows 8 laptop and tried writing a simple c program to check whether the program executes. It did not execute and gave the error : binary not found . So I did some searching online and realized that my system did not have a c/c++ compiler installed. So I installed MinGW and selected the c and c++ compilers during installation. Then I set the PATH environment variable to C:\MinGW. I reopened eclipse, wrote a simple c program and it worked as

Opencv C++ MinGW VSCode fatal error to compile

心已入冬 提交于 2020-01-01 05:35:12
问题 Hi all I want to use VSCode MinGW C++ and OpenCV to create a simple opencv project but for an unknown reason, I get this error what should I do? I want to mention that in Visual studio 2017 works I can run the main.cpp on x64 architecture. The code below is what I want to run on VSCode is the same code I run on the Visual Studio 2017. After 10 days of trying I give up 50 points if someone proves that with: VSCODE C++17 Opencv on Windows 10 x64 Architecture A successful build. src/main.cpp

MinGW/Eclipse ld.exe does not find libraries

妖精的绣舞 提交于 2020-01-01 04:37:30
问题 I am using Eclipse CDT to try to compile a project with the Ogre 3D engine. But somehow mingw is not able to find the static libraries I link against. These are the error messages: c:/mingw/bin/../lib/gcc/mingw32/4.6.1/../../../../mingw32/bin/ld.exe: cannot find -lzziplib_d c:/mingw/bin/../lib/gcc/mingw32/4.6.1/../../../../mingw32/bin/ld.exe: cannot find -lzlib_d c:/mingw/bin/../lib/gcc/mingw32/4.6.1/../../../../mingw32/bin/ld.exe: cannot find -lfreetype_d ...etc. The list goes on like this

Error while building Linphone for windows

情到浓时终转凉″ 提交于 2020-01-01 04:31:06
问题 I am trying to build linphone for windows by following the instructions in Readme.mingw using MinGw/Msys. There is no issues till the download of belle-sip package. When I run ./autogen.sh I am getting the below error. Generating buildipts in belle-sip... + libtoolize --copy --force libtoolize: $pkgltdldir is not a directory: `/mingw/share/libtool' + aclocal -I /share/aclocal Can't locate Automake/Config.pm in @INC (@INC contains: /mingw/share/automake-1. 11 /usr/lib/perl5/5.8/msys /usr/lib

Sublime Text 2 and MinGW

家住魔仙堡 提交于 2020-01-01 03:29:07
问题 Good day! Can anyone share their experience how to attach MinGW-compiler to Sublime? I found a config in the internet, but when I run compiled program popping bugs with missing files from "../MinGW/bin/". Config: { "cmd": ["mingw32-g++.exe", "-o", "$file_base_name", "$file_name"], "path": "c:\\Program Files\\MinGW\\bin\\" } Thanks! UPD I found answer for my question! I had to add one parameter in cmd . It's "-static" . So, it's my MinGW.sublime-build , which works fine: { "path": "c:\\Program

Statically linking libraries in MinGW

霸气de小男生 提交于 2020-01-01 03:00:08
问题 Suppose I have three C source files. The first two to be LIBs (lib*.a?), and the third is an application which uses them. The first is (re.c): int re(int i) { return i; } The second is (test.c): int re(int); // Depends on re.c int test(int i) { return re(i); } And the third is (main.c): #include<stdio.h> int test(int); // Uses test.c int main(void) { printf("%d\n",test(0)); return 0; } Now how can I create the first two LIBs in such a way that allows me to statically link them later with main