Boost Library



  • Hallo.

    Ich habe mir die boost library heruntergeladen und entpackt.
    dann hab ich die Systemvariable VC71_ROOT gesetzt
    und dann mit
    bjam "-sTOOLS=vc" install
    installiert
    Dann noch in VC++ die Pfade zu den Include/Lib Ordnern gelegt

    Wenn ich nun folgendes kleines Testprogramm compilieren will (Mit Thread Option /Mt):

    #include <iostream>
    #include <boost/thread.hpp>
    
    int main(int argc, char **argv)
    {
      return 0;
    }
    

    kommt ein fatal error C1189: #Fehler: "Mixing a dll boost library wirh a static runtime is a really bad idea ..."

    Wo muss ich vielleicht noch irgendwelche Parameter beim builden der lib übergeben. Wo hab ich was übersehen?

    Danke.



  • Ich kenne zwar nur VC6, ich vermute aber mal das du deine Anwendungen gegen die statische "Version" der Laufzeitumgebung linkst, andererseits jedoch die dynamische Version von BOOST hinzulinken willst. Das geht nicht nicht, beides muss zusammnepassen. Bei einem "Standard"-Build werden im allgemeinen alle Versionen von BOOST erstellt, du musst nur die richtige auswählen.
    Achte auch auf die Unterscheidung zwischen Debug und Release.



  • versuch mal einzustellen das er die runtime dlls dynamisch benutzt und nich statisch....

    ich missbrauch gleichmal den thread für meine zwecke noch:

    ich hab bei boost thread auch nen fehler, zwar, hab ich das ganze mit stlport package kompiliert (hat auch geklappt), nur wenn ich jetz ein programm mit boost::thread erstellen will heisst es:

    warning: STLPort debug versions are built with /D_STLP_DEBUG=1
    c:\Boost\include\boost\config\auto_link.hpp(165) : fatal error C1189: #error :  "Build options aren't compatible with pre-built libraries"
    


  • Ich habe um den DLL-Error wegzubekommen, die ganzen DLLs in mein Debug- und Release-Verzeichnis meines Projektes kopiert. Und als Codegeneration-Option (in den Projekteinstellungen) Multithreaded DLL gewählt (bzw. Multithr. DLL debug im Debug-Modus).

    Zumindest sind dann die Errors weg, Warnings bekomme ich stattdessen:

    c:\boost\include\boost-1_31\boost\thread\mutex.hpp(36) : warning C4275: class 'boost::noncopyable' ist keine DLL-Schnittstelle und wurde als Basisklasse fuer die DLL-Schnittstelle class 'boost::mutex' verwendet
            c:\boost\include\boost-1_31\boost\noncopyable.hpp(22) : Siehe Deklaration von 'noncopyable'
    c:\boost\include\boost-1_31\boost\thread\mutex.hpp(74) : warning C4275: class 'boost::noncopyable' ist keine DLL-Schnittstelle und wurde als Basisklasse fuer die DLL-Schnittstelle class 'boost::try_mutex' verwendet
            c:\boost\include\boost-1_31\boost\noncopyable.hpp(22) : Siehe Deklaration von 'noncopyable'
    c:\boost\include\boost-1_31\boost\thread\mutex.hpp(114) : warning C4275: class 'boost::noncopyable' ist keine DLL-Schnittstelle und wurde als Basisklasse fuer die DLL-Schnittstelle class 'boost::timed_mutex' verwendet
            c:\boost\include\boost-1_31\boost\noncopyable.hpp(22) : Siehe Deklaration von 'noncopyable'
    c:\boost\include\boost-1_31\boost\thread\thread.hpp(38) : warning C4275: class 'boost::noncopyable' ist keine DLL-Schnittstelle und wurde als Basisklasse fuer die DLL-Schnittstelle class 'boost::thread' verwendet
            c:\boost\include\boost-1_31\boost\noncopyable.hpp(22) : Siehe Deklaration von 'noncopyable'
    c:\boost\include\boost-1_31\boost\thread\thread.hpp(67) : warning C4275: class 'boost::noncopyable' ist keine DLL-Schnittstelle und wurde als Basisklasse fuer die DLL-Schnittstelle class 'boost::thread_group' verwendet
            c:\boost\include\boost-1_31\boost\noncopyable.hpp(22) : Siehe Deklaration von 'noncopyable'
    c:\boost\include\boost-1_31\boost\thread\thread.hpp(78) : warning C4251: 'm_threads' : class 'std::list<class boost::thread *,class std::allocator<class boost::thread *> >' benoetigt eine DLL-Schnittstelle, die von Clients von class 'boost::thread_g
    roup' verwendet wird
    c:\boost\include\boost-1_31\boost\thread\condition.hpp(38) : warning C4275: class 'boost::noncopyable' ist keine DLL-Schnittstelle und wurde als Basisklasse fuer die DLL-Schnittstelle class 'boost::detail::condition_impl' verwendet
            c:\boost\include\boost-1_31\boost\noncopyable.hpp(22) : Siehe Deklaration von 'noncopyable'
    c:\boost\include\boost-1_31\boost\thread\recursive_mutex.hpp(34) : warning C4275: class 'boost::noncopyable' ist keine DLL-Schnittstelle und wurde als Basisklasse fuer die DLL-Schnittstelle class 'boost::recursive_mutex' verwendet
            c:\boost\include\boost-1_31\boost\noncopyable.hpp(22) : Siehe Deklaration von 'noncopyable'
    c:\boost\include\boost-1_31\boost\thread\recursive_mutex.hpp(77) : warning C4275: class 'boost::noncopyable' ist keine DLL-Schnittstelle und wurde als Basisklasse fuer die DLL-Schnittstelle class 'boost::recursive_try_mutex' verwendet
            c:\boost\include\boost-1_31\boost\noncopyable.hpp(22) : Siehe Deklaration von 'noncopyable'
    c:\boost\include\boost-1_31\boost\thread\recursive_mutex.hpp(123) : warning C4275: class 'boost::noncopyable' ist keine DLL-Schnittstelle und wurde als Basisklasse fuer die DLL-Schnittstelle class 'boost::recursive_timed_mutex' verwendet
            c:\boost\include\boost-1_31\boost\noncopyable.hpp(22) : Siehe Deklaration von 'noncopyable'
    c:\boost\include\boost-1_31\boost\thread\tss.hpp(32) : warning C4275: class 'boost::noncopyable' ist keine DLL-Schnittstelle und wurde als Basisklasse fuer die DLL-Schnittstelle class 'boost::detail::tss' verwendet
            c:\boost\include\boost-1_31\boost\noncopyable.hpp(22) : Siehe Deklaration von 'noncopyable'
    Linker-Vorgang läuft...
    

    Aber die Thread-Klasse arbeitet soweit trotzdem super.



  • Danke. Hat super geklapt!

    Bei mir laufen die Threads jetzt acuh einwandfrei, aber ich bekomme auch diese lange Liste an Warnings.


Anmelden zum Antworten