Thread: Including The Right DLLs

  1. #1
    Registered User
    Join Date
    Nov 2005
    Posts
    545

    Including The Right DLLs

    A little while ago I was asking why my game wouldn't work on other people's PCs. I was told this was because they didn't have the required DLLs that come with MSVC++ Express, but that it was possible to link these with the other files. What DLLs do I need to do this as I have found nothing on the internet and how do I link them?

    Thanks

    Bumfluff

  2. #2
    Registered User
    Join Date
    May 2006
    Posts
    903
    You have to build in release mode instead of debug mode. Debug mode requires DLLs that come with MSVC++ while release mode doesn't.

    Generally speaking, you shouldn't have to join DLLs with your programs unless they are from a library you had to download (i.e. SDL, Ogre...) or if you made your own DLL. Otherwise, you don't have to join DLLs.

  3. #3
    Registered User
    Join Date
    Jan 2006
    Location
    Sweden
    Posts
    92
    Tell them to install Visual C redistributable, that should do the trick. I had to switch a compiler mode:
    Project properties -> C++ -> Code generation -> Runtine Library

    In debug mode set this to Multi-Threaded debug, instead of DLL and in normal set it to just Multi-Threaded (if you wish to have that setting). Then it worked for me on a computer that did not have VS 2005, but I haven't tried if it works on computers that don't have vc redistributable.

    Good luck

    Wazaa

  4. #4
    Registered User
    Join Date
    Nov 2005
    Posts
    545
    Well when I put it into release mode I got about 13 errors and when I tried just Multi-Threaded as that was the only one that would work other than multi-threaded Debug with DLL. When someone with MSVC++ Exp. they got this error:
    Code:
    This application has failed to start because d3dx9_30.dll was not found. Re-installing the application may fix this problem.
    Any idea how to fix that one.

  5. #5
    Registered User
    Join Date
    May 2006
    Posts
    903
    What were the errors in Release mode ? Debug mode kinds of patches your errors and Release mode doesn't do anything to prevent your errors so it's normal that you get more errors. d3dx9 is obviously Direct3D 9; therefore, I conclude that this person doesn't have Direct X 9 installed and that you used DirectX 9 to code.

  6. #6
    Registered User
    Join Date
    Nov 2005
    Posts
    545
    Thing is they do have Direct X 9 installed, but they don't seem to have all teh Direct X files that I have.

    Code:
    1>.\GonnaWork.cpp(55) : error C2440: '=' : cannot convert from 'const char [12]' to 'LPCWSTR'
    1>        Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
    1>.\GonnaWork.cpp(94) : error C2664: 'CreateWindowExW' : cannot convert parameter 2 from 'const char [12]' to 'LPCWSTR'
    1>        Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
    1>.\GonnaWork.cpp(107) : error C2664: 'MessageBoxW' : cannot convert parameter 2 from 'const char [28]' to 'LPCWSTR'
    1>        Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
    1>.\GonnaWork.cpp(121) : error C2664: 'MessageBoxW' : cannot convert parameter 2 from 'const char [31]' to 'LPCWSTR'
    1>        Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
    1>.\GonnaWork.cpp(128) : error C2664: 'MessageBoxW' : cannot convert parameter 2 from 'const char [28]' to 'LPCWSTR'
    1>        Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
    1>game.cpp
    1>.\game.cpp(48) : error C2664: 'MessageBoxW' : cannot convert parameter 2 from 'const char [29]' to 'LPCWSTR'
    1>        Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
    1>.\game.cpp(55) : error C2664: 'MessageBoxW' : cannot convert parameter 2 from 'const char [32]' to 'LPCWSTR'
    1>        Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
    1>dxinput.cpp
    1>dxgraphics.cpp
    1>.\dxgraphics.cpp(20) : error C2664: 'MessageBoxW' : cannot convert parameter 2 from 'const char [28]' to 'LPCWSTR'
    1>        Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
    1>.\dxgraphics.cpp(50) : error C2664: 'MessageBoxW' : cannot convert parameter 2 from 'const char [31]' to 'LPCWSTR'
    1>        Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
    1>.\dxgraphics.cpp(71) : error C2664: 'D3DXGetImageInfoFromFileW' : cannot convert parameter 1 from 'char *' to 'LPCWSTR'
    1>        Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
    1>.\dxgraphics.cpp(96) : error C2664: 'D3DXLoadSurfaceFromFileW' : cannot convert parameter 4 from 'char *' to 'LPCWSTR'
    1>        Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
    1>.\dxgraphics.cpp(118) : error C2664: 'D3DXGetImageInfoFromFileW' : cannot convert parameter 1 from 'char *' to 'LPCWSTR'
    1>        Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
    1>.\dxgraphics.cpp(137) : error C2664: 'D3DXCreateTextureFromFileExW' : cannot convert parameter 2 from 'char *' to 'LPCWSTR'
    1>        Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
    Those are the errors I get from release mode.

  7. #7
    Registered User Tonto's Avatar
    Join Date
    Jun 2005
    Location
    New York
    Posts
    1,465
    Be more unicode freidnly, or undefine unicode.

  8. #8
    Registered User
    Join Date
    Nov 2005
    Posts
    545
    When I change to using Multi-Byte Character Set or Not Set I get twelve errors instead all saying that things are undefined.

  9. #9
    Registered User VirtualAce's Avatar
    Join Date
    Aug 2001
    Posts
    9,607
    If you are trying to get your exe to run on another system you should be using the MSVS Setup and Deployment Projects and following the instructions laid out in the help file under Setup and Deployment.

    If you follow those instructions you will have little, if any, trouble installing your app on another system.

    If you are attempting to give someone the source so they can compile it they must have:

    1. Windows Platform SDK
    2. DirectX SDK (same version you used)
    3. MSVS Express or better

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Can we have vector of vector?
    By ketu1 in forum C++ Programming
    Replies: 24
    Last Post: 01-03-2008, 05:02 AM
  2. C++ std routines
    By siavoshkc in forum C++ Programming
    Replies: 33
    Last Post: 07-28-2006, 12:13 AM
  3. standart dlls
    By keeper in forum C++ Programming
    Replies: 3
    Last Post: 07-05-2006, 07:32 PM
  4. Including DLL's
    By stickman in forum C++ Programming
    Replies: 29
    Last Post: 04-10-2006, 11:34 PM
  5. Can't load string from resource DLL's string table
    By s_k in forum Windows Programming
    Replies: 4
    Last Post: 07-15-2003, 06:43 AM