Hallo Forum, ich habe ein Problem beim compilieren. Ich suche und probiere nun schon einige Stunden und verstehe nicht wo das Problem ist. Sicherlich scheine ich eine Kleinigkeit uebersehen haben aber ich verstehe nicht was?! Fehler vom Compiler: `OpenSerialIO' undeclared (first use this function) `CloseSerialIO' undeclared (first use this function) Selbst wenn ich die Direktive _WIN32 weglasse aendert sich nichts an der Fehlermeldung. Enviorment ist Dev-C++ Version 4.9.9.2 libs und includes stammen aus dem Dev-C++ Verzeichnis. Hier der noetige Code Ausschnitt: main.cpp
1 | #ifdef _WIN32
|
2 | #include <windows.h> |
3 | #include <tchar.h> |
4 | #include <cstdio> |
5 | #include <cstdlib> |
6 | #include <cstring> |
7 | #include <ctime> |
8 | #include "win_io.h" |
9 | #include <sys/types.h> |
10 | #else
|
11 | #include <stdio.h> |
12 | #include <stdlib.h> |
13 | #include <string.h> |
14 | #include <time.h> |
15 | #include <sys/types.h> |
16 | #endif
|
17 | #include "log_error.h" |
18 | #include "diagnosticpc.h" |
19 | |
20 | void* hSerial; |
21 | char szSerialPort1[]; |
22 | |
23 | int diag_init(void) |
24 | {
|
25 | fdErr = diag_error_init(szFilename); |
26 | hSerial = OpenSerialIO(szSerialPort1); |
27 | return ((long)fdErr & (long)hSerial); |
28 | }
|
29 | ...
|
30 | void diag_exit() |
31 | {
|
32 | diag_error_exit(fdErr); |
33 | CloseSerialIO(hSerial); |
34 | }
|
35 | ...
|
win_io.cpp
1 | #ifdef _WIN32
|
2 | #include <windows.h> |
3 | #include <tchar.h> |
4 | #include <cstdio> |
5 | #include "win_io.h" |
6 | |
7 | void* OpenSerialIO(char* cPort) |
8 | {
|
9 | ...
|
10 | return (void*) handle; |
11 | }
|
12 | |
13 | void CloseSerialIO(void* hCom) |
14 | {
|
15 | CloseHandle((HANDLE)hCom); |
16 | }
|
17 | ...
|
18 | #endif
|
win_io.h
1 | #ifdef _DIAG_WIN_IO_H_
|
2 | #define _DIAG_WIN_IO_H_
|
3 | void* OpenSerialIO(char* cPort); |
4 | void CloseSerialIO(void* hCom); |
5 | ...
|
6 | #endif
|
Kann mir jemand einen Hinweis geben oder einen Tipp? Vielleicht ist ja etwas falsch eingestellt im Compiler. Gruss Daniel