2012-03-28 4 views
0

는 희망이사용 STL은

가 나는 그것이 맥에서 작동하도록하기 위해 증강 현실 프로젝트 ARToolkit을 사용하고 있어요

내가 필요 ... mac.stackexchange 이상에 StackOverflow에 더 관련이 10.5 SDK를 실행하십시오.

내 문제는 내가 STL 헤더 파일 중 하나를 포함 할 수 없다는 것입니다 ... 특히 벡터.

사용할 수있는 래퍼 또는 해결 방법이 있습니까?

가까이 검사에서

,이 나타납니다 : 나는


편집 ... 기본적으로 직선 C 코드를 컴파일하고, 개발을 가속화하기 위해 STL 프레임 워크의 멋진 기능 중 일부를 사용하고 싶습니다 ARToolkit은 포함 경로의 어느 시점에서 std_vector를 포함합니다.

오류 조각 : 당신은 대신 .m (목표 - C)의 파일 .mm 파일 (목표 - C++를)해야 할 수도 있습니다

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 
+0

왜 STL 헤더 파일을 포함 할 수 없습니까? 당신이 할 때 어떻게됩니까? –

+1

STL은 C++ 표준 라이브러리의 일부입니다. 컴파일하는 것이 "기본적으로 직선적 인 C 코드"라면, 아마 그게 문제 일 수 있겠습니까? ;) – jalf

+0

참 ... 내가 어떻게 든 C++로 컴파일러를 바꿀 수 있기를 바랐다. (현재 유일한 옵션은 LLVM GCC 4.2와 Apple LLVM 컴파일러 3.0이다.) – espais

답변

0

기본적으로 장면 뒤에서해야 할 몇 가지 속임수가있었습니다. 로컬 SDK를 업데이트해야했습니다 (ARToolkit이 새 버전을 지원하는지 여부에 관계없이). 그런 다음 STL 라이브러리가 작동했습니다.

0

.

그 외의 경우에는 #include <vector>을 수행하는 데 문제가 없어야합니다.

+0

실제로는 .C 파일입니다. 나는 컴파일러를 C++로 바꿀 수 있기를 바랐지만, 목록에 gcc 만있다. – espais

+0

프로젝트 빌드 설정으로 가서 GCC 4.2 언어 섹션에서 '파일 유형에 따라'대신 '소스 컴파일'에서 'C++'을 선택하십시오. – StilesCrisis

+0

잘 작동하지만, 일단 벡터 헤더를 포함하면 오류가 200보다 많습니다 ... – espais