CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 7 of 7

Thread: sharing exe's

  1. #1
    Join Date
    Feb 2008
    Posts
    53

    sharing exe's

    Hi,
    I just wanted to send a demo program of my Visual C++ application to a friend, (who isn't a programmer). In my first attempt, I copied all the DLL files I thought were necessary from my Windows/System32 folder, into the folder containing the exe, which i then zipped and sent.

    After unzipping, my friend recieved the following message when trying to run the exe:

    "This application has failed to start because the application configuration is incorrect. Reinstalling the application may fix the problem"

    Is that likely to be missing DLLs?

    I tried running my application from my visual C++ editor (debug mode)
    and it shows the following list of DLLs
    Code:
    'freetypesuccess.exe': Loaded 'C:\Documents and Settings\Rav\My Documents\Visual Studio 2008\Projects\freetypesuccess\Debug\freetypesuccess.exe', Symbols loaded.
    'freetypesuccess.exe': Loaded 'C:\WINDOWS\system32\ntdll.dll'
    'freetypesuccess.exe': Loaded 'C:\WINDOWS\system32\kernel32.dll'
    'freetypesuccess.exe': Loaded 'C:\WINDOWS\system32\opengl32.dll'
    'freetypesuccess.exe': Loaded 'C:\WINDOWS\system32\msvcrt.dll'
    'freetypesuccess.exe': Loaded 'C:\WINDOWS\system32\advapi32.dll'
    'freetypesuccess.exe': Loaded 'C:\WINDOWS\system32\rpcrt4.dll'
    'freetypesuccess.exe': Loaded 'C:\WINDOWS\system32\secur32.dll'
    'freetypesuccess.exe': Loaded 'C:\WINDOWS\system32\gdi32.dll'
    'freetypesuccess.exe': Loaded 'C:\WINDOWS\system32\user32.dll'
    'freetypesuccess.exe': Loaded 'C:\WINDOWS\system32\glu32.dll'
    'freetypesuccess.exe': Loaded 'C:\WINDOWS\system32\ddraw.dll'
    'freetypesuccess.exe': Loaded 'C:\WINDOWS\system32\dciman32.dll'
    'freetypesuccess.exe': Loaded 'C:\WINDOWS\system32\glut32.dll', Binary was not built with debug information.
    'freetypesuccess.exe': Loaded 'C:\WINDOWS\system32\winmm.dll'
    'freetypesuccess.exe': Loaded 'C:\Documents and Settings\Rav\My Documents\Visual Studio 2008\Projects\freetypesuccess\Debug\glc32.dll', Binary was not built with debug information.
    'freetypesuccess.exe': Loaded 'C:\Documents and Settings\Rav\My Documents\Visual Studio 2008\Projects\freetypesuccess\Debug\freetype6.dll', Binary was not built with debug information.
    'freetypesuccess.exe': Loaded 'C:\Documents and Settings\Rav\My Documents\Visual Studio 2008\Projects\freetypesuccess\Debug\zlib1.dll', Binary was not built with debug information.
    'freetypesuccess.exe': Loaded 'C:\Documents and Settings\Rav\My Documents\Visual Studio 2008\Projects\freetypesuccess\Debug\fontconfig.dll', Binary was not built with debug information.
    'freetypesuccess.exe': Loaded 'C:\Documents and Settings\Rav\My Documents\Visual Studio 2008\Projects\freetypesuccess\Debug\xmlparse.dll', Binary was not built with debug information.
    'freetypesuccess.exe': Loaded 'C:\WINDOWS\WinSxS\x86_Microsoft.VC90.DebugCRT_1fc8b3b9a1e18e3b_9.0.21022.8_x-ww_597c3456\msvcp90d.dll'
    'freetypesuccess.exe': Loaded 'C:\WINDOWS\WinSxS\x86_Microsoft.VC90.DebugCRT_1fc8b3b9a1e18e3b_9.0.21022.8_x-ww_597c3456\msvcr90d.dll'
    'freetypesuccess.exe': Loaded 'C:\WINDOWS\system32\uxtheme.dll'
    'freetypesuccess.exe': Loaded 'C:\Program Files\SiteAdvisor\6261\saHook.dll'
    'freetypesuccess.exe': Loaded 'C:\WINDOWS\system32\ialmgicd.dll', Binary was not built with debug information.
    'freetypesuccess.exe': Loaded 'C:\WINDOWS\system32\ialmgdev.dll', Binary was not built with debug information.
    'freetypesuccess.exe': Loaded 'C:\WINDOWS\system32\mcd32.dll'
    'freetypesuccess.exe': Unloaded 'C:\WINDOWS\system32\mcd32.dll'
    I suppose I could just painstakingly dump all these into the same folder as the exe before sending it to my friend, but I believe that some of them may depend on system specific configurations.

    So whats the professional way to handle this?

  2. #2
    Join Date
    Feb 2000
    Location
    San Diego, CA
    Posts
    10,354

    Re: sharing exe's

    Please search the forums for keywords from the error message. This question has been asked many times.

  3. #3
    Join Date
    Oct 2006
    Posts
    94

    Re: sharing exe's

    C++ compiles in to a stand alone .exe unless you have specifically linked to certain .dll files. Therfore the only .dll files you need to send him are the ones you linked to (if any)

  4. #4
    Join Date
    Oct 2006
    Location
    Sweden
    Posts
    3,654

    Re: sharing exe's

    MS license agreement don't allow for distribution of debug runtime dll's.

    Do you use VC express? If so you can ask your friend to install it.
    If not, either your friend have to install VC9 runtime and you have to give him a release built exe or you can statically link the runtime to the exe (quite possible this violates the license as well).

    All other dll's your app is using have to be handled in a similar way
    Debugging is twice as hard as writing the code in the first place.
    Therefore, if you write the code as cleverly as possible, you are, by
    definition, not smart enough to debug it.
    - Brian W. Kernighan

    To enhance your chance's of getting an answer be sure to read
    http://www.codeguru.com/forum/announ...nouncementid=6
    and http://www.codeguru.com/forum/showthread.php?t=366302 before posting

    Refresh your memory on formatting tags here
    http://www.codeguru.com/forum/misc.php?do=bbcode

    Get your free MS compiler here
    https://visualstudio.microsoft.com/vs

  5. #5
    Arjay's Avatar
    Arjay is offline Moderator / EX MS MVP Power Poster
    Join Date
    Aug 2004
    Posts
    13,490

    Re: sharing exe's

    Compile your application as a Release build.

    Then open a Visual studio command prompt and run "Depends.exe" on your application. This program will tell you which dependent dll's are missing.

  6. #6
    Join Date
    Aug 2004
    Location
    Bucharest, Romania... sometimes
    Posts
    1,039

    Re: sharing exe's

    I've noticed that your application is using both OpenGL and DirectX... none of these libraries should be copied across different machines. OpenGL support should be "compatible" with the driver of the installed graphics card. DirectX should be INSTALLED by running the setup provided by MS. For both packages, you should not mix different versions of the dlls. Image what may happen if GLUT vs 2.0 is using GL vs 1.1. Same goes for the dlls for DirectX.

    Also, your application is using a dll from SiteAdvisor! The saHook.dll might need registration, registry entries, other dlls, and so on. It might be that the error message is refering to this application not being properly installed on your friends machine.

    Best regards,
    Bogdan Apostol
    ESRI Developer Network

    Compilers demystified - Function pointers in Visual Basic 6.0
    Enables the use of function pointers in VB6 and shows how to embed native code in a VB application.

    Customize your R2H
    The unofficial board dedicated to ASUS R2H UMPC owners.

  7. #7
    Join Date
    Mar 2006
    Posts
    12

    Re: sharing exe's

    Quote Originally Posted by Mikau
    Hi,

    After unzipping, my friend recieved the following message when trying to run the exe:

    "This application has failed to start because the application configuration is incorrect. Reinstalling the application may fix the problem"
    In visual studio after selecting the Release mode configuration follow the steps below.

    This is for Win32 projects.

    1. go to project properties.
    2. Select "All Configuration" and then "Configuration properties"
    3. Click in "C/C++" and then "Code generation"
    4. In "Runtime Library" select "Multithreaded /MT" option.
    5. Save and compile the Release mode and share it.

    If you are using additional DLL like Glut then you need to give those also.

    The error above arise when you have missing or different version of core redistributable DLLs.

    For MFC use static linking option.
    Kavitesh Singh

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured