Compiling Poco with MinGW on Windows

I need to compile poco with MinGW so that I can use it in Qt Creator, but I can’t figure out how to do it, I managed to compile poco in Visual Studio, but I can’t use these libraries in Qt Creator.

+5
source share
5 answers

In addition to Cesar's answer (here instead of adding a comment for formatting) you need something like this in your .pro file:

INCLUDEPATH += "<path_to_poco_include_dir>"
LIBS += -L"<path_to_poco_lib_dir>" -l<poco_lib> -l<poco_lib>

For example, in my case, I would have this (for debug builds):

INCLUDEPATH += "C:/Dev/lib/poco/poco143/Debug/include"
LIBS += -L"C:/Dev/lib/poco/poco143/lib" -lPocoFoundationd -lPocoUtild

Then you can refine this a bit by creating settings for both debugging and release:

LIB_HOME = "C:/Dev/lib/"
POCO_HOME = $${LIB_HOME}poco/poco143/

# SEE http://www.qtcentre.org/threads/23655-Does-Qt-Creator-understand-debug-release-scopes-in-pro-files
# OR http://www.qtcentre.org/threads/30430-How-to-set-pro-file-about-debug-and-release
####
CONFIG(debug, debug|release) {
CONFIG -= debug release
CONFIG += debug
}

CONFIG(release, debug|release) {
CONFIG -= debug release
CONFIG += release
}
####

debug {
POCO_DEBUG = d
POCO_PATH = $${POCO_HOME}Debug
}

release {
POCO_DEBUG =
POCO_PATH = $${POCO_HOME}Release
}

INCLUDEPATH += "$${POCO_PATH}/include"
LIBS += -L"$${POCO_PATH}/lib" -lPocoFoundation$${POCO_DEBUG} -lPocoUtil$${POCO_DEBUG}

Hope this helps.

+2
source

With this environment:

  • MinGW (GCC 4.7.0) + MSYS
  • Poco 1.4.6 (loaded on February 5, 2013).

Poco MinGW Windows 7:

  • Poco . C:/ .
  • , copysign. ( https://github.com/pocoproject/poco/issues/57).

    C:\poco-1.4.6\Foundation\include\Poco\FPEnvironment_DUMMY.h

    std:: :

    inline float FPEnvironmentImpl::copySignImpl(float target, float source)
    {
    #if defined(__APPLE__) || defined(POCO_ANDROID)
        return copysignf(target, source);
    #else
        return /*std::*/copysignf(target, source);
    #endif
    }
    

    :

    inline double FPEnvironmentImpl::copySignImpl(double target, double source)
    {
    #if defined(__APPLE__) || defined(POCO_ANDROID)
        return copysign(target, source);
    #else
        return /*std::*/copysign(target, source);
    #endif
    }
    
  • MinGW C:\poco-1.4.6\build\config\MinGW. ( http://cidebycide.blogspot.com.es/2012/06/building-poco-c-witn-mingw.html)

    -mno-cygwin :

    SHLIB   = $(CXX) -shared -mno-cygwin -o $@ -Wl,--out-implib=$(dir $@)$(subst cyg,lib,$(basename $(notdir $@))).a
    

    SYSFLAGS = -mno-cygwin -D_WIN32 -DMINGW32 -DWINVER=0x500 -DPOCO_NO_FPENVIRONMENT -DPCRE_STATIC -DPOCO_THREAD_STACK_SIZE -DFoundation_Config_INCLUDED -I/usr/local/include -I/usr/include
    

    SSL, -ssl -lcrypto SYSLIBS.

  • Poco , SSL, ODBC:

    $ ./configure --omit=NetSSL_OpenSSL,Crypto,Data/ODBC,Data/MySQL --prefix=./_INSTALL
    $ make clean
    $ make -j4 -nodemos
    $ make install
    

!

+8

POCO MinGW , , ( "" ), MinGW; -, . .

+3

, :

strip: '/Learn/POCO/poco-1.4.6p2/lib/MinGW/ia32/libPocoFoundation.dll.exe':

"build\rules\global"

STRIPCMD = $(STRIP) $@$(BINEXT) 

to

STRIPCMD = $(STRIP) $@$
0

MSYS2, ( ) POCO C++ 1.9.0.

  • , MSYS2 msys2.org.
  • pacman ( Arch Linux), POCO C++, : pacman -Ss poco , poco . :
$ pacman -Ss poco
mingw32/mingw-w64-i686-poco 1.9.0-1
    POrtable COmponents C++ Libraries (mingw-w64)
mingw64/mingw-w64-x86_64-poco 1.9.0-1
    POrtable COmponents C++ Libraries (mingw-w64)
  • 64- mingw64/mingw-w64-x86_64-poco pacman :
$ pacman -S mingw64/mingw-w64-x86_64-poco
  • , , , POCO C++. msys2

    • C:\msys64\mingw64\bin ( DLL )
    • C:\msys64\mingw64\lib(came here C:\msys64\mingw64\lib)
0
source

All Articles