CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Join Date
    Jun 2008
    Posts
    7

    Using MFC in a static library, and com port errors

    Hi

    I have a project where I'm communication with an external device via an RS232 interface.

    When I have the project set up to build with debug output and I run it by pressing F5, I have no problems. If a take a copy of the executable to another PC without Visual studio installed it won't run, and I get errors about DLLs missing. After a bit of searching I found a suggestion to statically include MFC in the build. When I set the option to do this I cannot build the project with the debug option set because I get errors about multiple definitions of functions. If I choose the release option the project builds but then says it cannot communicate via the RS232 port.

    I know this my be a really dumb question for some, but how do I determine what DLLs my application will need, and how do I ensure that the app can find them when it is being run?

    Thank in advance

    Andrew

  2. #2
    Join Date
    Jul 2002
    Posts
    2,543

    Re: Using MFC in a static library, and com port errors

    What version of Visual Studio do you use?
    In VS 2005, you need to install VC++ runtime on a destination computer:
    Program Files\Microsoft Visual Studio 8\SDK\v2.0\BootStrapper\Packages\vcredist_x86\vcredist_x86.exe

    Other versions have their own runtime installations. If you make program istallation package supporting Windows Installer, add VC++ Runtime Merge Module to it.
    It is better to use MFC as dynamic library, and install runtime library.

  3. #3
    Join Date
    Jun 2008
    Posts
    7

    Re: Using MFC in a static library, and com port errors

    Hi Alex,

    Thanks for the help. My problems solved now.

    Andrew

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