Thread: alloca.h

  1. #1
    Registered User kryptkat's Avatar
    Join Date
    Dec 2002
    Posts
    638

    alloca.h

    I am porting some downloaded programs from visual cpp to devcpp. When compiled I get an error referring to “alloca” and an include for alloca.h . So I looked through the include dir nothing there. No alloca.h included with the zip. So I changed the alloca() to malloc(). It worked.

    Question is alloca equivalent to malloc ? Need more infor on alloca. Is it specific to visual cpp ?

    Question went here and here for mfc header files.

    The Dev-C++ Resource Site

    http://devpaks.org/

    Microsoft Foundation Class Library - Wikipedia, the free encyclopedia

    I have some source code asking for mfc header files when compiled but could not find them on any web site. Can I use mfc90.dll with devcpp ? Can I use vcl with devcpp ? Or mfc90u.dll ? meow.
    I would still need the header files with the dll files ?

  2. #2
    Registered User
    Join Date
    Dec 2007
    Posts
    2,675

  3. #3
    Registered User kryptkat's Avatar
    Join Date
    Dec 2002
    Posts
    638
    Tip#31: alloca()

    alloca() -- allocate space in the stack frame

    msdn.microsoft.com/en-us/library/d06h2x6e(VS.80).aspx

    did that. Where do I get the header files ? MFC comes with visual cpp this I know. Is there a MFC for dev cpp ? Cybercrimes <aka google syndication> is out to get me aaaawwww!

    devcentral.iftech.com/articles/MFC/default.php
    the only text item closes resemble what I looking for and it all visual cpp.

    MFC Tutorial Part 1

    does dev cpp have mfcsdk ?

    Code:
     Step 3:
        Copy and paste the code below. 
    
    //MFC1.CPP - MFC Tutorial Part 1 from codersource.net
    
    #include <afxwin.h>
    
    class MFC_Tutorial_Window :public CFrameWnd
    {
    public:
        MFC_Tutorial_Window()
        {
             Create(NULL,"MFC Tutorial Part 1 CoderSource Window");
        }
    };
    
    class MyApp :public CWinApp
    {
       MFC_Tutorial_Window *wnd; 
    public:
       BOOL InitInstance()
       {
            wnd = new MFC_Tutorial_Window();
            m_pMainWnd = wnd;
            m_pMainWnd->ShowWindow(1);
            return 1;
         }
    };
    
    MyApp theApp;
    
    //End of program MFC Tutorial Part 1
    
    Step 4:
       Now compile the application. It will generate linker errors. The reason is because the MFC libraries are not yet linked. 
       Do the last step of this MFC Tutorial.
    Step 5:
    Select Menu -->Project --> Settings and General tab. On the first combo box "Microsoft Foundation classes" and select "Use MFC in shared dll".
       Now compile and run the program.
    how to do this with dev cpp ?

    edit
    missing all mfc header files like mfcvfx.h mfcwin.h etc.

  4. #4
    and the hat of sweating
    Join Date
    Aug 2007
    Location
    Toronto, ON
    Posts
    3,545
    I've never used Dev cpp, but you can download a free version of Visual C++ 2008 express from Microsoft's site (although, the free version doesn't have MFC; if that's something you need, you'll have to buy a copy).
    "I am probably the laziest programmer on the planet, a fact with which anyone who has ever seen my code will agree." - esbo, 11/15/2008

    "the internet is a scary place to be thats why i dont use it much." - billet, 03/17/2010

  5. #5
    Registered User kryptkat's Avatar
    Join Date
    Dec 2002
    Posts
    638
    Code:
    15 C:\Dev-Cpp\Project219\StdAfx.h afxwin.h: No such file or directory. 
    16 C:\Dev-Cpp\Project219\StdAfx.h afxext.h: No such file or directory. 
    17 C:\Dev-Cpp\Project219\StdAfx.h afxdisp.h: No such file or directory. 
    18 C:\Dev-Cpp\Project219\StdAfx.h afxdtctl.h: No such file or directory. 
    19 C:\Dev-Cpp\Project219\StdAfx.h afxmt.h: No such file or directory. 
    21 C:\Dev-Cpp\Project219\StdAfx.h afxcmn.h: No such file or directory. 
    12:3 C:\Dev-Cpp\Project219\Add.h #error include 'stdafx.h' before including this file for PCH 
    ...
    41 C:\Dev-Cpp\Project219\Add.h ISO C++ forbids declaration of `DECLARE_MESSAGE_MAP' with no type 
    23 C:\Dev-Cpp\Project219\AddDlg.h `CStatic' does not name a type 
    29 C:\Dev-Cpp\Project219\AddDlg.h variable or field `DoDataExchange' declared void 
    29 C:\Dev-Cpp\Project219\AddDlg.h `DoDataExchange' declared as a `virtual' field 
    39 C:\Dev-Cpp\Project219\AddDlg.h ISO C++ forbids declaration of `afx_msg' with no type 
    40 C:\Dev-Cpp\Project219\AddDlg.h `afx_msg' does not name a type 
    42 C:\Dev-Cpp\Project219\AddDlg.h ISO C++ forbids declaration of `afx_msg' with no type 
    ...
    17 C:\Dev-Cpp\Project219\Add.cpp `CWinApp' has not been declared 
     C:\Dev-Cpp\Project219\Makefile.win [Build Error]  [Add.o] Error 1
    here are some of the errors with the missing headers. It is a large project demo. I think I will have to re do this program in ansi c . With no mfc. It looked like a real nice demo.

    although, the free version doesn't have MFC
    I will stay with free ware. Thank you.

Popular pages Recent additions subscribe to a feed