Distribution Topic is solved

If you are using the main C++ distribution of wxWidgets, Feel free to ask any question related to wxWidgets development here. This means questions regarding to C++ and wxWidgets, not compile problems.
Post Reply
demize
In need of some credit
In need of some credit
Posts: 8
Joined: Sun Feb 04, 2007 1:05 am

Distribution

Post by demize »

Is there anything you need to do to distribute your program? Any DLLs to include? Any special way to build it?
Auria
Site Admin
Site Admin
Posts: 6695
Joined: Thu Sep 28, 2006 12:23 am
Contact:

Post by Auria »

That depends how you built it - you need to understand how libs work and what you have built.

I recommend you read about static libs / dlls.

On my mac, when i build and link static, there's nothing more to include along the program.
FlyingIsFun1217
Super wx Problem Solver
Super wx Problem Solver
Posts: 497
Joined: Mon Nov 06, 2006 9:58 pm

Post by FlyingIsFun1217 »

The fastest way to find out whether or not wxWidgets will require you to add anything else to your distribution is to run the program in a different directory. If it gives you a message box saying that you need some sort of dll, then you will need to include that file with your program.

FlyingIsFun1217
Auria
Site Admin
Site Admin
Posts: 6695
Joined: Thu Sep 28, 2006 12:23 am
Contact:

Post by Auria »

FlyingIsFun1217 wrote:The fastest way to find out whether or not wxWidgets will require you to add anything else to your distribution is to run the program in a different directory. If it gives you a message box saying that you need some sort of dll, then you will need to include that file with your program.

FlyingIsFun1217
Not if the DLLs are installed into system dirs
demize
In need of some credit
In need of some credit
Posts: 8
Joined: Sun Feb 04, 2007 1:05 am

Post by demize »

Auria wrote:
FlyingIsFun1217 wrote:The fastest way to find out whether or not wxWidgets will require you to add anything else to your distribution is to run the program in a different directory. If it gives you a message box saying that you need some sort of dll, then you will need to include that file with your program.

FlyingIsFun1217
Not if the DLLs are installed into system dirs
Right. I sent a program to my friend, and he got an error. It was complaining about the application configuration. I now know that I need to include a DLL, but what is it?
FlyingIsFun1217
Super wx Problem Solver
Super wx Problem Solver
Posts: 497
Joined: Mon Nov 06, 2006 9:58 pm

Post by FlyingIsFun1217 »

Usually if you can run it fine on your system, but just get an error on another system, the message will tell you what .dll file you need. From there, I'm pretty sure that you can just search for it on the computer you created it on, and copy and paste into your executable's directory.

Auria, wouldn't changing its directory as I said still give you the error message despite the dll being in the system directories?

FlyingIsFun1217 :)
Auria
Site Admin
Site Admin
Posts: 6695
Joined: Thu Sep 28, 2006 12:23 am
Contact:

Post by Auria »

FlyingIsFun1217 wrote: Auria, wouldn't changing its directory as I said still give you the error message despite the dll being in the system directories?
If an app called /foo/bar needs lib /usr/lib/wx-gtk.so, /foo2/bar would still find a lib at /usr/lib/wx-gtk.so.

@demize:

if you're distributing a single app, you should definitely at least take a look at static linking - it's much easier to distribute.

Otherwise, as flyingisfun said, the error message should usually tell what lib to include.
FlyingIsFun1217
Super wx Problem Solver
Super wx Problem Solver
Posts: 497
Joined: Mon Nov 06, 2006 9:58 pm

Post by FlyingIsFun1217 »

Gotcha, it has a static link to the dll, didn't know that, thought it just called a dll from the local directory.

Good thing I know that now :)

@Topic-Poster:
Static Linking is a great idea if you want to keep the files included at a minimum, but be aware, the size that it is statically linked might be larger than if you included the program and the dll. Depends on whether or not you have a large program.

FlyingIsFun1217 :)
demize
In need of some credit
In need of some credit
Posts: 8
Joined: Sun Feb 04, 2007 1:05 am

Post by demize »

How do I use static linking?
Auria
Site Admin
Site Admin
Posts: 6695
Joined: Thu Sep 28, 2006 12:23 am
Contact:

Post by Auria »

demize wrote:How do I use static linking?
when configuring, pass the disable-shared switch

../configure --disable-shared

well that's how i did it on wxMac and wxGTK - if you're on windows and you did not use configure maybe refer to the wikis.

@flyingisfun:
Actually i don't think static linking is so much bigger. Actually when i link static, only useful bits of the libs are included (with the help of 'strip') whereas when i link dynamic the whole lib is included. Though the real advantage of static linking is of course that you don't need to care for distribution
demize
In need of some credit
In need of some credit
Posts: 8
Joined: Sun Feb 04, 2007 1:05 am

Post by demize »

Auria wrote: well that's how i did it on wxMac and wxGTK - if you're on windows and you did not use configure
I am on windows, and I don't know what you mean by 'configure'.

Also, I'm using VS2005.
Auria
Site Admin
Site Admin
Posts: 6695
Joined: Thu Sep 28, 2006 12:23 am
Contact:

Post by Auria »

http://www.wxwidgets.org/wiki/index.php ... _Tutorials

From there i can help very little - i have no idea how to build static from your IDE and compiler, i only did it from the terminal and g++
FlyingIsFun1217
Super wx Problem Solver
Super wx Problem Solver
Posts: 497
Joined: Mon Nov 06, 2006 9:58 pm

Post by FlyingIsFun1217 »

demize wrote:
Auria wrote: well that's how i did it on wxMac and wxGTK - if you're on windows and you did not use configure
I am on windows, and I don't know what you mean by 'configure'.
No offense to the original poster, but that was somewhat what I was expecting, so doing things like stripping unnecessary components was something that I figured wouldn't happen (hence me saying that the dll and program would probably be smaller :) )
demize
In need of some credit
In need of some credit
Posts: 8
Joined: Sun Feb 04, 2007 1:05 am

Post by demize »

I figured it out. I just had to change the "Multithreaded Debug" to a "Multithreaded Debug DLL"
Lloyd
Super wx Problem Solver
Super wx Problem Solver
Posts: 350
Joined: Wed May 03, 2006 2:36 pm
Location: India
Contact:

Post by Lloyd »

You can compile i t as shared dlll as well. On linux what I do is, using ldd (to know the dependancy) find out the shared libraries needed by the application. Copy those libararies along with the application, and paste it in the destination machine. It will work.
Post Reply