Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is it time to say goodbye to VC6 compiler?

Of late I'm facing the issues that points finger to VC6 compiler.

Few of them are:

  1. A function-try-block doesn't work. Related Q
  2. in-class constant doesn't work.
  3. __FUNCTION_ (Macro to get function name) doesn't work
  4. The latest addition is it doesn't allow void functions to be passed as part of for_each.

The below example is not compiling with VC6 compiler. It says "error C2562: '()' : 'void' function returning a value". It looks like VC6 doesn't like void functions to be passed to for_each.

class Temp
{
public:
    Temp(int i):m_ii(i)
    {}

    int getI() const
    {
        return m_ii;
    }

    void printWithVoid()
    {
        cout<< "i = "<<m_ii<<endl;

    }
    bool printWithBool()
    {
        cout<< "i = "<<m_ii<<endl;
        return true;
    }
private:
    int m_ii;
};

int main(void) 
{
    std::vector<Temp>  arrTempObjects;

    arrTempObjects.push_back(Temp(0));
    arrTempObjects.push_back(Temp(2));

    //Doesnot work, compiler error 
    std::for_each(arrTempObjects.begin(), arrTempObjects.end(), std::mem_fun_ref(&Temp::printWithVoid));

    //Works
    std::for_each(arrTempObjects.begin(), arrTempObjects.end(), std::mem_fun_ref(&Temp::printWithBool));

    return 0;
}

Have you faced any other issues related to VC6.0. Any workaround to resolve these issues ? Or is it time to change the compiler?

like image 342
aJ. Avatar asked Apr 09 '09 09:04

aJ.


People also ask

Is MSVC compiler free?

MSVC is a closed, proprietary C/C++ compiler developed and distributed by Microsoft; there is no real good reason justifying to use this proprietary compiler when a wonderful genuine free sw standard compiler is available on Windows as well [MinGW, MinGW].

Is Microsoft Visual Studio a compiler?

Microsoft Visual Studio is a good compiler for developing Windows applications.

Is C++ compiler free?

There are good free C++ compilers available for all major OS platforms.

How do I install Microsoft Visual C++ compiler?

You can install the C/C++ extension by searching for 'c++' in the Extensions view (Ctrl+Shift+X). Install the Microsoft Visual C++ (MSVC) compiler toolset. If you have a recent version of Visual Studio, open the Visual Studio Installer from the Windows Start menu and verify that the C++ workload is checked.


1 Answers

Quite frankly I can hardly understand why you wouldn't buy a modern computer and switch to Visual Studio 2008.

VC6 has got a deficient STL, poor C++ standard compliance and obsolete GUI.

You shouldn't let your competitors use better tools than you.

like image 123
Edouard A. Avatar answered Oct 21 '22 06:10

Edouard A.