|
-
November 22nd, 2005, 09:46 AM
#1
Compile error including <set>
hi all,
I´m using a std::set in a simple aplication in VC6.0. I´m not using MFC neither precompiled headers. The problem is that the compile complains when I include <set> the error is c:\program files\microsoft visual studio\vc98\include\functional(16) : error C2143: syntax error : missing '{' before '<'
c:\program files\microsoft visual studio\vc98\include\functional(16) : error C2059: syntax error : '<' that repeat several times. The first time is on the line 16 that has:
Code:
_STD_BEGIN
// TEMPLATE STRUCT unary_function
template<class _A, class _R> //<=====that is the line 16.
struct unary_function {
typedef _A argument_type;
typedef _R result_type;
};
...
It occurs on file functional.h that is an include of set.h. I´m gessing that the compiler is not recognizing the template but I verified on the compiler options and I haven´t found a compiler parameter to set it. How to fix it??
thank you in advance.
-
November 22nd, 2005, 10:00 AM
#2
Re: Compile error including <set>
 Originally Posted by Rabelo
How to fix it??
While the compiler is taking you to the standard library header, the greatest likelyhood is that something is wrong with your declaration of the std::set object, and / or usage of the same.
So, please post that code.
-
November 22nd, 2005, 10:22 AM
#3
Re: Compile error including <set>
That is the funny part. I just included the set. I commented the set declaration and the error persist. if I comment the #include <set>, the program compile ok.
-
November 22nd, 2005, 10:29 AM
#4
Re: Compile error including <set>
Can you post a small prototype sample that reproduces the bug.
This -
Code:
#include <set>
int main(int argc, char* argv[])
{
return 0;
}
...Compiles just fine.
Additionally, check if you have the latest Service Pack for MSVC 6.0 installed.
-
November 22nd, 2005, 10:40 AM
#5
Re: Compile error including <set>
At the beggining of the program:
Code:
#include <set>
#define _TESTEC_C_
#include <windows.h>
#include "calcpoints.h"
.....
And I don´t declare any class of type std::set. The error occurs inside the include (#include <set>) and them the compiler stops the compilation with: fatal error C1003: error count exceeds 100; stopping compilation inside the include. I made a small test using the set and it compiled ok. It is specific of these aplication. May be a compiler parameter or something like that. Is there any compiler parameter that can be causing these errors?
-
November 22nd, 2005, 10:45 AM
#6
Re: Compile error including <set>
There isn't a compiler parameter to help you.
Unless you post a prototype that reproduces this error, telling anything is akin to shooting in the dark.
Anyways, try this shot -
Code:
#define _TESTEC_C_
#include <windows.h>
#include "calcpoints.h"
#include <set>
BTW, I hope the #define is not intending to be a multiple inclusion guard. If it is so, it isn't playing that role.
-
November 22nd, 2005, 01:19 PM
#7
Re: Compile error including <set>
 Originally Posted by Rabelo
At the beggining of the program:
Code:
#include <set>
#define _TESTEC_C_
#include <windows.h>
#include "calcpoints.h"
.....
And I don´t declare any class of type std::set. The error occurs inside the include (#include <set>) and them the compiler stops the compilation with: fatal error C1003: error count exceeds 100; stopping compilation inside the include. I made a small test using the set and it compiled ok. It is specific of these aplication. May be a compiler parameter or something like that. Is there any compiler parameter that can be causing these errors?
Can you post your project (excluding the debug and release folder) here?
-
November 22nd, 2005, 01:27 PM
#8
Re: Compile error including <set>
uhh, what is the extension of your file ?
c
or
cpp
???
-
November 22nd, 2005, 02:40 PM
#9
Re: Compile error including <set>
I can´t belive!!!! It was .c ..... I am working on a third party project and this detail wasn´t noticed...
Thank you !
-
November 22nd, 2005, 05:50 PM
#10
Re: Compile error including <set>
Wow....good catch Philip...didn't even think so far...
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|