954,504 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

c++ problem

hello i wrote a c++ program, and i wanted to send it to my friends, but everytime i send the exe file to them, they tell me they get the error: "The application has failed to start because the application configuration is incorrect". I tried to put it on rapidshare, and i downloaded it to my computer, it ran. So i did a little research, and i dont really understand. is it because my friends have vista, or do i have to link staticaly (which idk how to do). Anyways the question is, how can i send the exe of a c++ to someone without sending them the code itself and then them compiling it. Thanks for any help.

aburich_44
Newbie Poster
10 posts since Feb 2007
Reputation Points: -1
Solved Threads: 0
 

static libraries go to Properties - Configuration Properties - C/C++ - Code Generation - Runtime Library and select either "Multi-threaded (/MT)" or "Multi-threaded Debug (/MTd). Otherwise, you'll have to distribute the runtimes with it.

Comatose
Taboo Programmer
Team Colleague
2,910 posts since Dec 2004
Reputation Points: 361
Solved Threads: 215
 

thanks for that. I am using c++ express edition, cant seem to find properties.

aburich_44
Newbie Poster
10 posts since Feb 2007
Reputation Points: -1
Solved Threads: 0
 

ouch. I think express edition doesn't have the ability to statically link to libraries :icon_eek:

You will need to ship the libraries with your app. Check This Link , and hopefully you can get it to work that way. But personal suggestion: get a better compiler ;)

Comatose
Taboo Programmer
Team Colleague
2,910 posts since Dec 2004
Reputation Points: 361
Solved Threads: 215
 

thank you. Do you think that c++ regular edition lets me do that?

aburich_44
Newbie Poster
10 posts since Feb 2007
Reputation Points: -1
Solved Threads: 0
 

I personally would suggest using an IDE that's free and fully functional such as Code::Blocks which has a rich set of Features , a pretty good FAQ, and a forum. Personally, I'd download the version that comes with mingw (second link under windows).

Comatose
Taboo Programmer
Team Colleague
2,910 posts since Dec 2004
Reputation Points: 361
Solved Threads: 215
 

You can do it in express. Right click your .cpp file and then properties. Works for me at least.

MatEpp
Junior Poster in Training
79 posts since Jan 2009
Reputation Points: 21
Solved Threads: 12
 

ok after i download it do i have to change my code at all, like the include statements, or will it just work if i paste the code in codeblocks? thanks for ur help..

aburich_44
Newbie Poster
10 posts since Feb 2007
Reputation Points: -1
Solved Threads: 0
 

You should be able to simply paste the code... though it would be interesting to know if MatEpp's suggestion works in your copy of Express.

Comatose
Taboo Programmer
Team Colleague
2,910 posts since Dec 2004
Reputation Points: 361
Solved Threads: 215
 

i dont think so. i mean i right clicked it, then i clicked properties, and i didnt find anything about Runtime Library or "Multi-threaded (/MT)" or "Multi-threaded Debug (/MTd)... its just like a regular files properties. anyways that program blocks watever, i cant find the MT thing :( :(

aburich_44
Newbie Poster
10 posts since Feb 2007
Reputation Points: -1
Solved Threads: 0
 

try to zip it up. If you have visual studio 8. Then build your code.

Then open my computer. Go to C: , then find visual studi 2008. Then
find you project name. Then search the folder for .exe file.
Clik on it to make sure it works. Then right click the file, and go to send to, then Compressed(zipped) Folder. Then send it to whomever.

firstPerson
Senior Poster
3,923 posts since Dec 2008
Reputation Points: 841
Solved Threads: 608
 
i dont think so. i mean i right clicked it, then i clicked properties, and i didnt find anything about Runtime Library or "Multi-threaded (/MT)" or "Multi-threaded Debug (/MTd)... its just like a regular files properties. anyways that program blocks watever, i cant find the MT thing :( :(

In Solution Explorer, right click your Project name & then Properties, it's then under Configuration Properties -> C/C++ -> Code Generation, it's near the middle "Runtime Library", change that to Multi-Threads (/MT) Although I will just note I'm not sure if it's the same under Express, as I haven't used the Express version of Visual Studio.try to zip it up. If you have visual studio 8. Then build your code.

Then open my computer. Go to C: , then find visual studi 2008. Then
find you project name. Then search the folder for .exe file.
Clik on it to make sure it works. Then right click the file, and go to send to, then Compressed(zipped) Folder. Then send it to whomever.

He's not asking how to send it to someone else, he's asking why when he does send it to someone else it won't work on their computer, to which the reason is it's not able to link to the resources necessary, 1 of the easiest ways to solve that problem is to just statically link in all the necessary code.

Yiuca
Junior Poster in Training
89 posts since Sep 2008
Reputation Points: 60
Solved Threads: 17
 
i dont think so. i mean i right clicked it, then i clicked properties, and i didnt find anything about Runtime Library or "Multi-threaded (/MT)" or "Multi-threaded Debug (/MTd)... its just like a regular files properties. anyways that program blocks watever, i cant find the MT thing :( :(

Oh thats weird. I did it in 2005 edition just how Comatose explained.

Also if I remember right this problem can be solved by building your application as a Microsoft app instead of an empty clr project.

Or perhaps it had to be built as a Microsoft app for what Comatose is explaining to work.:-/

MatEpp
Junior Poster in Training
79 posts since Jan 2009
Reputation Points: 21
Solved Threads: 12
 

I thought of something last night. When clicking the .cpp file make sure you do that inside the IDE. I wasn't clear about that on my first post.

MatEpp
Junior Poster in Training
79 posts since Jan 2009
Reputation Points: 21
Solved Threads: 12
 

[QUOTE

He's not asking how to send it to someone else, he's asking why when he does send it to someone else it won't work on their computer, to which the reason is it's not able to link to the resources necessary, 1 of the easiest ways to solve that problem is to just statically link in all the necessary code.[/QUOTE]

I just thought this he should give this a try. It works somethimes.

firstPerson
Senior Poster
3,923 posts since Dec 2008
Reputation Points: 841
Solved Threads: 608
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You