Results 1 to 6 of 6

Thread: Build QTCreator boost::filesystem

  1. #1
    Join Date
    Mar 2010
    Posts
    92
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60

    Default Build QTCreator boost::filesystem

    i read lib boost in http://www.boost.org/doc/libs/1_42_0.../file_size.cpp then build on QTCreator but it error,can you help Me debug source ?


    Qt Code:
    1. #include <boost/filesystem/operations.hpp>
    2. #include <iostream>
    3. namespace fs = boost::filesystem;
    4. int main( int argc, char* argv[] )
    5. {
    6. if ( argc != 2 )
    7. {
    8. std::cout << "Usage: file_size path\n";
    9. return 1;
    10. }
    11. std::cout << "sizeof(intmax_t) is " << sizeof(boost::intmax_t) << '\n';
    12. fs::path p( argv[1], fs::native );
    13.  
    14. if ( !fs::exists( p ) )
    15. {
    16. std::cout << "not found: " << argv[1] << std::endl;
    17. return 1;
    18. }
    19. if ( !fs::is_regular( p ) )
    20. {
    21. std::cout << "not a regular file: " << argv[1] << std::endl;
    22. return 1;
    23. }
    24. std::cout << "size of " << argv[1] << " is " << fs::file_size( p )
    25. << std::endl;
    26. return 0;
    27. }
    To copy to clipboard, switch view to plain text mode 


    **/boost_1_42_0/boost/system/error_code.hpp:208: undefined reference to `boost::system::get_system_category()'**


    my source code
    http://www.mediafire.com/?inzzmlwwm4w

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Build QTCreator boost::filesystem

    Did you link your application against boost library?
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  3. #3
    Join Date
    Mar 2010
    Posts
    92
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60

    Default Re: Build QTCreator boost::filesystem

    my source http://www.mediafire.com/?inzzmlwwm4w
    i link source into boost source (not binary),can you help me ?

  4. #4
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Build QTCreator boost::filesystem

    Obviously you didn't link the body of the method your compiler complains about.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  5. #5
    Join Date
    Mar 2010
    Posts
    92
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60

    Default Re: Build QTCreator boost::filesystem

    can you config .pro file ?

    #-------------------------------------------------
    #
    # Project created by QtCreator 2010-03-30T04:29:20
    #
    #-------------------------------------------------

    QT -= gui

    TARGET = QTBoost_Simple
    CONFIG += console
    CONFIG -= app_bundle
    TEMPLATE = app
    SOURCES += main.cpp
    INCLUDEPATH += D:/CD_LAP_TRINH/cach_su_dung_thu_vien_boost/boost_1_42_0
    i dont link .lib , .a ( library binary ),but i think it loss link,can you help me ?

  6. #6
    Join Date
    Mar 2010
    Posts
    92
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60

    Default Re: Build QTCreator boost::filesystem

    if i write in .pro is
    #-------------------------------------------------
    #
    # Project created by QtCreator 2010-03-30T04:29:20
    #
    #-------------------------------------------------

    QT -= gui

    TARGET = QTBoost_Simple
    CONFIG += console
    CONFIG -= app_bundle
    TEMPLATE = app
    SOURCES += main.cpp
    INCLUDEPATH += D:/CD_LAP_TRINH/cach_su_dung_thu_vien_boost/boost_1_42_0
    LIBS += C:/Users/BotNetVN/Desktop/QTBoost_Simple/libboost_filesystem-vc90-mt-1_42.lib C:/Users/BotNetVN/Desktop/QTBoost_Simple/libboost_system-vc90-mt-1_42.lib
    then Qtcreator error


    Running build steps for project QTBoost_Simple...
    Starting: i:/programfiles/qt/bin/qmake.exe C:/Users/BotNetVN/Desktop/QTBoost_Simple/QTBoost_Simple.pro -spec win32-g++ -r
    Exited with code 0.
    Starting: I:/ProgramFiles/mingw/bin/mingw32-make.exe -w
    mingw32-make: Entering directory `C:/Users/BotNetVN/Desktop/QTBoost_Simple'
    I:/ProgramFiles/mingw/bin/mingw32-make -f Makefile.Debug
    mingw32-make[1]: Entering directory `C:/Users/BotNetVN/Desktop/QTBoost_Simple'
    g++ -enable-stdcall-fixup -Wl,-enable-auto-import -Wl,-enable-runtime-pseudo-reloc -Wl,-subsystem,console -mthreads -Wl -o debug\QTBoost_Simple.exe debug/main.o -L"i:\ProgramFiles\qt\lib" C:/Users/BotNetVN/Desktop/QTBoost_Simple/libboost_filesystem-vc90-mt-1_42.lib C:/Users/BotNetVN/Desktop/QTBoost_Simple/libboost_system-vc90-mt-1_42.lib -lQtCored4
    mingw32-make[1]: Leaving directory `C:/Users/BotNetVN/Desktop/QTBoost_Simple'
    mingw32-make: Leaving directory `C:/Users/BotNetVN/Desktop/QTBoost_Simple'
    debug/main.o: In function `main':
    C:\Users\BotNetVN\Desktop\QTBoost_Simple/main.cpp:12: undefined reference to `boost::filesystem::native(std::string const&)'
    debug/main.o: In function `_static_initialization_and_destruction_0':
    d:/CD_LAP_TRINH/cach_su_dung_thu_vien_boost/boost_1_42_0/boost/system/error_code.hpp:208: undefined reference to `boost::system::get_system_category()'
    d:/CD_LAP_TRINH/cach_su_dung_thu_vien_boost/boost_1_42_0/boost/system/error_code.hpp:209: undefined reference to `boost::system::get_generic_category()'
    d:/CD_LAP_TRINH/cach_su_dung_thu_vien_boost/boost_1_42_0/boost/system/error_code.hpp:214: undefined reference to `boost::system::get_generic_category()'
    d:/CD_LAP_TRINH/cach_su_dung_thu_vien_boost/boost_1_42_0/boost/system/error_code.hpp:215: undefined reference to `boost::system::get_generic_category()'
    d:/CD_LAP_TRINH/cach_su_dung_thu_vien_boost/boost_1_42_0/boost/system/error_code.hpp:216: undefined reference to `boost::system::get_system_category()'
    debug/main.o: In function `error_code':
    d:/CD_LAP_TRINH/cach_su_dung_thu_vien_boost/boost_1_42_0/boost/system/error_code.hpp:315: undefined reference to `boost::system::get_system_category()'
    debug/main.o:d:/CD_LAP_TRINH/cach_su_dung_thu_vien_boost/boost_1_42_0/boost/filesystem/operations.hpp:293: undefined reference to `boost::filesystem::detail::status_api(std::string const&, boost::system::error_code&)'
    debug/main.o:d:/CD_LAP_TRINH/cach_su_dung_thu_vien_boost/boost_1_42_0/boost/filesystem/operations.hpp:324: undefined reference to `boost::filesystem::detail::status_api(std::string const&, boost::system::error_code&)'
    debug/main.o:d:/CD_LAP_TRINH/cach_su_dung_thu_vien_boost/boost_1_42_0/boost/filesystem/operations.hpp:390: undefined reference to `boost::filesystem::detail::file_size_api(std::str ing const&)'

    collect2: ld returned 1 exit status
    mingw32-make[1]: *** [debug\QTBoost_Simple.exe] Error 1
    mingw32-make: *** [debug] Error 2
    Exited with code 2.
    Error while building project QTBoost_Simple
    When executing build step 'Make'


    download
    libboost_filesystem-vc90-mt-1_42.lib
    libboost_system-vc90-mt-1_42.lib
    http://www.mediafire.com/?nzmyzqyd1m5


    and My source code: http://www.mediafire.com/?2gzoyloyqt5
    Last edited by nhs_0702; 1st April 2010 at 07:50.

Similar Threads

  1. How to display entire directory(Filesystem)
    By deepakn in forum Newbie
    Replies: 11
    Last Post: 10th November 2009, 09:58
  2. how to use boost multi_array in QtCreator
    By elflord in forum Qt Programming
    Replies: 2
    Last Post: 1st April 2009, 07:37
  3. I Can't use QtCreator to static build my application
    By kyosold in forum Installation and Deployment
    Replies: 3
    Last Post: 6th January 2009, 10:20
  4. gtk not working in qt filesystem
    By apulu in forum Newbie
    Replies: 11
    Last Post: 18th April 2008, 10:22

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.