boost::ptr_map und MinGW: A declaration of 'assert' must be available
-
PhilippM schrieb:
1.3.9
Ich denke mal, dass du 1.39 meinst, denn vor 1.10.3 gab es noch gar keine Versionsnummern

Dann ist meine Vermutung aber sowieso falsch und weiterhelfen kann ich dir auch nicht, da ich immer noch 1.37 verwende und auf Windows einen solchen Fehler nicht erzeugen kann.Grüssli
-
hustbaer schrieb:
Probier mal das:
#include <cassert> #ifndef assert #define assert assert #endif #include <die_boost_header_um_die_es_geht.hpp>Hat leider nicht funktioniert.
Gleicher Fehler wie vorher.
Und ich meine natürlich Version 1.39.0, sorry.EDIT: Nochmal 1.37 installiert, gleiche Fehlermeldung.
Unter Linux mit gcc 4.3.2 geht's wie gesagt problemlos.
Mein MinGW hab ich mittlerweile upgedatet auf gcc 3.4.5 was neueres haben die für windows nicht.
-
Hallo,
es ist zum verzweifeln!
Ich habe schon an die boost mailingliste geschrieben aber noch keine brauchbaren Antworten erhalten.Die Vermutungen gehen dahin, dass mein include-path irgendwie falsch ist und er beim includen der assert.h durcheinanderkommt, wenn er irgendwie tief die pfade hinabgesteigen ist, keine Ahnung

