Visual C++ 2010 Express Portable Programs

This is a discussion on Visual C++ 2010 Express Portable Programs within the C++ Programming forums, part of the General Programming Boards category; I have written several C++ programs with MicroSoft Visual C++ 2010 Express. I would like to be able to run ...

  1. #1
    Registered User
    Join Date
    Jan 2011
    Location
    Portland, CT
    Posts
    9

    Visual C++ 2010 Express Portable Programs

    I have written several C++ programs with MicroSoft Visual C++ 2010 Express. I would like to be able to run them on other computers that do not have Visual C++ Express installed. How can I make these programs portable?

  2. #2
    Registered User
    Join Date
    May 2011
    Location
    Around 8.3 light-minutes from the Sun
    Posts
    1,866
    What do you mean? Take the source code and compile them on other computers? Or just the compiled program?
    Quote Originally Posted by anduril462 View Post
    Now, please, for the love of all things good and holy, think about what you're doing! Don't just run around willy-nilly, coding like a drunk two-year-old....
    Quote Originally Posted by quzah View Post
    ..... Just don't be surprised when I say you aren't using standard C anymore, and as such,are off in your own little universe that I will completely disregard.
    Warning: Some or all of my posted code may be non-standard and as such should not be used and in no case looked at.

  3. #3
    Registered User
    Join Date
    Jan 2011
    Location
    Portland, CT
    Posts
    9
    I want to compile and make an executable program on a computer with Visual C++ 2010 Express and be able to move this executable file to another computer that does not have VC++ Express installed.

  4. #4
    Registered User
    Join Date
    May 2011
    Location
    Around 8.3 light-minutes from the Sun
    Posts
    1,866
    Then just compile it and take the exe with you. I don't see what the problem is.
    Quote Originally Posted by anduril462 View Post
    Now, please, for the love of all things good and holy, think about what you're doing! Don't just run around willy-nilly, coding like a drunk two-year-old....
    Quote Originally Posted by quzah View Post
    ..... Just don't be surprised when I say you aren't using standard C anymore, and as such,are off in your own little universe that I will completely disregard.
    Warning: Some or all of my posted code may be non-standard and as such should not be used and in no case looked at.

  5. #5
    and the Hat of Guessing tabstop's Avatar
    Join Date
    Nov 2007
    Posts
    14,185
    Either use static linking (so there are no dependencies on DLL) or have them get the DLL.

  6. #6
    Banned
    Join Date
    Aug 2010
    Location
    Ontario Canada
    Posts
    9,547
    Quote Originally Posted by Bronx68 View Post
    I have written several C++ programs with MicroSoft Visual C++ 2010 Express. I would like to be able to run them on other computers that do not have Visual C++ Express installed. How can I make these programs portable?
    You do realize, of course, that you are making Windows native executables... they will run on any Windows computer. You do not have to be inside VC++ to run them.

    Also take tabstop's advice and compile with static linking...


    (Surprisingly I ran into this with a friend who's working with Pelles C... He wrote several nice proggys but didn't realize he could run them either from the command line or clicking with the mouse.)

  7. #7
    Registered User
    Join Date
    Jan 2011
    Location
    Portland, CT
    Posts
    9
    Quote Originally Posted by AndrewHunter View Post
    Then just compile it and take the exe with you. I don't see what the problem is.
    No, we tried this several times and it doesn't work on any computer except the one is was created on.

  8. #8
    Registered User
    Join Date
    Aug 2003
    Posts
    1,205
    Doesn't work how?

    Edit:
    Oh look what a quick google found: http://forums.wxwidgets.org/viewtopic.php?f=23&t=30639
    Last edited by Shakti; 08-01-2011 at 10:57 AM.

  9. #9
    Registered User
    Join Date
    Jan 2011
    Location
    Portland, CT
    Posts
    9
    We try starting the program from Windows Explorer and get this message:
    Application has failed to start because MSVCP100D.dll wat not found

  10. #10
    Registered User
    Join Date
    May 2011
    Location
    Around 8.3 light-minutes from the Sun
    Posts
    1,866
    Quote Originally Posted by tabstop View Post
    Either use static linking (so there are no dependencies on DLL) or have them get the DLL.
    Do what tabstop told you to do. <<See quote>>
    Quote Originally Posted by anduril462 View Post
    Now, please, for the love of all things good and holy, think about what you're doing! Don't just run around willy-nilly, coding like a drunk two-year-old....
    Quote Originally Posted by quzah View Post
    ..... Just don't be surprised when I say you aren't using standard C anymore, and as such,are off in your own little universe that I will completely disregard.
    Warning: Some or all of my posted code may be non-standard and as such should not be used and in no case looked at.

  11. #11
    Registered User
    Join Date
    Jan 2011
    Location
    Portland, CT
    Posts
    9
    I have tried static linking and get the same message. I will have them download the dll and try tomorrow morning.
    Thanks,

  12. #12
    Registered User
    Join Date
    Jan 2010
    Posts
    412
    Compile in release mode instead of debug. Debug DLLs are not included in the downloadable runtime.

  13. #13
    Registered User hk_mp5kpdw's Avatar
    Join Date
    Jan 2002
    Location
    Northern Virginia/Washington DC Metropolitan Area
    Posts
    3,802
    Depending on what type of project, in addition to the Visual Studio run-time redistributable, the target machine may also need to ensure they have the .NET run-time installed as well.
    "Owners of dogs will have noticed that, if you provide them with food and water and shelter and affection, they will think you are god. Whereas owners of cats are compelled to realize that, if you provide them with food and water and shelter and affection, they draw the conclusion that they are gods."
    -Christopher Hitchens

  14. #14
    Algorithm Dissector iMalc's Avatar
    Join Date
    Dec 2005
    Location
    New Zealand
    Posts
    6,307
    Quote Originally Posted by Bronx68 View Post
    We try starting the program from Windows Explorer and get this message:
    Application has failed to start because MSVCP100D.dll wat not found
    As someone has already noticed, The D at the end of that DLL name means that it is looking for the debug DLL, which means you built it as debug. You cannot distribute debug versions of your program.
    My homepage
    Advice: Take only as directed - If symptoms persist, please see your debugger

    Linus Torvalds: "But it clearly is the only right way. The fact that everybody else does it some other way only means that they are wrong"

  15. #15
    Registered User
    Join Date
    Jan 2011
    Location
    Portland, CT
    Posts
    9
    When I build it as a release program as suggested it gets a compile error.
    1>------ Build started: Project: Lesson2, Configuration: Release Win32 ------
    1>cl : Command line error D8016: '/clr' and '/MT' command-line options are incompatible
    ========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

Page 1 of 2 12 LastLast
Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Visual C++ 2010 Express - difference from 2008?
    By ulillillia in forum Tech Board
    Replies: 26
    Last Post: 08-01-2011, 09:08 PM
  2. Visual C++ 2010 Express Portable Programs
    By Bronx68 in forum Windows Programming
    Replies: 1
    Last Post: 08-01-2011, 09:07 AM
  3. C project in Microsoft Visual C++ 2010 Express?
    By alexbcg in forum C Programming
    Replies: 2
    Last Post: 12-08-2010, 01:39 PM
  4. Micosoft Visual C++ 2010 Express writing to a file?
    By Kat007 in forum C++ Programming
    Replies: 6
    Last Post: 09-19-2010, 10:00 AM
  5. Visual C++ 2010 express problems
    By dnj23 in forum Windows Programming
    Replies: 6
    Last Post: 08-10-2010, 06:16 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21