Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium


How do i compile an application where it will include all the libraries and be able to run on any computer?

Posted on 2005-03-08
Medium Priority
Last Modified: 2013-11-25
I've written a program in MFC.  As of now, the workspace probably has 19 .cpp files and an example of the libraries i have included are below:

#include "stdafx.h"
#include "piggy.h" //user defined
#include "Login_In.h" //user defined
#include "MainMenu.h" //user defined
#include "pickQuestions.h" //user defined

#include "New_User.h" //user defined
#include "User.h" //user defined
#include "QandA.h" //userdefined

#include "wininet.h"
#include "winnt.h"

#include <fstream>
#include <iostream.h>
#include <stdio.h>
#include <stdlib.h>
#include <conio.h>
#include <string>
#include <vector>
#include <cstring>

I've try to run the executable on my friend's computer but it gives him errors saying he needed the MFC something (?).
He suggested that I do a static compile, which would tack all the libraries right into the program (making the executable very large, but im not too worried about the size)...and he said something about the MFC drivers?

Anyways, I got kind of confused at that point.  All I know for sure is that right now, this program is only executing on my computer.  Any help would be oh so greatly appreciate on how i can get this program to work anywhere!
Question by:chinese_bunny

Accepted Solution

sgvill earned 1400 total points
ID: 13486367
In your Project Settings, Under the general tab, select "Use MFC in a static library".  

LVL 86

Assisted Solution

jkr earned 600 total points
ID: 13486554
Apart from the option to link MFC statically, are you sure you're doing a *release* build?

See also http://msdn.microsoft.com/library/en-us/vccore/html/vcoriRedistributingMFCATLOLEDBTemplatesApplications.asp ("Redistributing MFC, ATL, and OLE DB Templates Applications"). You'll also find this file as "redist.wri" on yout VC++ CD-ROM.

Author Comment

ID: 13486722
Thank you very much for both your comments. :)
they are very helpful. <3333

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A theme is a collection of property settings that allow you to define the look of pages and controls, and then apply the look consistently across pages in an application. Themes can be made up of a set of elements: skins, style sheets, images, and o…
Entering time in Microsoft Access can be difficult. An input mask often bothers users more than helping them and won't catch all typing errors. This article shows how to create a textbox for 24-hour time input with full validation politely catching …
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…

571 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question