Author Topic: Support for VIsual Studio 2008 (aka VC9) compiler [success but ........]  (Read 3890 times)

Offline killerbot

  • Administrator
  • Lives here!
  • *****
  • Posts: 5491
I have adjusted the msvc support. I have extended the msvc8 to also support msvc9. It will first try to find the VC9 and if that fails it tries VC8.

No new compiler options have been added in our support [you can always add yourself new options], by the way I don't even know the new options.

A quick test showed it seems to work.

HOWEVER I think I have stumbled on some issues in our detection code.

This is the story ;-)
Initially I had no MSVC installed, that influences the state of CB. Weeks ago when CB was started for the first time it has tried to find(the back then supported msvc8), and it didn't find it. Therefor it defaulted like this :
Code
        // just a guess; the default installation dir
        wxString Programs = _T("C:\\Program Files");
        // what's the "Program Files" location
        // TO DO : support 64 bit ->    32 bit apps are in "ProgramFiles(x86)"
        //                              64 bit apps are in "ProgramFiles"
        wxGetEnv(_T("ProgramFiles"), &Programs);
        m_MasterPath = Programs + _T("\\Microsoft Visual Studio 8\\VC");
        idepath = Programs + _T("\\Microsoft Visual Studio 8\\Common7\\IDE");

and it also filled in the search directories :

Code
        // now the compiler's include directories
        AddIncludeDir(m_MasterPath + sep + _T("include"));
        AddLibDir(m_MasterPath + sep + _T("lib"));
        AddResourceIncludeDir(m_MasterPath + sep + _T("include"));

That resulted for me in things like this :  C:\Program Files\Microsoft Visual Studio 8\VC\include

So far so good.

Then I installed Visual Studio 2008 (VC9) and used my updated CB with the support for it. I went to compiler and debugger settings, choose the Visual Studio 2005 [Although it should say now Visual Studio 2005/2008] because of :
Code
CompilerMSVC8::CompilerMSVC8()
    : Compiler(_("Microsoft Visual C++ 2005/2008"), _T("msvc8"))
{
    Reset();
}
So certainly no update of this occurred.

Then in the toolchain tab I pressed the auto-detect button. And thanks to the new code it found it, basically because of this :
Code
    // Read the VCToolkitInstallDir environment variable
    wxGetEnv(_T("VS90COMNTOOLS"), &m_MasterPath);

So I clicked on OK, and so on, and went on to rebuild my first project.
Bummer : the <cstdio> was not found. Must be an include path problem. So I go back to the compiler settings, and to my surprise the search paths are still having the VC8 values.
This is for sure a bug : from the above code snippets we can see that it detected the correct masterpath and the deduction for the include dir's seems also correct.
So this seems to indicate that our framework somehow didn't update it in the default.conf file or in memory, that I didn't check.
I manually fixed to search directories and then my project builds fine.
When I now have a look at default.conf everything except the compiler name is correct in there.