911: still can't build a standalone application
-
Hi, guys -
I thought I had this licked, but evidently I was wrong.
I have a single-file program that I NEED to build into a standalone application. It uses a couple of files that I find with this line in my .pro file:
@LIBS += -lws2_32@
It seems to execute OK on my system, but when I sent the binary to someone, he got a message about missing .dlls.
Am I overlooking something?
Any quick help on this would be most appreciated; it's squarely on the critical path and I'm in the hot seat.
Thanks...
-
Here's my .pro file:
@TEMPLATE = app
CONFIG += CONSOLE
CONFIG -= qt
TARGET = storefile
SOURCES +=
storefile_client.cppHEADERS +=
storefile_client.h
../../inc/flashconstants.hwin32:LIBS += -lws2_32
INCLUDEPATH += "../../inc/"
@So, I guess I don't link against Qt.
If I understand what you're saying, it's that I should assume that any system trying to run my app already has this library? I can make that a user requirement if need be, though I was hoping to have a truly self-contained app image.
Thanks.
-
Are you using MinGW by any chance? There are some DLL dependencies such as mingw10.dll if I remember correctly and maybe one or two others.
If you are using Visual Studio, make sure you create your executable with static runtime linking (/MT) as specified "here":http://goo.gl/dzLwL otherwise you need to redistribute the runtime distributable for that specific version of Visual Studio along side your application.
Anyway you can find out which DLLs your executable is linked against using a tool named Dependecy Walker which you will find "here":http://www.dependencywalker.com/Hope this helps!
-
OK...I added a line:
@QMAKE_CXXFLAGS += /MT@
The compiler warned me that it was overriding /MT with /MDd (which from the description on the MS page looks OK).
My executable only grew about 1K in size, though, which has me wondering if it did indeed pick up all the needed files during compilation. Running the app on my system isn't a good test (since I have all the libraries anyway), so I guess I'll have to find a system with an older version of Windows, huh?
Thanks for all the help...I think I'm at least on the right track here.