@David:
Das habe ich gerade mal schnell gemacht. sollte dann so aussehen oder?
|
C-/C++-Quelltext
|
1
2
3
4
5
6
7
8
9
10
11
|
#include <fstream>
using namespace std;
void __declspec(dllexport) dllWriteToLog(char text[1024]);
void __declspec(dllexport) dllWriteToLog(char text[1024])
{
fstream log;
log.open("log.txt", ios::out|ios::app);
log << text;
log.close();
}
|
Aber wenn ich dann eine Consolenanwendung schreiben will, die dann die Funktion verwendet:
|
C-/C++-Quelltext
|
1
2
3
4
5
6
|
#include <fstream>
int main()
{
dllWriteToLog("Test");
}
|
Kommt immer der Fehler:
------ Build started: Project: test_dll_test, Configuration: Release Win32 ------
Compiling...
main.cpp
.\main.cpp(5) : error C3861: 'dllWriteToLog': identifier not found
Build log was saved at "file://d:\Projects\test_dll_test\Release\BuildLog.htm"
test_dll_test - 1 error(s), 0 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
Was muss ich dann machen, damit des geht? ???