Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
723 views
in Technique[技术] by (71.8m points)

qt - Compile Poco with MinGW on Windows

I need to compile poco with MinGW so I can use it in Qt Creator but cannot figure out how to, I've managed to compile poco in Visual Studio but I cannot use those libraries in Qt Creator.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

With this enviroment:

  • MinGW (GCC 4.7.0) + MSYS
  • Poco 1.4.6 (downloaded at 5 febrery 2013)

This is how I configure and compile Poco for MinGW and Windows 7:

  1. Extract Poco into a folder of your choice. C:/ for this example.
  2. Apply the next path to avoid copysign error.(From https://github.com/pocoproject/poco/issues/57).

    In the file C:poco-1.4.6FoundationincludePocoFPEnvironment_DUMMY.h

    Delete the string std:: in this method:

    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
    }
    

    And here too:

    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
    }
    
  3. Modify MinGW configuration at C:poco-1.4.6uildconfigMinGW. (From http://cidebycide.blogspot.com.es/2012/06/building-poco-c-witn-mingw.html)

    You should delete the -mno-cygwin string in line:

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

    and

    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
    

    If you don't need to use cryptography and SSL, you should remove the options -lssl, and -lcrypto at SYSLIBS line.

  4. Compile Poco without demos, SSL, cryptography and ODBC support:

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

Good luck!


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...