Thread: Creating a Stand-Alone Application

  1. #1
    Registered User
    Join Date
    Oct 2003

    Creating a Stand-Alone Application

    I have been programming with Qt (a C++ class library used to create GUIs) for over 6 months now, and I am nearing completion of a project for my company. The code is complete, and my final goal in this project is to make the GUI a stand-alone application. I have had a great deal of trouble trying to learn exactly how this is done under Microsoft Visual C++.

    Basically, all I want to do is to get this app to run on any Windows machine so the end user doesn't need all the .dlls. How do I go about doing this? Do I need to create a static library for the application and link it to that, or is there a way to have just the .exe run on its own (stand-alone style)?

    I don't think knowledge of Qt is necessary. It is only one of the few .dlls I need to link to the application. The following is a list of my system information and programming environment:

    -Windows 98
    -MS VC++
    -*MOCing through moc.exe (using DOS to create the MOC files)

    Any information concerning this problem would be greatly appreciated. Thanks!

    -Bob Leonard

  2. #2
    Guest Sebastiani's Avatar
    Join Date
    Aug 2001
    Waterloo, Texas
    The DLL's *must* be present in order for your app to run. The only other way out would be to write or aquire a utility that converts one to a static lib. Structurally, a dll is identical to an exe (a single bit differentiates the two). Thus, an exe-to-lib utility would work equally well (provided one even exists, of course).
    #include <cmath>
    #include <complex>
    bool euler_flip(bool value)
        return std::pow
            std::complex<float>(0, 1) 
            * std::complex<float>(std::atan(1.0)
            *(1 << (value + 2)))
        ).real() < 0;

  3. #3
    Registered User
    Join Date
    Oct 2003

    More Info..

    I apologise for the confusion, but I am NOT using .dlls. Actually, I have the static libraries (.lib) for my 3rd party classes. With this in mind, how would I go about creating a stand-alone .exe in MS VC++? Thanks for the help and response!


  4. #4
    Join Date
    Feb 2002
    I admit that I don't know much about this, but I think it has to do with the __declspec(dllexport) and __declspec(dllimport) calls that tells it to link dynamically instead of statically. I did this once several years ago, but I don't remember much.
    If I did your homework for you, then you might pass your class without learning how to write a program like this. Then you might graduate and get your degree without learning how to write a program like this. You might become a professional programmer without knowing how to write a program like this. Someday you might work on a project with me without knowing how to write a program like this. Then I would have to do you serious bodily harm. - Jack Klein

  5. #5
    Magically delicious LuckY's Avatar
    Join Date
    Oct 2001
    It depends on the version of MSVC you have. Is it professional or enterprise edition? If so, set the project to "Using MFC in a static library" instead of "Using MFC in a shared DLL" (or of course if you aren't using MFC you'd choose "Not using MFC").


Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Profiler Valgrind
    By afflictedd2 in forum C++ Programming
    Replies: 4
    Last Post: 07-18-2008, 09:38 AM
  2. creating an application
    By Cpro in forum C++ Programming
    Replies: 21
    Last Post: 05-30-2008, 12:21 AM
  3. Problem with com application
    By amardon in forum C++ Programming
    Replies: 3
    Last Post: 10-06-2005, 05:50 AM
  4. Creating a Dialog Based Application without MFC
    By MitchellH in forum C++ Programming
    Replies: 8
    Last Post: 05-21-2005, 10:02 AM