내 previous question 네이티브 코드 디버깅과 관련하여 콘솔 앱에서 간단한 테스트를 작성하기로 결정했습니다. 서비스를 직접 디버깅하는 데 아무런 문제가 없었습니다.LNK2001 : 내가 용서해야 할 것은 무엇인가?
그래서 vc6 콘솔 앱을 만들고 dll 프로젝트를 작업 영역에 추가하고 실행했습니다. 대신 다음과 같은 링커 오류를 때렸다 예상대로 실행
는 :
이 링커 옵션에서 뭔가를 잊어의 간단한 경우 것으로 보인다main.obj : error LNK2001: unresolved external symbol "int __stdcall hmDocumentLAdd(char *,char *,long,char *,char *,long,long,long,long *)" ([email protected]@[email protected])
main.obj : error LNK2001: unresolved external symbol "int __stdcall hmGetDocBasePath(char *,long)" ([email protected]@[email protected])
Debug/HazManTest.exe : fatal error LNK1120: 2 unresolved externals
: 그러나 모든 것이 정상으로 보이고, lib 디렉토리 파일 , dll 및 소스를 사용할 수 있습니다. 말도 안되는 소리에로드 할 lib 파일을 변경하면 fatal error LNK1104: cannot open file "asdf.lib"
까지 실행되므로 문제는되지 않습니다.
나는 이전에 dll에 연결했고 그들은 방금 작업했습니다. 그래서 할 일이 있습니까?
업데이트 : this thread에 따라 추가 정보를 찾을 수 있는지 확인했습니다. 이것은 VS2005의 dumpbin이 제공하는 것입니다. 잘못
> undname [email protected]
Microsoft (R) C++ Name Undecorator
Copyright (C) Microsoft Corporation. All rights reserved.
Undecoration of :- "[email protected]"
is :- "[email protected]"
:
> dumpbin /linkermember Hazardman.lib | findstr "DocumentLAdd"
F6DC [email protected]
F6DC [email protected]
5B [email protected]
5B [email protected]
그런 다음에 undname 결과를 통해 실행. IDE에서 맹 글링 된 이름을 넣으면 훨씬 좋은 결과를 얻을 수 있습니다.
> undname [email protected]@[email protected]
Microsoft (R) C++ Name Undecorator
Copyright (C) Microsoft Corporation. All rights reserved.
Undecoration of :- "[email protected]@[email protected]"
is :- "int __stdcall hmDocumentLAdd(char *,char *,long,char *,char *,long,long,l
ong,long *)"
이제이 정보가 있는데, 어떻게해야합니까? 이건 Raymond Chen article에서 수동으로 고칠 수 있지만 옵션을 조정할 수는 있지만 내 결과에서 어떤 옵션이 필요한지 알 수는 없습니다 ('모든 매개 변수 무시'확인란이 있습니까?).
그래서 존재하지 않는 함수를 찾고 있거나 함수의 매개 변수가 중단 된 것 같습니다 (또는 dumpbin은 VC6 라이브러리를 좋아하지 않습니다). 그러나 stil을 사용하면 해결할 목표가 더 가깝지 않습니다. 내 문제.
콘솔 응용 프로그램을 라이브러리에 종속 시키셨습니까? – EvilTeach
예. dll은 앱이 실행되기 전에 컴파일됩니다. –
'c'인터페이스를 사용하여 무엇이든하고 있습니까? extern 'c'등은 무엇입니까? – EvilTeach