Alright - I got my biggest project not too long ago, and I've been working on it like mad lately, and just until an hour ago, I've have all my functions in one file.
Now I'm trying to split it up and make it look good, all that, and I've run into tons of problems.
Basically, my code structure is like this(I've checked the faq thread, tried to follow it, but the example is just way too small to fit my code)
I'll just post the includes to explain what I'm talking about:
Code:
// main.c
#include "data.h"
Code:
#include <windows.h>
#include <windowsx.h>
#include <all-the-other-system-header-files.h>
#include "defines.h" // All the #defines and global variables, structures, etc.
#include "resource.h"
#include "necessary-device-headerfile.h"
#include "source-code-files.c"
// Prototypes for functions go here.
None of the source code files have any includes. However, when I try to compile, I get errors that look like:
Code:
1>------ Build started: Project: RFIDApplication, Configuration: Debug Win32 ------
1>Compiling...
1>main.c
1>c:\programming\c++\rfidapplication\main.c(14) : warning C4189: 'ret' : local variable is initialized but not referenced
1>c:\programming\c++\rfidapplication\main.c(190) : warning C4100: 'nCmdShow' : unreferenced formal parameter
1>c:\programming\c++\rfidapplication\main.c(190) : warning C4100: 'lpCmdLine' : unreferenced formal parameter
1>c:\programming\c++\rfidapplication\main.c(189) : warning C4100: 'hPrevInstance' : unreferenced formal parameter
1>c:\programming\c++\rfidapplication\main.c(189) : warning C4100: 'hInstance' : unreferenced formal parameter
1>rfidhandlers.c
1>c:\programming\c++\rfidapplication\rfidhandlers.c(29) : error C2146: syntax error : missing ')' before identifier 'rfidHandle'
1>c:\programming\c++\rfidapplication\rfidhandlers.c(29) : error C2061: syntax error : identifier 'rfidHandle'
1>c:\programming\c++\rfidapplication\rfidhandlers.c(29) : error C2059: syntax error : ';'
1>c:\programming\c++\rfidapplication\rfidhandlers.c(29) : error C2059: syntax error : ','
1>c:\programming\c++\rfidapplication\rfidhandlers.c(29) : error C2059: syntax error : ')'
1>c:\programming\c++\rfidapplication\rfidhandlers.c(154) : error C2146: syntax error : missing ')' before identifier 'rfidHandle'
1>c:\programming\c++\rfidapplication\rfidhandlers.c(154) : error C2061: syntax error : identifier 'rfidHandle'
1>c:\programming\c++\rfidapplication\rfidhandlers.c(154) : error C2059: syntax error : ';'
1>c:\programming\c++\rfidapplication\rfidhandlers.c(154) : error C2059: syntax error : ','
1>c:\programming\c++\rfidapplication\rfidhandlers.c(154) : error C2059: syntax error : ')'
1>c:\programming\c++\rfidapplication\rfidhandlers.c(200) : error C2146: syntax error : missing ')' before identifier 'rfidHandle'
1>c:\programming\c++\rfidapplication\rfidhandlers.c(200) : error C2061: syntax error : identifier 'rfidHandle'
1>c:\programming\c++\rfidapplication\rfidhandlers.c(200) : error C2059: syntax error : ';'
1>c:\programming\c++\rfidapplication\rfidhandlers.c(200) : error C2059: syntax error : ','
1>c:\programming\c++\rfidapplication\rfidhandlers.c(200) : error C2059: syntax error : ')'
1>fileprocs.c
1>c:\programming\c++\rfidapplication\fileprocs.c(23) : error C2146: syntax error : missing ')' before identifier 'hWnd'
1>c:\programming\c++\rfidapplication\fileprocs.c(23) : error C2061: syntax error : identifier 'hWnd'
1>c:\programming\c++\rfidapplication\fileprocs.c(23) : error C2059: syntax error : ';'
1>c:\programming\c++\rfidapplication\fileprocs.c(23) : error C2059: syntax error : ')'
1>c:\programming\c++\rfidapplication\fileprocs.c(24) : error C2449: found '{' at file scope (missing function header?)
1>c:\programming\c++\rfidapplication\fileprocs.c(113) : error C2059: syntax error : '}'
1>cleanup.c
1>c:\programming\c++\rfidapplication\cleanup.c(25) : error C2146: syntax error : missing ')' before identifier 'hWnd'
1>c:\programming\c++\rfidapplication\cleanup.c(25) : error C2061: syntax error : identifier 'hWnd'
1>c:\programming\c++\rfidapplication\cleanup.c(25) : error C2059: syntax error : ';'
1>c:\programming\c++\rfidapplication\cleanup.c(25) : error C2059: syntax error : ','
1>c:\programming\c++\rfidapplication\cleanup.c(25) : error C2059: syntax error : ')'
1>dlghandlers.c
1>c:\programming\c++\rfidapplication\dlghandlers.c(21) : error C2146: syntax error : missing ')' before identifier 'hWnd'
1>c:\programming\c++\rfidapplication\dlghandlers.c(21) : error C2061: syntax error : identifier 'hWnd'
1>c:\programming\c++\rfidapplication\dlghandlers.c(21) : error C2059: syntax error : ';'
1>c:\programming\c++\rfidapplication\dlghandlers.c(21) : error C2059: syntax error : ','
1>c:\programming\c++\rfidapplication\dlghandlers.c(21) : error C2059: syntax error : ')'
1>Generating Code...
1>Build log was saved at "file://c:\programming\C++\RFIDApplication\Debug\BuildLog.htm"
1>RFIDApplication - 31 error(s), 5 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
The rfidHandle is a type defined in the necessary device header file. hWnd has type HWND(duh) and is a handle to a window, of course, and for some reason, these two types seem to get errors for only those two types. There are at least 10 more types in use in the source files that are located in some of the system header files that don't get complained about.
I'd really appreciate any swift answers - any suggestions if you don't know the answers, since I need to send the hardware off to the owner tomorrow morning which would mean that developing software for it wouldn't really be safe.
Eagerly awaiting your aid.