?
Solved

_W64 Annotation

Posted on 2011-03-14
2
Medium Priority
?
519 Views
Last Modified: 2012-05-11

I am compiling a open source library using Embarcadero RAD studio.

The library builds OK under VS2010. So I am keeping all the include/library paths the same as what is used in the VS2010 project.

The following are the VC++ Directories used in VS2010 as part of the project properties.

Executable Directories
Include Directories
Reference Directories
Library Directories
Source Directories
Exclude Directories

Out of the above I am only syncing Include and Library directories.

The directories refenced in the include section are:

$(VCInstallDir)include;
$(VCInstallDir)atlmfc\include;
$(WindowsSdkDir)include;
$(FrameworkSDKDir)\include;

I am not using atlmfc and .Net Framework. So I am just using VC include and SDK include. Similar set-up for library directories too.

Since I have included the SDK folder in the include path I was not expecting an error with the line below

typedef _W64 unsigned int   uintptr_t;

And yet when the build the library Embarcadero C++ builder throws the error below:

[BCC32 Error] vadefs.h(48): E2257 , expected

The file refered above I beleive is pulled into my build as an external dependency.

So my questions are, is _W64 a typedef? Where is it defined?

Why is my build giving the error above? Is there another include location I need to include to fix this error?
0
Comment
Question by:Mydeen Yussouf
  • 2
2 Comments
 
LVL 86

Accepted Solution

by:
jkr earned 1000 total points
ID: 35132898
Well, it is more like a helper and it is defined as '__w64' in BaseTsd.h' when building a 32 bit project:

 
#if !defined(_W64)
#if !defined(__midl) && (defined(_X86_) || defined(_M_IX86)) && _MSC_VER >= 1300
#define _W64 __w64
#else
#define _W64
#endif
#endif

Open in new window


Regarding '__w64', see http://msdn.microsoft.com/en-us/library/s04b5w00%28v=VS.100%29.aspx

"(Microsoft Specific) Lets you mark variables, such that when you compile with /Wp64 the compiler will report any warnings that would be reported if you were compiling with a 64-bit compiler."

So you can basically get rid of that by adding

#define _W64

before including any headers.
0
 
LVL 86

Expert Comment

by:jkr
ID: 35148931
Anything still unclear?
0

Featured Post

How to Use the Help Bell

Need to boost the visibility of your question for solutions? Use the Experts Exchange Help Bell to confirm priority levels and contact subject-matter experts for question attention.  Check out this how-to article for more information.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

What is C++ STL?: STL stands for Standard Template Library and is a part of standard C++ libraries. It contains many useful data structures (containers) and algorithms, which can spare you a lot of the time. Today we will look at the STL Vector. …
This article will show you some of the more useful Standard Template Library (STL) algorithms through the use of working examples.  You will learn about how these algorithms fit into the STL architecture, how they work with STL containers, and why t…
The viewer will learn how to pass data into a function in C++. This is one step further in using functions. Instead of only printing text onto the console, the function will be able to perform calculations with argumentents given by the user.
The viewer will be introduced to the member functions push_back and pop_back of the vector class. The video will teach the difference between the two as well as how to use each one along with its functionality.
Suggested Courses

807 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question