Solved

Compiler problems on different windows O/S's

Posted on 2003-10-28
9
311 Views
Last Modified: 2008-03-10
Hi,

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
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
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'
Stop.
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
#else
#define TARGET_IS_NT52_OR_LATER                   0
#endif

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
Jon.
0
Comment
Question by:upliftin
9 Comments
 
LVL 48

Expert Comment

by:AlexFM
Comment Utility
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?
0
 

Author Comment

by:upliftin
Comment Utility
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,
Jon.
0
 
LVL 9

Expert Comment

by:_ys_
Comment Utility
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.
0
 
LVL 48

Expert Comment

by:AlexFM
Comment Utility
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?
0
What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

 
LVL 48

Expert Comment

by:AlexFM
Comment Utility
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.
0
 

Author Comment

by:upliftin
Comment Utility
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.
Jon,
0
 
LVL 48

Accepted Solution

by:
AlexFM earned 150 total points
Comment Utility
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.
0
 
LVL 9

Expert Comment

by:tinchos
Comment Utility
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.
PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!

Tinchos
EE Cleanup Volunteer
0

Featured Post

Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

In days of old, returning something by value from a function in C++ was necessarily avoided because it would, invariably, involve one or even two copies of the object being created and potentially costly calls to a copy-constructor and destructor. A…
Templates For Beginners Or How To Encourage The Compiler To Work For You Introduction This tutorial is targeted at the reader who is, perhaps, familiar with the basics of C++ but would prefer a little slower introduction to the more ad…
The goal of the video will be to teach the user the difference and consequence of passing data by value vs passing data by reference in C++. An example of passing data by value as well as an example of passing data by reference will be be given. Bot…
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.

772 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

Need Help in Real-Time?

Connect with top rated Experts

8 Experts available now in Live!

Get 1:1 Help Now