Solved

_W64 Annotation

Posted on 2011-03-14
2
484 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:olmuser
  • 2
2 Comments
 
LVL 86

Accepted Solution

by:
jkr earned 250 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

Best Practices: Disaster Recovery Testing

Besides backup, any IT division should have a disaster recovery plan. You will find a few tips below relating to the development of such a plan and to what issues one should pay special attention in the course of backup planning.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
MSVCR80.dll crash 2 140
SendMessage fails while PostMessage works 2 114
Socket Programming (Unix) 8 129
Dialogbox API leak? 18 96
Article by: SunnyDark
This article's goal is to present you with an easy to use XML wrapper for C++ and also present some interesting techniques that you might use with MS C++. The reason I built this class is to ease the pain of using XML files with C++, since there is…
Container Orchestration platforms empower organizations to scale their apps at an exceptional rate. This is the reason numerous innovation-driven companies are moving apps to an appropriated datacenter wide platform that empowers them to scale at a …
The goal of the tutorial is to teach the user how to use functions in C++. The video will cover how to define functions, how to call functions and how to create functions prototypes. Microsoft Visual C++ 2010 Express will be used as a text editor an…
The viewer will learn how to user default arguments when defining functions. This method of defining functions will be contrasted with the non-default-argument of defining functions.

803 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