Das ist meine Ausgabe, wenn ich gcc -v nach dem Include-path frage:
C:/MinGW/bin/../libexec/gcc/mingw32/3.4.5/cc1.exe -E -quiet -v -iprefix C:\MinGW\bin\../lib/gcc/mingw32/3.4.5/ - ignoring nonexistent directory "C:/MinGW/bin/../lib/gcc/mingw32/3.4.5/../../../../mingw32/include" ignoring nonexistent directory "/mingw/lib/gcc/mingw32/3.4.5/../../../../mingw32/include" #include "..." search starts here: #include <...> search starts here: C:/MinGW/bin/../lib/gcc/mingw32/3.4.5/../../../../include C:/MinGW/bin/../lib/gcc/mingw32/3.4.5/include /mingw/lib/gcc/mingw32/3.4.5/../../../../include /mingw/include /mingw/lib/gcc/mingw32/3.4.5/include /mingw/include End of search list.Irgendwelche Vorschläge?
-
Noch eine Rückfrage, gibt es auch den Fehler bei folgendem Quellcode?
#include <boost/ptr_container/ptr_map.hpp> int main() { }Denn, wie gesagt, der funktioniert bei mir, wenn ich den kompiliere:
g++ -o test.exe -I"C:\dev\libs\boost\1_37_0" test.cppIch verwende allerdings einen anderen Kompiler:
g++ (4.3.3-tdm-1 mingw32) 4.3.3 Copyright (C) 2008 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.Ich finde allerdings schon nur dein Fehler auf Linux seltsam. Kann ich nämlich auch nicht reproduzieren.
Hast du es schon mit diesem kurzen Quellcode versucht?Grüssli
-
Nun, ich programmiere eine dll, daher macht eine main funktion nicht so viel sinn.
Also hab eich jetzt nur mal folgende Datei kompiliert:
#include <boost/ptr_container/ptr_map.hpp> int test_this() { return 0; }Ergebnis:
In file included from c:/boost_1_39_0/boost/scoped_array.hpp:14, from c:/boost_1_39_0/boost/ptr_container/detail/scoped_deleter. hpp:21, from c:/boost_1_39_0/boost/ptr_container/detail/reversible_ptr_ container.hpp:21, from c:/boost_1_39_0/boost/ptr_container/detail/associative_ptr _container.hpp:20, from c:/boost_1_39_0/boost/ptr_container/ptr_map_adapter.hpp:20 , from c:/boost_1_39_0/boost/ptr_container/ptr_map.hpp:20, from test_map.cpp:1: c:/boost_1_39_0/boost/smart_ptr/scoped_array.hpp: In member function `T& boost:: scoped_array<T>::operator[](ptrdiff_t) const': c:/boost_1_39_0/boost/smart_ptr/scoped_array.hpp:80: error: there are no argumen ts to `assert' that depend on a template parameter, so a declaration of `assert' must be available c:/boost_1_39_0/boost/smart_ptr/scoped_array.hpp:80: error: (if you use `-fpermi ssive', G++ will accept your code, but allowing the use of an undeclared name is deprecated) In file included from c:/boost_1_39_0/boost/ptr_container/detail/reversible_ptr_ container.hpp:21, from c:/boost_1_39_0/boost/ptr_container/detail/associative_ptr _container.hpp:20, from c:/boost_1_39_0/boost/ptr_container/ptr_map_adapter.hpp:20 , from c:/boost_1_39_0/boost/ptr_container/ptr_map.hpp:20, from test_map.cpp:1: c:/boost_1_39_0/boost/ptr_container/detail/scoped_deleter.hpp: In constructor `b oost::ptr_container_detail::scoped_deleter<T, CloneAllocator>::scoped_deleter(si ze_t)': c:/boost_1_39_0/boost/ptr_container/detail/scoped_deleter.hpp:47: error: there a re no arguments to `assert' that depend on a template parameter, so a declaratio n of `assert' must be available c:/boost_1_39_0/boost/ptr_container/detail/scoped_deleter.hpp: In constructor `b oost::ptr_container_detail::scoped_deleter<T, CloneAllocator>::scoped_deleter(si ze_t, const T&)': c:/boost_1_39_0/boost/ptr_container/detail/scoped_deleter.hpp:58: error: there a re no arguments to `assert' that depend on a template parameter, so a declaratio n of `assert' must be available c:/boost_1_39_0/boost/ptr_container/detail/scoped_deleter.hpp: In constructor `b oost::ptr_container_detail::scoped_deleter<T, CloneAllocator>::scoped_deleter(In putIterator, InputIterator)': c:/boost_1_39_0/boost/ptr_container/detail/scoped_deleter.hpp:71: error: there a re no arguments to `assert' that depend on a template parameter, so a declaratio n of `assert' must be available In file included from c:/boost_1_39_0/boost/ptr_container/detail/reversible_ptr_ container.hpp:24, from c:/boost_1_39_0/boost/ptr_container/detail/associative_ptr _container.hpp:20, from c:/boost_1_39_0/boost/ptr_container/ptr_map_adapter.hpp:20 , from c:/boost_1_39_0/boost/ptr_container/ptr_map.hpp:20, from test_map.cpp:1: c:/boost_1_39_0/boost/ptr_container/clone_allocator.hpp: In function `T* boost:: new_clone(const T&)': c:/boost_1_39_0/boost/ptr_container/clone_allocator.hpp:35: error: there are no arguments to `assert' that depend on a template parameter, so a declaration of ` assert' must be available In file included from c:/boost_1_39_0/boost/ptr_container/detail/associative_ptr _container.hpp:20, from c:/boost_1_39_0/boost/ptr_container/ptr_map_adapter.hpp:20 , from c:/boost_1_39_0/boost/ptr_container/ptr_map.hpp:20, from test_map.cpp:1: c:/boost_1_39_0/boost/ptr_container/detail/reversible_ptr_container.hpp: In stat ic member function `static typename Config::value_type* boost::ptr_container_det ail::reversible_ptr_container<Config, CloneAllocator>::null_clone_allocator<allo w_null_values>::allocate_clone(const typename Config::value_type*)': c:/boost_1_39_0/boost/ptr_container/detail/reversible_ptr_container.hpp:111: err or: there are no arguments to `assert' that depend on a template parameter, so a declaration of `assert' must be available In file included from c:/boost_1_39_0/boost/ptr_container/ptr_map_adapter.hpp:20 , from c:/boost_1_39_0/boost/ptr_container/ptr_map.hpp:20, from test_map.cpp:1: c:/boost_1_39_0/boost/ptr_container/detail/associative_ptr_container.hpp: In mem ber function `void boost::ptr_container_detail::associative_ptr_container<Config , CloneAllocator>::multi_transfer(typename AssociatePtrCont::iterator, Associate PtrCont&)': c:/boost_1_39_0/boost/ptr_container/detail/associative_ptr_container.hpp:196: er ror: there are no arguments to `assert' that depend on a template parameter, so a declaration of `assert' must be available c:/boost_1_39_0/boost/ptr_container/detail/associative_ptr_container.hpp: In mem ber function `typename boost::ptr_container_detail::reversible_ptr_container<Con fig, CloneAllocator>::size_type boost::ptr_container_detail::associative_ptr_con tainer<Config, CloneAllocator>::multi_transfer(typename AssociatePtrCont::iterat or, typename AssociatePtrCont::iterator, AssociatePtrCont&)': c:/boost_1_39_0/boost/ptr_container/detail/associative_ptr_container.hpp:208: er ror: there are no arguments to `assert' that depend on a template parameter, so a declaration of `assert' must be available c:/boost_1_39_0/boost/ptr_container/detail/associative_ptr_container.hpp: In mem ber function `bool boost::ptr_container_detail::associative_ptr_container<Config , CloneAllocator>::single_transfer(typename AssociatePtrCont::iterator, Associat ePtrCont&)': c:/boost_1_39_0/boost/ptr_container/detail/associative_ptr_container.hpp:229: er ror: there are no arguments to `assert' that depend on a template parameter, so a declaration of `assert' must be available c:/boost_1_39_0/boost/ptr_container/detail/associative_ptr_container.hpp: In mem ber function `typename boost::ptr_container_detail::reversible_ptr_container<Con fig, CloneAllocator>::size_type boost::ptr_container_detail::associative_ptr_con tainer<Config, CloneAllocator>::single_transfer(typename AssociatePtrCont::itera tor, typename AssociatePtrCont::iterator, AssociatePtrCont&)': c:/boost_1_39_0/boost/ptr_container/detail/associative_ptr_container.hpp:245: er ror: there are no arguments to `assert' that depend on a template parameter, so a declaration of `assert' must be available
-
F*CK F*CK F*CK F*CK F*CK!!!
Ich bin sooooo dämlich!
Den Fehler hatte ich vor zwei Monaten schonmal!!!
Nur da war's auf dem Mac.
http://www.c-plusplus.net/forum/viewtopic-var-p-is-1668060.html#1668060Und ich habgenau dasselbe schon wieder vergeigt!!!
ARGHS!
Kopf->tisch *Deng*!!!Danke an alle, die hier ihre Zeit vergeudet haben, um mich auf ein bekanntes Problem draufzuheben *rotwerd*
@Dravere: wie kannst du denn unter MinGW den 4.3.3 er gcc benutzen? Das neueste, was ich bei MinGW mitinstallieren kann, ist 3.4.5. Gibts irgendwo eine "geheimen" gcc 4.3.3 für MinGW? wo?
-
gelöscht
-
Also die Nuwen MinGW Dist benutzt gcc 4.3.3:
-
PhilippM schrieb:
@Dravere: wie kannst du denn unter MinGW den 4.3.3 er gcc benutzen? Das neueste, was ich bei MinGW mitinstallieren kann, ist 3.4.5. Gibts irgendwo eine "geheimen" gcc 4.3.3 für MinGW? wo?
Ich habe in Windows seit Ewigkeiten nicht mehr aktualisiert, aber
D:\src\research\AtomTable\bin\Debug>gcc -v Using built-in specs. Target: mingw32 Configured with: ../gcc-4.3.0/configure --enable-languages=c,ada,c++,fortran,jav a,objc,obj-c++ --disable-sjlj-exceptions --enable-shared --enable-libgcj --enabl e-libgomp --with-dwarf2 --disable-win32-registry --enable-libstdcxx-debug --enab le-concept-checks --enable-version-specific-runtime-libs --build=mingw32 --with- bugurl=http://www.mingw.org/bugs.shtml --prefix=/mingw --with-gmp=/mingw/src/gcc /gmp-mpfr-root --with-mpfr=/mingw/src/gcc/gmp-mpfr-root --with-libiconv-prefix=/ mingw/src/gcc/libiconv-root Thread model: win32 gcc version 4.3.0 20080305 (alpha-testing) mingw-20080502 (GCC)Habe halt nicht den Auto-Installer genommen, sondern die Pakete gesaugt, entpackt und C:/MinGW kopiert. Kann sein, daß der Auto-Installer nur als stabil bekannte Versionen kennt.
-
Ich würde die Nuwen Distro nicht empfehlen.
Check dir lieber die einzelnen Pakete von der "original" MinGW Seite, so wie volkard geschrieben hat.
-
