Solved

Compiler problems on different windows O/S's

Posted on 2003-10-28
9
313 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
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?
0
 

Author Comment

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

Expert Comment

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

Expert Comment

by:AlexFM
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?
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
LVL 48

Expert Comment

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

Author Comment

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

Accepted Solution

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

Expert Comment

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

Tinchos
EE Cleanup Volunteer
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

When writing generic code, using template meta-programming techniques, it is sometimes useful to know if a type is convertible to another type. A good example of when this might be is if you are writing diagnostic instrumentation for code to generat…
Basic understanding on "OO- Object Orientation" is needed for designing a logical solution to solve a problem. Basic OOAD is a prerequisite for a coder to ensure that they follow the basic design of OO. This would help developers to understand the b…
The viewer will learn how to clear a vector as well as how to detect empty vectors in C++.
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.

867 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

22 Experts available now in Live!

Get 1:1 Help Now