////////////////// SwapDll.h ///////////////////////
__declspec(dllimport)
void swap(int *v1, int *v2);
////////////////////// SwapDll.cpp ///////////////////
__declspec(dllexport);
void swap(int *v1, int *v2)
{
int temp = *v1;
*v1 = *v2;
*v2 = temp ;
}
///////////////// DllTest.cpp//////////////////////
#include <stdio.h>
#include <tchar.h>
#include \"SwapDll.h\"
int _tmain(int argc, TCHAR* argv[])
{
int a = 10;
int b = 20;
_tprintf(_T(\"Before: %d, %d \\n\"), a, b);
swap(&a, &b);
_tprintf(_T(\"After: %d, %d \\n\"), a, b);
return 0;
}
///////////////////////////////////////////////////////
SwapDll 은 Dll 파일 만들기 위한 코드이고,
DllTest 는 SwapDll의 Lib 파일 가져와서 링크시키고 런타임때 Dll 로드하는 코드인데 ㅠㅠ
VS 2005 에서는 Lib 파일이 잘 생성되서 돌아가는데,
VS 2010 에서 컴파일 해보니 SwapDll의 Debug 폴더에 \"SwapDll.ilk\",\"SwapDll.pdb\", \"SwapDll.dll\" 일케만 생성되고
\"Swap.lib\" 파일이 생성되질 않아 ㅠㅠ
이거 어케 해야 생성 할 수 있는거야?
횽들 도와줘
헐;; 짱나서 컴파일러 껒져 하고 SwapDll.cpp 에다가 SwapDll.h을 헤더 파일로 include 시키니까 lib 파일 생성됨;; 2010에선 2005와 다르게 include 안시키면 lib 파일 생성이 안되나봄;;