Menu

Migrate from Microsoft C++ to Dev-C++

2002-12-11
2012-09-26
  • Andrea Ghensi

    Andrea Ghensi - 2002-12-11

    Hi all,
    I have to modify a Microsoft C++ source code, but I can't afford Microsoft compiler.
    Is there any way to migrate to Dev-C++?
    Try to epxlain me exactly how to because I'm newbie!!!
    Thanks in advance
    cheers

     
    • Greer Trumble

      Greer Trumble - 2002-12-11

      I have imported, compiled, linked and executed a couple of VC++5 sample projects with success, using just the IDDE main import function. 

      Using the main menu:  Select FILE--IMPORT--IMPORT MS VISUAL C++ PROJECT. (caps mine)

      Is that what you mean?  I'm new to Dev-CPP, but that worked for me ok.  Didn't try it on VC++6 though.

      Regards,

      Greer T.

       
    • Andrea Ghensi

      Andrea Ghensi - 2002-12-12

      Ok, it works, I've upgraded the compiler to the version 5.
      Anyway, I've a little problem... Check it:

      #ifndef __xPath_h__
      #define __xPath_h__

      #include "xTypes.h"

      tChar    XDiskGetPathDelimeter(void);
      void    XDiskSetPathDelimeter(tChar cDelim);

      tChar    XDiskGetDeviceDelimeter(void);
      void    XDiskSetDeviceDelimeter(char cDelim);

      void    XDiskConvertToPlatformPath(tChar * pszPathname);
      void    XDiskConvertToUnixPath(tChar * pszPathname);

      void    XDiskConvertExtension(tChar * pszPathName, tChar * pszNewExt);

      void    XDiskGetFileNameFromPath(const tChar * pcszPathName, tChar * pFile, short sMaxChars);
      void    XDiskGetFileNameFromPathX(const tChar * pcszPathName, tChar * pFile, short sMaxChars);
      void    XDiskGetPathNameFromPath(const tChar * pcszPathName, tChar * pPath, short sMaxChars);

      tChar*    XBuildPath(tChar * s1, const tChar * s2);

      #endif __xPath_h__

      It returns
      xPath.h:1: warning: garbage at end of `#ifndef' argument
      xPath.h:1: unterminated `#if' conditional

      why?

       
    • Andrea Ghensi

      Andrea Ghensi - 2002-12-12

      I correct this error, but now I've a lot of other error types!!!
      It gives me:
      syntax error befoe "(" in declarations
      destructors must be member functions
      virtual outside class declaration
      parse error before "{" in class declaration
      an do on....

      Why microsoft has to complicate things?
      Is there any guide like "Migrating from Micrsoft c++" or "differences between c++ and microsoft c++"?

      cheers

       
      • Robert Rainwater

        If it is using MFC, you will be out of luck.

         
      • Georhan

        Georhan - 2004-05-04

        Yosh this would be rather cool if such guide(s) would exist !!
        I've tried to compile the libodbc++ with Dev-C++ for a few days now and I jsut don't manage to do that. I created the .lib- and the .dll- files with MSVC but can't use them with Dev-c++
        Can anyone help ?

        Thanks

        Georhan

         
    • Patrick Ogay

      Patrick Ogay - 2002-12-26

      there is an interesting link to Markus Neifer's Artikel
      "How to migrate MFC to wXwindows"
      http://www-106.ibm.com/developerworks/linux/library/l-mfc/

      Apart from that, there are some differences between Gnu-Compiler and M$, gnu usually is strikter.
      M$ has some other Macros as TRACE0 or ASSERT, many functions have a equivalent, or are easy to replace.

      porting is not such an easy task :-)"

       
    • Patrick Ogay

      Patrick Ogay - 2002-12-29

      as said there are some compiler differences, M$ has also some proprietary Templates as CArray.

      With the correct headers you don't get syntax errors as you mentioned.

      the m$-compiler doesn't follow the standard somtimes.
      For example a  for (int i=0....) it's not lokal to the loop. (leads multiple declaration of i)
      const and non const are less restrictive an need sometime a cast.
      I had to substitute  NULL with 0 because of Typ differences at some places (Null-Pointer as parms)

      very Important:

      #include <windows.h>
      #include <winbase.h>    (somtimes, this order)

      I have also these compiler options
      -mwindows -fnative-struct
      which have an influence on compiler differences, I guess.

      For MFC-functions I didn't find a substitute until now.

      CString you can easily substitute by the C++ string.

      other porting problems???
      Greeting
      Patrick

       
    • Benjamin Kerensa

      It would be nice if we had like a tool which could convert the code automatically... would be nice i have tried importing code from C++ .NET to DevC++ and compiling it and failed with every app i tried hopefully we might have some converters or support for .net in the future.

       
    • Robert T. Adams

      Robert T. Adams - 2003-02-05

      If it's an MFC program you are trying to port, I don't think it's possible.

       
    • Benjamin Kerensa

      It is possible to port MFC to wXWindows i know  alot of people have... some hopefully DevC++ will sometime have a feature to auto port the code or something.... i am hoping the update on DevC++ coming will be a nice big one fixing alot of the bugs and adding a heap of features

       

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.