I was doing Uni assignment ( not looking for a full solution ) had to use the start up code provided ( other wise this issue would not have come ),
when compiling the source I get the following error
"pms_program.h:54:56: error: expected declaration specifiers or ‘...’ before ‘CourseType’"
the code you are looking for in pms_course.h ( there is a circular dependency between pms.h , pms_course.h and pms_program.h)
Head tutor provided a GUARD however don't think it works properly
function prototype AppendProgram ( part of doubly linked list )
I have attached the full course code.
As much as I like I cannot change the structure of the startup code , I was hoping that someone know a solution or cam point me to the problem
please see attached zip file for the entire source code.
I'm not too keen to uncompress that and look through all the possible files, so I'll just say this: sketch out the dependencies. What headers are included where? Do you define a class such that it requires the definition of another class that requires its definition?
C + C++ Compiler: MinGW port of GCC
Build + Version Control System: SCons + Bazaar
I was doing Uni assignment ( not looking for a full solution ) had to use the start up code provided ( other wise this issue would not have come ),
when compiling the source I get the following error
"pms_program.h:54:56: error: expected declaration specifiers or ‘...’ before ‘CourseType’"
the code you are looking for in pms_course.h ( there is a circular dependency between pms.h , pms_course.h and pms_program.h)
Head tutor provided a GUARD however don't think it works properly
this is strictly a c code ( so no classes ) problem comes from the fact pms.h in included in pms_courses.h and pms_program.h and the are included in pms.h . ( hence the circular dependency )
please also look at the typdef in pms.h
Code:
/* predeclare the program and course structs */
typedef struct program* ProgramTypePtr;
typedef struct course* CourseTypePtr;
using them seems to solve the problem , however I do not understand why , perhaps an explanation will help me in the future.
The .c file that doesn't compile is pms_course.c. To enable this to compile, the following change should be made
Code:
/*#include "pms_course.h"*/
#include "pms.h"
The other .c modules compile with only a couple of warnings.
All advice is offered in good faith only. All my code is tested (unless stated explicitly otherwise) with the latest version of Microsoft Visual Studio (using the supported features of the latest standard) and is offered as examples only - not as production quality. I cannot offer advice regarding any other c/c++ compiler/IDE or incompatibilities with VS. You are ultimately responsible for the effects of your programs and the integrity of the machines they run on. Anything I post, code snippets, advice, etc is licensed as Public Domain https://creativecommons.org/publicdomain/zero/1.0/ and can be used without reference or acknowledgement. Also note that I only provide advice and guidance via the forums - and not via private messages!
* The Best Reasons to Target Windows 8
Learn some of the best reasons why you should seriously consider bringing your Android mobile development expertise to bear on the Windows 8 platform.