Page 1 of 1

how to use DLLs

Posted: Wed Feb 14, 2007 6:29 pm
by wajih.boukaram
hi
I recently discovered wxWidgets and I'm in the middle of learning how to use it - but building a simple project takes like 20-25 seconds each time and it's starting to frustrate me. I have precompiled headers on so that helps quite a bit (it used to be like 40-45 seconds o.O) but there's till the linking part that takes a while - is there anything i can do to shorten that time?

I'm using VC++ 2005
I built the release static versions as well as the dll versions

Is there some setting in VC++ that I need to configure to make the project use the DLLs? (since i think that that might make the linking shorter?)

What I want to do is use the dlls for debugging and the static libs for releases.

thanks for your time.

Posted: Thu Feb 15, 2007 12:31 am
by Auria
first place to check is wxWiki, it has tons of tutorials of how to setup IDEs

good luck ;) (cannot help further since i don't use VC++)

Posted: Thu Feb 15, 2007 8:46 am
by upCASE
Hi!
When building the DLL version it should create a lib to for the DLL as well. All you'd have to do is to point to this lib when linking and make sure the DLL can be found.

This might bring down compilation time, but I wonder why it takes so long for you anyway. I'm using VC 2003 and for a simple project in debug config it takes about 1-2 seconds to compile and link for me. For complex projects initial compilation mostly runs under 1 minute (depending on the project) and once build, changes compile and link in about 10 secs. Are you sure that you're only compiling, not rebuilding the whole project each time?

Posted: Thu Feb 15, 2007 10:37 am
by wajih.boukaram
hey
thanks for the quick reply
i tried using the libs that were generated with the dlls but i got maybe 14 linking errors concerning wxglcanvas
i changed the setup.h to include the wxGLCanvas when building both static and dlls
also when i use the static builds i dont get any errors so im kinda at a loss here
any help would be appreciated

thanks for your time

Edit:
it seems that it's not an error with wxGLCanvas - even just loading a window gives linking errors like:

Code: Select all

test.obj : error LNK2001 : unresolved external symbol "protected: static strucy wxEventTable const wxFrame::sm_eventTable.....
and 10 more of those

Are there any special setting in VC++ that i must have in order to use dlls instead of static libs?

Posted: Thu Feb 15, 2007 12:47 pm
by wajih.boukaram
hi
sorry for all the trouble
i should have searched more thoroughly in the forum for the solution
it turns out i didn't specify -DWXUSINGDLL in the commandline options
i also didnt define __WXDEBUG__
in any case it's compiling a in less than a second now so i'm satisfied :)

thanks to all those who answered.