[UNIX/SUN] Template에서 컴파일 에러가 나네요..알려주세요..

wideye42의 이미지

제가 올릴 소스는 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()));
                    }

답변 부탁드리겠습니다..

doldori의 이미지

Sun에서의 컴파일 옵션에 대해서는 모릅니다만 코드에는 문제가 없는 것 같습니다.
혹시 모르니까

    inline A operator()(const A& t, const std::locale& loc) const 
    { 
       return std::toupper(t, loc);  // modified
    } 

이런 식으로 해보세요.
익명 사용자의 이미지

리눅스라는 놈하고 좀 친해져 볼려고 처음으로 사용하게된 유져입니다.
그런데, 렌드라이브를 인식하지 못해서, 다운받은걸로 설치를 하는데
failed가 되면서

install the linux header files development package or creat a symbloic link form the usr/src...........어쩌구저쩌구

이런식으로 나옵니다. ㅠ.ㅠ
무슨 현명한 대처방법이 없을까요? 이번에 처음 사용해보는 사람이라서
정말 막히는게 한두가지가 아니네요..자세한 답변좀 ^^

댓글 달기

Filtered HTML

  • 텍스트에 BBCode 태그를 사용할 수 있습니다. URL은 자동으로 링크 됩니다.
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param><hr>
  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.

BBCode

  • 텍스트에 BBCode 태그를 사용할 수 있습니다. URL은 자동으로 링크 됩니다.
  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param>
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.

Textile

  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • You can use Textile markup to format text.
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param><hr>

Markdown

  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • Quick Tips:
    • Two or more spaces at a line's end = Line break
    • Double returns = Paragraph
    • *Single asterisks* or _single underscores_ = Emphasis
    • **Double** or __double__ = Strong
    • This is [a link](http://the.link.example.com "The optional title text")
    For complete details on the Markdown syntax, see the Markdown documentation and Markdown Extra documentation for tables, footnotes, and more.
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param><hr>

Plain text

  • HTML 태그를 사용할 수 없습니다.
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.
  • 줄과 단락은 자동으로 분리됩니다.
댓글 첨부 파일
이 댓글에 이미지나 파일을 업로드 합니다.
파일 크기는 8 MB보다 작아야 합니다.
허용할 파일 형식: txt pdf doc xls gif jpg jpeg mp3 png rar zip.
CAPTCHA
이것은 자동으로 스팸을 올리는 것을 막기 위해서 제공됩니다.