[UNIX/SUN] Template에서 컴파일 에러가 나네요..알려주세요..
제가 올릴 소스는 window 와 Linux에서는 문제 없이 컴파일이 되던 소스인데 Sun에서 컴파일 하니 STL Template 쪽에서 에러가 발생합니다..컴파일 내용을 보면 아시겠지만 다른 디렉토리에 있는 Template 헤더파일을 include하다가 에러가 납니다..
컴파일 옵션에 문제가 있는지 소스에 문제가 있는지 알려주시면 감사하겠습니다..
Computer 사양
Hardware : sun4u
OS : 5.8
Compiler : Sun ONE Studio 8 C++ 5.5
Compile 옵션
CC -g -c -instances=extern -KPIC relativeOp.cpp
Error
sun1% make
CC -g -c -instances=extern -KPIC relativeOp.cpp
"../include/StdString.h", line 54: Error: Unexpected type name "A" encountered.
"/app/SUNWspro/prod/include/CC/Cstd/./functional", line 327: Where: While instantiating "SSToUpper<char>::operator()(const char&, const std::locale&) const".
"/app/SUNWspro/prod/include/CC/Cstd/./functional", line 327: Where: Instantiated from std::transform<char*, char*, std::binder2nd<SSToUpper<char>>>(char*, char*, char*, std::binder2nd<SSToUpper<char>>).
"../include/StdString.h", line 265: Where: Instantiated from non-template code.
1 Error(s) and 3 Warning(s) detected.
*** Error code 1
make: Fatal error: Command failed for target `relativeOp.o'
template<typename ARG> struct FmtArg { const ARG& a_; explicit FmtArg(const ARG& arg) : a_(arg) {} const ARG& operator()() const { return a_; } private: FmtArg& operator=(const FmtArg&) { return *this; } }; template<class A> struct SSToUpper : public std::binary_function<A, std::locale, A> { inline A operator()(const A& t, const std::locale& loc) const { return std::toupper<A>(t, loc); } }; template<typename CT> struct SSToLower : public std::binary_function<CT, std::locale, CT> { inline CT operator()(const CT& t, const std::locale& loc) const { return std::tolower<CT>(t, loc); } }; // 실제 위 템플릿을 사용하는 부분의 일부 - 같은 헤더에 있음 class CStdString { void MakeUpper() { std::transform(_string.begin(), _string.end(), _string.begin(), std::bind2nd(SSToUpper<TCHAR>(), std::locale())); }
답변 부탁드리겠습니다..
Sun에서의 컴파일 옵션에 대해서는 모릅니다만 코드에는 문제가 없는 것
Sun에서의 컴파일 옵션에 대해서는 모릅니다만 코드에는 문제가 없는 것 같습니다.
혹시 모르니까
이런 식으로 해보세요.
헤더파일 에러
리눅스라는 놈하고 좀 친해져 볼려고 처음으로 사용하게된 유져입니다.
그런데, 렌드라이브를 인식하지 못해서, 다운받은걸로 설치를 하는데
failed가 되면서
install the linux header files development package or creat a symbloic link form the usr/src...........어쩌구저쩌구
이런식으로 나옵니다. ㅠ.ㅠ
무슨 현명한 대처방법이 없을까요? 이번에 처음 사용해보는 사람이라서
정말 막히는게 한두가지가 아니네요..자세한 답변좀 ^^
댓글 달기