stl의 경우에는 c++의 기능중 하나인 탬플릿을 이용하여 만들어져 있기 때문에 c언어에서는 사용이 불가능합니다.
-------------------------------------------------------------------------------
It's better to appear stupid and ask question than to be silent and remain stupid.
-------------------------------------------------------------------------------
It's better to appear stupid and ask question than to be silent and remain stupid.
stl의 경우에는 c++의
stl의 경우에는 c++의 기능중 하나인 탬플릿을 이용하여 만들어져 있기 때문에 c언어에서는 사용이 불가능합니다.
-------------------------------------------------------------------------------
It's better to appear stupid and ask question than to be silent and remain stupid.
-------------------------------------------------------------------------------
It's better to appear stupid and ask question than to be silent and remain stupid.
안되는 건 아닌데
왜 힘들게 살려고 하십니까?
C++ Wrapper 함수를 만드세요.
Linkage는 extern "C".
extern "C"로 컴파일한 함수는
C처럼 Name Mangling을 하지 않기 때문에
C에서 링크할 수 있읍니다.
위엣분 말씀 대로 템플릿은 포기하세요.
Compile Time의 Instantiation이 안되니까
수동으로 미리 죄다 맨들어 놔야합니다.
___________________________________
Less is More (Robert Browning)
___________________________________
Less is More (Robert Browning)
C++로 만든
C++로 만든 라이브러리 함수를 C에서 호출하는 방법을 묻는 거라면 가능하며
기본적으로 이런 형태입니다.
라이브러리 형태로도, 오브젝트 파일의 형태로도 링크가 가능합니다.
댓글 달기