cannot run application

Sep 9, 2009 at 2:33pm
Hi, I built a windows consol application and it runs rine on my computer, but when i try to run it on my brothers computer it says

"this program cannot run. please try reinstalling the application"

he is running the same version of windows xp as i am, the only difference is that he doesnt have MS VC++ installed on his computer...

could the program that I am building link to MS VC C++ stuff?

I am hoping for some suggestions on where to look.


Edit..

I found out that my program is linking to some file inside of the MS VC 2008 directory. How do I find out what file that is, or make it so that my program is not dependant on that directory so others who do not have MS VC 2008 can run my propram?
Last edited on Sep 9, 2009 at 3:01pm
Sep 9, 2009 at 4:07pm
You need to link statically to the C++ library, to do so change this setting:
Project > Properties > Configuration Properties > C/C++ > Code Generation > RunTime Library > Multy threaded (/MT)
Oct 21, 2009 at 6:47pm
Hi,

Sorry for the bump, but I'm trying this too.

When I do the above, I get a lot of errors when compiling, like:
error LNK2005: "public: void __thiscall std::_Container_base_secure::_Orphan_all(void)const " (?_Orphan_all@_Container_base_secure@std@@QBEXXZ) already defined in msvcprtd.lib(MSVCP90D.dll)
error LNK2005: "public: __thiscall std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &)" (??0?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAE@ABV01@@Z) already defined in msvcprtd.lib(MSVCP90D.dll)

Is this maybe because mine isn't a console app, but a win32 one? What's wrong here?
Oct 23, 2009 at 4:22pm
When using VC++ start from an Empty Project.
Oct 23, 2009 at 5:50pm
In addition to statically linking, you must make sure that you are running a Release version, for if your brother doesn't have VS installed on his computer, then you cannot run the Debug version.
Last edited on Oct 23, 2009 at 5:50pm
Topic archived. No new replies allowed.