2011-10-19 3 views
2

사용의 Microsoft Visual C++는 내가 파일 test.cc가 나타납니다비주얼 C++ LNK2019 오류

http://sourceforge.net/projects/clippoly/files/

에서 무료로 다운로드 할 수 있습니다 작은 패키지의 일부 파일 "test.cc"를 컴파일하려고

// nclip: a polygon clip library 

// Copyright (C) 1993 University of Twente 

// [email protected] 

// This library is free software; you can redistribute it and/or 
// modify it under the terms of the GNU Library General Public 
// License as published by the Free Software Foundation; either 
// version 2 of the License, or (at your option) any later version. 

// This library is distributed in the hope that it will be useful, 
// but WITHOUT ANY WARRANTY; without even the implied warranty of 
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 
// Library General Public License for more details. 

// You should have received a copy of the GNU Library General Public 
// License along with this library; if not, write to the Free 
// Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 

#include <cstring> 
#include <iostream> 

#include "poly.h" 
#include "poly_io.h" 
#include "nclip.h" 

using namespace ::std; 

void 
clear(PolyPList &l) 
{ 
    PolyPListIter i(l); 
    while(i()) 
     delete i.val(); 
} 

int 
main(int, char *[]) 
{ 
    Poly *a = read_poly(cin), *b = read_poly(cin); 
    PolyPList a_min_b, b_min_a, a_and_b; 

    clip_poly(*a, *b, a_min_b, b_min_a, a_and_b); 

    cout << "a_min_b:\n" << a_min_b; 
    cout << "b_min_a:\n" << b_min_a; 
    cout << "a_and_b:\n" << a_and_b; 

    delete a; 
    delete b; 

    clear(a_min_b); 
    clear(b_min_a); 
    clear(a_and_b); 

    return 0; 
} 

테스트 파일은 두 입력 폴리곤의 교집합을 보여주기 위해 설계되었습니다.

'프로젝트 -> 등록 정보 -> VC++ 디렉토리 -> 디렉토리 포함'에 필요한 헤더 파일 경로가 포함되어 있으며 컴파일러가 "poly.h", "poly_io.h"및 "nclip" .h ".

그러나 나는 다음과 같은 링커 오류 얻을 컴파일하려고하면

test.obj입니다 : 오류 LNK2019 : 확인되지 않은 외부 기호 "private: __thiscall PolyNode::~PolyNode(void)"을 (?? 1PolyNode @@ AAE @ XZ) 함수 "private: void * __thiscall PolyNode:: 스칼라 삭제 소멸자에서 참조 '(부호 INT) "`(?? _ GPolyNode @@ AAEPAXI @ Z)

test.obj입니다 : 오류 LNK2019 :?되지 않은 외부 기호 "class std::basic_ostream<char,struct std::char_traits<char> > & __cdecl operator<<(class std::basic_ostream<char,struct std::char_traits<char> > &,class Set<class Poly *> const &)" (?? 6 @ $ YAAAV basic_ostream DU @ $ @ char_traits D @ STD @@@ std @@ AAV01 @ ABV? $ Set @ PAVPoly @@@@@ Z) 함수에서 참조 번호 _main

test.obj입니다 : 오류 LNK2019 : 확인되지 않은 외부 기호 "void __cdecl clip_poly(class Poly const &,class Poly const &,class Set<class Poly *> &,class Set<class Poly *> &,class Set<class Poly *> &)" 기능에서 참조 (? clip_poly @@ YAXABVPoly @@ 0AAV $가 PAVPoly @@@@ (11) Z @ @ 설정) _main

test.obj입니다 : 오류 LNK2019 : 확인되지 않은 외부 기호 "class Poly * __cdecl read_poly(class std::basic_istream<char,struct std::char_traits<char> > &)" (? read_poly @@ YAPAVPoly @@ AAV? $ basic_istream보다는 DU @? $ char_traits @ D @ 표준 @@@ 표준 @@@ Z) 함수 내가 잘못 뭐하는 거지 _main

에서 참조? 나는 'Project-> Properties'아래에 모든 곳에 경로를 추가하려고 시도했다. 그러나 지금 나는 상실감에 처해있다.

나는이 사람 :)에 대한 매우 간단한 질문 희망 당신은 헤더 파일은 컴파일러 말했지만, 그것은 Poly을 포함하는 라이브러리를 찾을 수 링커 말하지 않은 것처럼

답변

3

같습니다 수업.

Visual Studio가 나 앞에 없으므로 인터페이스를 통해 다음 경로가 표시되지 않을 수 있지만 메모리에서 프로젝트 -> 속성 -> 링커 -> 라이브러리를 통해 라이브러리 (.lib)를 추가해야합니다. > 입력 -> 추가 종속성.

+0

+1 경로를 올바르게 기억했습니다. –