[Last Call] Learn about multicloud storage options and how to improve your company's cloud strategy. Register Now


Compiler problems on different windows O/S's

Posted on 2003-10-28
Medium Priority
Last Modified: 2008-03-10

I am still getting the same error message when trying to compile some of my work. I know the problem is due to running a different O/S :

Building PxyStub Dll ...
Microsoft (R) Program Maintenance Utility   Version 6.00.8168.0
Copyright (C) Microsoft Corp 1988-1998. All rights reserved.
 cl /nologo /I"..\..\..\..\Intermediate\Interfaces\\" /c /Ox /DWIN32 /D_WIN32_WI
NNT=0x0400  /DREGISTER_PROXY_DLL /Fo"..\..\..\..\Intermediate\ProxyStub\gndbasep
s\\"  ..\..\..\..\Intermediate\ProxyStub\gndbaseps\dlldata.c
 cl /nologo /I"..\..\..\..\Intermediate\Interfaces\\" /c /Ox /DWIN32 /D_WIN32_WI
NNT=0x0400  /DREGISTER_PROXY_DLL /Fo"..\..\..\..\Intermediate\ProxyStub\gndbasep
s\\"  ..\..\..\..\Intermediate\ProxyStub\gndbaseps\gndbase_p.c
..\..\..\..\Intermediate\ProxyStub\gndbaseps\gndbase_p.c(106) : fatal error C118
9: #error :  You need a Windows 2000 or later to run this stub because it uses t
hese features:
NMAKE : fatal error U1077: 'cl' : return code '0x2'
Error executing c:\windows\system32\cmd.exe.

InterfaceBuild - 2 error(s), 0 warning(s)

I have changed the headers in my project that specifythe old O/S,  to include the following new O/S code :
#define _WIN32_WINNT 0x0502
rather than
#define _WIN32_WINNT 0x0400

I have also checked the file RpcNdr.h in the SDK and MSVC++ directories, and updated the macros :

#if (0x502 <= _WIN32_WINNT)
#define TARGET_IS_NT52_OR_LATER                   1
#define TARGET_IS_NT52_OR_LATER                   0

I am not sure why the error still occurs as i am telling the compiler whicb O/S code to set. Also in the MSVC++ 6.0 Settings, i have added under the Project settings tab - C++ tab - Category General - Common Options : _WIN32_WINNT=0x0502 with no effect.

Please can someone point me in the right direction so i can get this project compiled under the new O/S. I would be most grateful.

Kind Regards
Question by:upliftin
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
LVL 48

Expert Comment

ID: 9633724
cl /nologo /I"..\..\..\..\Intermediate\Interfaces\\" /c /Ox /DWIN32 /D_WIN32_WINNT=0x0400 ...

It looks like 0x0400 version doesn't want to go away. gndbase_p.c is still compiled with this constant.
There should be a way to change this parameter. What is your project type and how it is created?

Author Comment

ID: 9633804
The project is a simulator, built in win32 release. I am building on Win2003 server, and the project was previously run on Win2000 without problems. This part of the build is only a small part, the rest of my project builds fine. I am building on MSV C++ 6.0.

Im just not familiar with how the MSV Studio determines what version of windows you are running and how it is propegated through the code.

Sorry im being a bit vague, but i am at a loss for the moment. For some reason the windows version is being set to 0400, but where this is being done i dont know.

Thanks again for all your interest and help.

Kind Regards,

Expert Comment

ID: 9633827
It's been quite a while since I used VC6.

When building a COM dll, the proxy/stub is compiled seperately. From the file names mentioned it looks like it's this proxy/stub build that's failing.

If memory serves me right, it's within the custom build settings (project properties) that this build is performed. Who knows, it may have 'hard coded' the command-line parameters in there. It's worth a look.
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

LVL 48

Expert Comment

ID: 9633913
Possibly there is a way to change the command line in the project settings. This is a reason I ask what is the project type - to reproduce this and to play with parameters.  I don't remember what is this stuff: autimation, ActiveX, #import, something else?
LVL 48

Expert Comment

ID: 9634207
My guess is: use cpp_quote MIDL keyword to add required definition to generated header file.

cpp_quote("#define _WIN32_WINNT 0x0502")

Insert this line to your project IDL file.

Author Comment

ID: 9634382
thanks AlexFM, i tried that and it did indeed put the new definition in my header file, but on compilation time i get a warning...

 ..\..\..\..\Intermediate\Interfaces\gndbase.h(91) : warning C4005: '_WIN32_WINNT' : macro redefinition
        unknown(0) : see previous definition of '_WIN32_WINNT'

im thinking now that the problem is within my SDK files as i have had a look around and the windows versiosn are only supported upto _WIN32_WINNT >= 0x0501, which is XP.

I'll keep browsing around and see what i can find, and i'll post any new findings i have.

Thanks again.
LVL 48

Accepted Solution

AlexFM earned 450 total points
ID: 9634436
I hope your initial problem is solved. To turn off warning you can put #pragma warning line to h-file by the same way.
In any case, if your SDK is not up-to-date, it's a good idea to download the newest version.

Expert Comment

ID: 10546241
No comment has been added lately, so it's time to clean up this question.
I will leave the following recommendation for this question in the Cleanup topic area:

Accept: AlexFM {http:#9634436}

Please leave any comments here within the next four days.

EE Cleanup Volunteer

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Errors will happen. It is a fact of life for the programmer. How and when errors are detected have a great impact on quality and cost of a product. It is better to detect errors at compile time, when possible and practical. Errors that make their wa…
Unlike C#, C++ doesn't have native support for sealing classes (so they cannot be sub-classed). At the cost of a virtual base class pointer it is possible to implement a pseudo sealing mechanism The trick is to virtually inherit from a base class…
The goal of the video will be to teach the user the concept of local variables and scope. An example of a locally defined variable will be given as well as an explanation of what scope is in C++. The local variable and concept of scope will be relat…
The viewer will learn how to use the return statement in functions in C++. The video will also teach the user how to pass data to a function and have the function return data back for further processing.
Suggested Courses

650 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