• Welcome to Valhalla Legends Archive.
 

Syntax Error

Started by shout, January 28, 2005, 03:00 PM

Previous topic - Next topic

shout

I am currently at shcool, in my C++ 1 class. And I made a small program, and in that I have included winbase.h. But when I try to compile, I get 74 syntax errors from winbase.h.

This is all I have (I made a new project to test)

#include "stdafx.h"
#include <winbase.h>

int main(int argc, char* argv[])
{
return 0;
}


Am I just being retarded...?

Mephisto

What are the files your stdafx.h file includes?  I believe if you were to include windows.h and winbase.h in the same file you'd get a lot of type redefinition errors in the various structs the files contain since windows.h automatically includes winbase.h.

To solve the problem, just put "#include <windows.h>" in stdafx.h and just include stdafx.h.

Kp

No, you're using broken header files that don't properly include their own dependencies.  You need to track down the dependencies of winbase.h and manually include those (and onward until there are no dependencies), or just give up and include windows.h instead (which will get you a lot of useless material and thereby slow down your compile, but at least it'll work).
[19:20:23] (BotNet) <[vL]Kp> Any idiot can make a bot with CSB, and many do!