Link to home
Start Free TrialLog in
Avatar of upliftin
upliftin

asked on

Compiler problems on different windows O/S's

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.
Avatar of AlexFM
AlexFM

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?
Avatar of upliftin

ASKER

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.
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.
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?
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.
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,
ASKER CERTIFIED SOLUTION
Avatar of AlexFM
AlexFM

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
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