Использование STL в Mac 10.5 SDK - PullRequest
0 голосов
/ 28 марта 2012

Надеюсь, это больше относится к StackOverflow, чем mac.stackexchange ...

Я использую ARToolkit для проекта дополненной реальности, и для того, чтобы он работал под Mac, мне нужно запустить 10.5 SDK.

Моя проблема в том, что я не могу включить ни один из заголовочных файлов STL ... особенно векторный.

Могу ли я использовать какую-нибудь оболочку или обходной путь? Я в основном компилирую простой код на C и хотел бы использовать некоторые из более приятных возможностей инфраструктуры STL для ускорения разработки ...


Edit:

При ближайшем рассмотрении выясняется, что ARToolkit включает std_vector в некоторый момент в своем пути включения.

Фрагмент ошибки:

Bits/c++allocator.h: No such file or directory
Expected template-name before '<' token
Expected `{' before '<' token
Expected unqualified-id before '<' token
/Developer/SDKs/MacOSX10.5.sdk/usr/include/c++/4.2.1/iosfwd
Bits/c++locale.h: No such file or directory
Bits/c++io.h: No such file or directory
/Developer/SDKs/MacOSX10.5.sdk/usr/include/c++/4.2.1/bits/stl_algobase.h
Bits/c++config.h: No such file or directory
/Developer/SDKs/MacOSX10.5.sdk/usr/include/c++/4.2.1/bits/stl_vector.h
Expected type-specifier before 'allocator'
Expected '>' before 'allocator'
'input_iterator_tag' has not been declared
'forward_iterator_tag' has not been declared
'input_iterator_tag' has not been declared
'forward_iterator_tag' has not been declared
'input_iterator_tag' has not been declared
'forward_iterator_tag' has not been declared
There are no arguments to '__N' that depend on a template parameter, so a declaration of '__N' must be available
(if you use '-fpermissive', G++ will accept your code, but allowing the use of an undeclared name is deprecated)
Expected nested-name-specifier before 'iterator_traits'
Expected initializer before '<' token
There are no arguments to '_IterCategory' that depend on a template parameter, so a declaration of '_IterCategory' must be available
Expected nested-name-specifier before 'iterator_traits'
Expected initializer before '<' token
There are no arguments to '_IterCategory' that depend on a template parameter, so a declaration of '_IterCategory' must be available
Expected nested-name-specifier before 'iterator_traits'
Expected initializer before '<' token
There are no arguments to '_IterCategory' that depend on a template parameter, so a declaration of '_IterCategory' must be available
/Users/espais/research/artoolkit/trunk/artoolkit/examples/newproject/newproject.cpp
Expected `}' at end of input
/Developer/SDKs/MacOSX10.5.sdk/usr/include/c++/4.2.1/bits/stl_bvector.h
Expected template-name before '<' token
Expected `{' before '<' token
Expected unqualified-id before '<' token

Ответы [ 2 ]

0 голосов
/ 06 июля 2012

По сути, была какая-то хитрость, которую нужно было сделать за кулисами. Мне пришлось обновить мой локальный SDK (оказывается, ARToolkit поддерживает более новые версии, независимо от того, что написано в их документации), а затем библиотеки STL сработали.

0 голосов
/ 28 марта 2012

Возможно, вам потребуется сделать файл .mm (Objective-C ++) вместо .m (Objective-C).

Кроме этого, не должно быть никаких проблем с выполнением #include <vector>.

...