回答編集履歴
1
少し修正
answer
CHANGED
@@ -1,1 +1,18 @@
|
|
1
|
-
libのリンクを忘れてないですか。
|
1
|
+
libのリンクを忘れてないですか。
|
2
|
+
質問者さんと同じ関数を定義してDLLをビルドし、同時に出力されたlibファイルをリンクしてEXEをビルドして、特に問題なく実行できました。
|
3
|
+
|
4
|
+
```C++
|
5
|
+
#include <stdio.h>
|
6
|
+
|
7
|
+
#pragma comment(lib, "TestDll.lib")
|
8
|
+
|
9
|
+
extern "C" __declspec(dllexport) int __cdecl test();
|
10
|
+
|
11
|
+
int main()
|
12
|
+
{
|
13
|
+
printf("result:%d\r\n", test());
|
14
|
+
|
15
|
+
getchar();
|
16
|
+
return 0;
|
17
|
+
}
|
18
|
+
```
|