Boost logo

Boost Users :

From: Trigve Siver (trigves_at_[hidden])
Date: 2007-05-18 12:05:53


Hi,

When using precompiled headers, BOOST_TYPEOF_REGISTER_TYPE() macro throw some erros.

stdafx.h:

---
#pragma once
#ifndef _WIN32_WINNT        // Allow use of features specific to Windows XP or later.                   
#define _WIN32_WINNT 0x0501    // Change this to the appropriate value to target other versions of Windows.
#endif                        
#include <boost/typeof/typeof.hpp>
---
test_boost_auto.cpp :
---
#include "stdafx.h"  // 1
//#include <boost/typeof/typeof.hpp>  // 2
#include BOOST_TYPEOF_INCREMENT_REGISTRATION_GROUP()
class A
{
};
BOOST_TYPEOF_REGISTER_TYPE(A)
int main()
{
    return 0;
}
---
When "USE precompiled headers" is turned on, the above code return this error when compiled:
---
------ Build started: Project: test_boost_auto, Configuration: Debug Win32 ------
Compiling...
test_boost_auto.cpp
d:\temp\delete\test_boost_auto\test_boost_auto.cpp(9) : error C2143: syntax error : missing ';' before '<'
d:\temp\delete\test_boost_auto\test_boost_auto.cpp(9) : error C2059: syntax error : '<'
d:\temp\delete\test_boost_auto\test_boost_auto.cpp(9) : error C2653: 'a' : is not a class or namespace name
d:\temp\delete\test_boost_auto\test_boost_auto.cpp(9) : error C2065: 'V' : undeclared identifier
d:\temp\delete\test_boost_auto\test_boost_auto.cpp(9) : error C2143: syntax error : missing ';' before '{'
d:\temp\delete\test_boost_auto\test_boost_auto.cpp(9) : error C2447: '{' : missing function header (old-style formal list?)
d:\temp\delete\test_boost_auto\test_boost_auto.cpp(9) : error C2143: syntax error : missing ';' before '<'
d:\temp\delete\test_boost_auto\test_boost_auto.cpp(9) : error C2059: syntax error : '<'
d:\temp\delete\test_boost_auto\test_boost_auto.cpp(9) : error C2143: syntax error : missing ';' before '{'
d:\temp\delete\test_boost_auto\test_boost_auto.cpp(9) : error C2447: '{' : missing function header (old-style formal list?)
Build log was saved at "file://d:\Temp\DELETE\test_boost_auto\Debug\BuildLog.htm"
test_boost_auto - 10 error(s), 0 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
---
When I turn off precompiled headers, comment 
#include "stdafx.h"
and uncomment
//#include <boost/typeof/typeof.hpp>  // 2
everythings compile fine.
thanks
Trigve
       
____________________________________________________________________________________Be a better Globetrotter. Get better travel answers from someone who knows. Yahoo! Answers - Check it out.
http://answers.yahoo.com/dir/?link=list&sid=396545469

Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net