Boost und CLI



  • Hallo zusammen
    ich hab folgendes problem
    Ich will in einem CLI porjekt unter VS Studio 2008 die Boost Lib einbinden.
    sobald ich aber z.b include boost/filesystem mache
    bekomme ich folgenden error

    error LNK2028: unresolved token (0A00000F) "class boost::system::error_code __clrcall boost::filesystem2::detail::dir_itr_close(void * &)" (?dir_itr_close@detail@filesystem2@boost@@$$FYM?AVerror_code@system@3@AAPAX@Z) referenced in function "public: __clrcall boost::filesystem2::detail::dir_itr_imp<class boost::filesystem2::basic_path<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >,struct boost::filesystem2::path_traits> >::~dir_itr_imp<class boost::filesystem2::basic_path<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >,struct boost::filesystem2::path_traits> >(void)" (??1?dir_itr_imp@V?dir\_itr\_imp@V?basic_path@V?basic_string@DU?basic\_string@DU?char_traits@D@std@@V?allocator@D@2@@std@@Upath_traits@filesystem2@boost@@@filesystem2@boost@@@detail@filesystem2@boost@@allocator@D@2@@std@@Upath\_traits@filesystem2@boost@@@filesystem2@boost@@@detail@filesystem2@boost@@$FQAM@XZ)

    ich hab dem linker und dem compiler schon die boost verzeichnisse bekannt gemacht.



  • Normalerweise wird dann automatisch die entsprechende statische Lib dazugelinkt.
    Komisch.

    Nichtdestotrotz denke ich, dass es nichts mit CLI ansich zu tun hat.. oder?

    Simon



  • Für mich sieht es so aus, als ob bei einer boost Include-Datei das "#pragma unmanaged" vergessen wurde, da diese Methode jetzt auch die __crlcall calling convention hat, was boost definitiv nicht kann...



  • hab jetzt mal ein ganz neues Projekt
    New->project->clr->windows forms application gemacht

    Wenn ich die thread von boost includen will kommt folgender lnk error

    1>c:\program files\boost\boost_1_44\boost\thread\win32\thread_primitives.hpp(314) : error C2472: 'boost::detail::win32::interlocked_bit_test_and_set' cannot be generated in managed code: 'Found an intrinsic not supported in managed code'; compile with /clr to generate a mixed image

    was soll mir "compile with /clr to generate a mixed image" sagen?



  • Hallo Jochen
    ne hab ich nicht verwendet wie müßte denn der richte include lauten

    bisher mach ich einafch

    #include <boost/...>



  • Ich würde einfach mal sagen: Benutze boost nicht in einem managed (/clr) Programmm. Es macht auch gar keinen Sinn, denn für alles was boost bietet gibt es in .NET auch eine Lösung.

    Also, wie immer:
    Entweder managed oder nicht, aber nicht mischen. Glaubts doch endlich!


Anmelden zum Antworten