Visual C++ Compatibilty info.

Discussion in 'Effects and the DSP' started by Russ, Mar 22, 2005.

  1. stylus02

    stylus02 New Member

    Joined:
    Jan 11, 2008
    Messages:
    283
    Likes Received:
    2
    Trophy Points:
    0
    Re: Îòâåò: Visual C++ Compatibilty info.

    no such header found in vc6 folder. is this newer stuff from wdk? i have read about new c99 standard for e.g. 64 bit numbers.
     
  2. Max M.

    Max M. h/h member-shmember

    Joined:
    Dec 7, 2002
    Messages:
    2,690
    Likes Received:
    9
    Trophy Points:
    63
    Îòâåò: Visual C++ Compatibilty info.

    yes, this is newer stuff from any uptodate C crt (incl. WDK one).
    it's not a problem to define those types on your own:
    Code:
    // define before including kX headers:
    #ifdef  _WIN64
    typedef __int64             intptr_t;
    typedef unsigned __int64    uintptr_t;
    #else
    typedef int            intptr_t;
    typedef unsigned int   uintptr_t;
    #endif
    
    but i don't know if that's the only challenge you'll face.


    btw., taking into account:
    Haven't you also considered to drop VC6 finally? ;)
    "VSExpress + WDK" might be a more flexible combo than "VC6 + SP6 + PSDK + whatever"
    (especially since you're moving to more complex programming corners now)
     
    Last edited: Dec 21, 2009
  3. stylus02

    stylus02 New Member

    Joined:
    Jan 11, 2008
    Messages:
    283
    Likes Received:
    2
    Trophy Points:
    0
    Re: Îòâåò: Visual C++ Compatibilty info.

    uff. i fear it's not the only one.. (meanwhile i download the wdk)..
    let's see what happens if i copy these definitions in my plugin code.

    hm.. i would take another combo, than vc6 + "x". when vsexpress, i think it's free, and the wdk now are recommended i would do.
     
  4. Russ

    Russ Well-Known Member

    Joined:
    Jan 17, 2005
    Messages:
    5,722
    Likes Received:
    13
    Trophy Points:
    48
    This is what I have currently (at the top, above the Visual Studio includes):

    Executable Files:
    C:\PROGRAM FILES\MICROSOFT PLATFORM SDK\BIN
    C:\PROGRAM FILES\MICROSOFT PLATFORM SDK\BIN\WINNT

    Include Files:
    C:\PROGRAM FILES\MICROSOFT PLATFORM SDK\INCLUDE
    C:\PROGRAM FILES\MICROSOFT PLATFORM SDK\INCLUDE\CRT
    C:\PROGRAM FILES\MICROSOFT PLATFORM SDK\INCLUDE\ATL
    C:\PROGRAM FILES\MICROSOFT PLATFORM SDK\INCLUDE\MFC

    Library Files:
    C:\PROGRAM FILES\MICROSOFT PLATFORM SDK\LIB

    Source Files:
    C:\PROGRAM FILES\MICROSOFT PLATFORM SDK\SRC
    C:\PROGRAM FILES\MICROSOFT PLATFORM SDK\SRC\CRT
    C:\PROGRAM FILES\MICROSOFT PLATFORM SDK\SRC\ATL
    C:\PROGRAM FILES\MICROSOFT PLATFORM SDK\SRC\MFC

    Note: Some of the kX functions changed slightly, and as such you will have to modify any sources (.h and .cpp) from previous versions of kX.

    e.g.
    Code:
    virtual char *get_plugin_description(int id);
    
    changed to
    Code:
    virtual const char *get_plugin_description(int id);
    
     
    Last edited: Dec 21, 2009
  5. stylus02

    stylus02 New Member

    Joined:
    Jan 11, 2008
    Messages:
    283
    Likes Received:
    2
    Trophy Points:
    0
    i see, there are slightly changes in the demo files (actualized july 2009).
    following i wanna try:

    - visual c++ 2008 express edition + wdk 7 (both are free)
    - take the new demo files (3550) as a base for my plugins
    - add pathes for includes/ libraries.. (wdk) to project properties
     
    Last edited: Dec 22, 2009
  6. Max M.

    Max M. h/h member-shmember

    Joined:
    Dec 7, 2002
    Messages:
    2,690
    Likes Received:
    9
    Trophy Points:
    63
    Îòâåò: Visual C++ Compatibilty info.

    Russ
    Btw., I see the PSDK you use does have MFC headers and libraries. Is it a standalone "Platform SDK"/"Windows SDK" or a part of some IDE?
     
  7. Russ

    Russ Well-Known Member

    Joined:
    Jan 17, 2005
    Messages:
    5,722
    Likes Received:
    13
    Trophy Points:
    48
    That PSDK is the Windows Server 2003 SP1 SDK.

     
    Last edited: Dec 23, 2009
  8. Max M.

    Max M. h/h member-shmember

    Joined:
    Dec 7, 2002
    Messages:
    2,690
    Likes Received:
    9
    Trophy Points:
    63
    Îòâåò: Visual C++ Compatibilty info.

    I see, thanks! It's interesting.... we (me and E.) got used to think of PSDK not having MFC so it was never considered to be recommended for plugin building. (I did not install a standalone PSDK for while - so...).

    I just was thinking of posting some summary of "supported/unsupported" toolsets/kits (because I've realized that my prev. post might be really confusing on the "finally, what to use?" matter). I was not going to mention PSDKs at all, now I guess I need to check current P/WSDKs out first.

    (Obviously a PSDK would make more sense for "VCExpress + *" combo then, as a WDKs do not include any documentation beyond the "driver stuff")
     
  9. Max M.

    Max M. h/h member-shmember

    Joined:
    Dec 7, 2002
    Messages:
    2,690
    Likes Received:
    9
    Trophy Points:
    63
    Îòâåò: Visual C++ Compatibilty info.

    Another question. :) What crt dll are you able to link to with this PSDK?
    (A little charming benefit of WDK is that it gives possibility to link to old good msvcrt.dll (instead of bloating VC8/9 crt dlls) while using modern compilers/linkers).
     
  10. Russ

    Russ Well-Known Member

    Joined:
    Jan 17, 2005
    Messages:
    5,722
    Likes Received:
    13
    Trophy Points:
    48
    With VC6 you are limited with what PSDK's you can use now, since newer PSDK's no longer support it. Also, I am not sure if this PSDK has all of the MFC stuff that would be necessary. Finally, I also have VCExpress installed, and a newer PSDK (for that), and it does not appear to include any MFC stuff, so I think the WDK would still be necessary.

    As for the crt dll, I have not tried linking with any alternate versions (I am using it with VC6 anyway).
     
    Last edited: Dec 23, 2009
  11. Max M.

    Max M. h/h member-shmember

    Joined:
    Dec 7, 2002
    Messages:
    2,690
    Likes Received:
    9
    Trophy Points:
    63
    Îòâåò: Visual C++ Compatibilty info.

    I see. Wooh... complicated... :)

    Crtdll - got it, thanks again.
     
    Last edited: Dec 23, 2009
  12. stylus02

    stylus02 New Member

    Joined:
    Jan 11, 2008
    Messages:
    283
    Likes Received:
    2
    Trophy Points:
    0
    how about including (a) complete demo workspace(s), as we had in earlier versions based on newer compilers & libraries? (primarily microsoft one`s)
    a readme: "how do i setup my compiler- combo for kx?" could help newbies. :)
    we had 2 good possibilities right now: russ's one and your's max.

    meanwhile..

    i have compiled successfully demo.kxl (3550) with vc++ express 2008 & wdk 7

    - copied demo.dsw, demo.dsp from 3545 to 3550 demo folder
    - (removed StdAfx.cpp in project)
    - added to compiler pathes (extras/options.. "c++ pathes" (don't know right
    name, i use german version)):
    "includes": C:\WinDDK\7600.16385.0\inc\crt; C:\WinDDK\7600.16385.0\inc\mfc42
    "libraries": C:\WinDDK\7600.16385.0\lib\Mfc\i386; C:\WinDDK\7600.16385.0
    \lib\ATL\i386
    - set active configuration to release
     
    Last edited: Dec 24, 2009
  13. Russ

    Russ Well-Known Member

    Joined:
    Jan 17, 2005
    Messages:
    5,722
    Likes Received:
    13
    Trophy Points:
    48
    I am not sure of the optimal (or minimal) setup, but I recently tried VCExpress + WDK and here is the setup I used:

    I used a batch file to set VCExpress to use the WDK vars:

    call "C:\WinDDK\7600.16385.0\bin\setenv" C:\WinDDK\7600.16385.0 fre WXP
    start "" "C:\Microsoft Visual Studio 9.0\Common7\IDE\VCExpress.exe" /useenv

    Then I added some additional includes to the "VC++ Directories":
    Include Files:
    C:\WinDDK\7600.16385.0\inc\crt
    C:\WinDDK\7600.16385.0\inc\atl71
    C:\WinDDK\7600.16385.0\inc\ddk
    C:\WinDDK\7600.16385.0\inc\mfc42

    Library Files:
    C:\WinDDK\7600.16385.0\lib\Crt\i386
    C:\WinDDK\7600.16385.0\lib\ATL\i386
    C:\WinDDK\7600.16385.0\lib\wxp\i386
    C:\WinDDK\7600.16385.0\lib\Mfc\i386

    [edit]
    You can add the (above) additional directories to the batch file so that you do not have to add them manually each time.
    e.g.
    Code:
    call "C:\WinDDK\7600.16385.0\bin\setenv" C:\WinDDK\7600.16385.0 fre WXP
    
    set INCLUDE=C:\WinDDK\7600.16385.0\inc\crt;C:\WinDDK\7600.16385.0\inc\atl71;C:\WinDDK\7600.16385.0\inc\ddk;C:\WinDDK\7600.16385.0\inc\mfc42;%INCLUDE%
    set LIB=C:\WinDDK\7600.16385.0\lib\Crt\i386;C:\WinDDK\7600.16385.0\lib\ATL\i386;C:\WinDDK\7600.16385.0\lib\wxp\i386;C:\WinDDK\7600.16385.0\lib\Mfc\i386;%LIB%
    
    start "" "C:\Microsoft Visual Studio 9.0\Common7\IDE\VCExpress.exe" /useenv
    
    [/edit]

    I opened the VC6 workspace (.dsw) for the plugin and let VCExpress convert it.
    I set the active config to release.
    I added the following "Additional Dependencies" to the linker: C:\WinDDK\7600.16385.0\lib\wxp\i386\msvcrt_winxp.obj

    The plugin (one of my plugins that uses kxgui) compiled without problems and appears to function correctly.
     
    Last edited: Feb 15, 2011
    Max M. likes this.
  14. Max M.

    Max M. h/h member-shmember

    Joined:
    Dec 7, 2002
    Messages:
    2,690
    Likes Received:
    9
    Trophy Points:
    63
    Îòâåò: Visual C++ Compatibilty info.

    i guess i just confirm what Russ wrote.
    This would be fair optimal setup.
    (except maybe calling/setting "env" stuff via batch - i don't think it is really necessary - i don't use such at least.)

    I would reveal a more radical/harsh setup (similiar to what i use) but it's really too drastic :) (burning out *all* default VS directories and then setting up different "configurations" via "vsprops" (see MSDN) stuff). Maybe later...
     
    Last edited: Dec 24, 2009
  15. Russ

    Russ Well-Known Member

    Joined:
    Jan 17, 2005
    Messages:
    5,722
    Likes Received:
    13
    Trophy Points:
    48
    The idea with the batch file is to (hopefully) make switching between 32 bit and 64 bit easier.

    Anyway, this is the setup I tried for x64:

    Batch File:
    call "C:\WinDDK\7600.16385.0\bin\setenv" C:\WinDDK\7600.16385.0 fre x64 WLH
    start "" "C:\Microsoft Visual Studio 9.0\Common7\IDE\VCExpress.exe" /useenv

    Additional Includes:
    Include Files:
    C:\WinDDK\7600.16385.0\inc\crt
    C:\WinDDK\7600.16385.0\inc\atl71
    C:\WinDDK\7600.16385.0\inc\ddk
    C:\WinDDK\7600.16385.0\inc\mfc42

    Library Files:
    C:\WinDDK\7600.16385.0\lib\Crt\amd64
    C:\WinDDK\7600.16385.0\lib\ATL\amd64
    C:\WinDDK\7600.16385.0\lib\wlh\amd64
    C:\WinDDK\7600.16385.0\lib\Mfc\amd64

    [edit]
    Again, you can add the (above) additional directories to the batch file so that you do not have to add them manually each time.
    e.g.
    Code:
    call "C:\WinDDK\7600.16385.0\bin\setenv" C:\WinDDK\7600.16385.0 fre x64 WLH
    
    set INCLUDE=C:\WinDDK\7600.16385.0\inc\crt;C:\WinDDK\7600.16385.0\inc\atl71;C:\WinDDK\7600.16385.0\inc\ddk;C:\WinDDK\7600.16385.0\inc\mfc42;%INCLUDE%
    set LIB=C:\WinDDK\7600.16385.0\lib\Crt\amd64;C:\WinDDK\7600.16385.0\lib\ATL\amd64;C:\WinDDK\7600.16385.0\lib\wlh\amd64;C:\WinDDK\7600.16385.0\lib\Mfc\amd64;%LIB%
    
    start "" "C:\Microsoft Visual Studio 9.0\Common7\IDE\VCExpress.exe" /useenv
    
    [/edit]

    Procedure is the same as in my previous post, except I used the following object file instead of the wxp one:
    C:\WinDDK\7600.16385.0\lib\wlh\amd64\msvcrt_win2003.obj
    ...and I set the target machine type to MachineX64.
    (and I used the kX SDK from the x64 release of the driver)

    The plugin compiled OK (other than some warnings related to conversion from 'kxparam_t' to 'int', etc), but I not able to test it as I do not have a x64 system.
     
    Last edited: Feb 15, 2011
  16. Max M.

    Max M. h/h member-shmember

    Joined:
    Dec 7, 2002
    Messages:
    2,690
    Likes Received:
    9
    Trophy Points:
    63
    Îòâåò: Visual C++ Compatibilty info.

    Ah, i see. Yeah, that makes sense.
     
  17. Russ

    Russ Well-Known Member

    Joined:
    Jan 17, 2005
    Messages:
    5,722
    Likes Received:
    13
    Trophy Points:
    48
    That is just my initial test setup (as I only recently installed VCExpress and the WDK, and I am not all that familiar with either). Once I know what is optimal, I will probably create my own setenv batch file (that does not include the unnecessary stuff, and does include the stuff that I had to add manually, etc), or maybe use vsprops files (per your suggestion).

    Any tips or suggestions that you have are always appreciated.
     
  18. Max M.

    Max M. h/h member-shmember

    Joined:
    Dec 7, 2002
    Messages:
    2,690
    Likes Received:
    9
    Trophy Points:
    63
    Îòâåò: Visual C++ Compatibilty info.

    They (MS) promiss more flexible "platform" configuration stuff in the upcoming VS2010 (i hope this will apply to Express version too). Well, we'll see.
    The "vsprops" is handy but still somewhat limited (and still requires some manual work when "switching" (i don't "switch" too much though)).

    Either way, here's the "vsprops" file i typically use:
    (it's for VS2005+WDK.6001, but it should work for VS2008 and/or WDK.7600 too)
    Code:
    <?xml version="1.0" encoding="windows-1251"?>
    <VisualStudioPropertySheet
    	ProjectType="Visual C++"
    	Version="8.00"
    	Name="Default (WDK)"
    	>
    	<Tool
    		Name="VCCLCompilerTool"
    		AdditionalIncludeDirectories="$(WDK)\inc\crt;$(WDK)\inc\api\crt\stl70;$(WDK)\inc\api;$(WDK)\inc\mfc42"
    		PreprocessorDefinitions="_STL70_;_STATIC_CPPLIB;_SYSCRT_REPORT_NOIMPORT"
    		RuntimeLibrary="2"
    	/>
    	<Tool
    		Name="VCLinkerTool"
    		AdditionalLibraryDirectories="$(WDK)\lib\crt\i386;$(WDK)\lib\wnet\i386;$(WDK)\lib\mfc\i386;$(WDK)\lib\atl\i386"
    		AdditionalDependencies="ntstc_msvcrt.lib msvcrt_win2003.obj"
    		GenerateManifest="false"
    	/>
    	<Tool
    		Name="VCResourceCompilerTool"
    		AdditionalIncludeDirectories="$(WDK)\inc\api;$(WDK)\inc\mfc42"
    	/>
    
    	<UserMacro Name="WDK" Value="E:\WDK" />
    
    </VisualStudioPropertySheet>
    
    ntstc_msvcrt.lib is necessary only if you use iostreams and similar parts of C++ library (as well as those "PreprocessorDefinitions").
     
    Last edited: Nov 22, 2011
  19. Russ

    Russ Well-Known Member

    Joined:
    Jan 17, 2005
    Messages:
    5,722
    Likes Received:
    13
    Trophy Points:
    48
    Looks easy enough, thanks for the info :)

    I see that you use the win2003 object file for your 32 bit builds, does that lead to any issues with XP (I figured there is some reason why there is one specifically for XP (which I assume means XP (32 Bit) and later))?
     
  20. Max M.

    Max M. h/h member-shmember

    Joined:
    Dec 7, 2002
    Messages:
    2,690
    Likes Received:
    9
    Trophy Points:
    63
    Îòâåò: Visual C++ Compatibilty info.

    >win2003 object file

    I guess it's just for compatibility with binaries for my work. But it should not make any differences
    (as far as i understand XP (after SP1/2 at least) has the same mscvcrt as W2003).
    It works just fine (though i'm not sure why they made all those duplicates - maybe it's for backward compatibility with prev. DDKs?)
     

Share This Page

visited