how to use DLLs Topic is solved

Do you have a question about makefiles, a compiler or IDE you are using and need to know how to set it up for wxWidgets or why it doesn't compile but other IDE's do ? Post your questions here.
Post Reply
wajih.boukaram
Earned a small fee
Earned a small fee
Posts: 10
Joined: Wed Feb 14, 2007 6:14 pm

how to use DLLs

Post by wajih.boukaram » Wed Feb 14, 2007 6:29 pm

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.

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

Post by Auria » Thu Feb 15, 2007 12:31 am

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++)

upCASE
Site Admin
Site Admin
Posts: 3176
Joined: Mon Aug 30, 2004 6:55 am
Location: Germany, Cologne

Post by upCASE » Thu Feb 15, 2007 8:46 am

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?
OS: OpenSuSE, Ubuntu, Win XP Pro
wx: svn
Compiler: gcc 4.5.1, VC 2008, eVC 4

"If it was hard to write it should be hard to read..." - the unknown coder
"Try not! Do. Or do not. There is no try." - Yoda

wajih.boukaram
Earned a small fee
Earned a small fee
Posts: 10
Joined: Wed Feb 14, 2007 6:14 pm

Post by wajih.boukaram » Thu Feb 15, 2007 10:37 am

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?

wajih.boukaram
Earned a small fee
Earned a small fee
Posts: 10
Joined: Wed Feb 14, 2007 6:14 pm

Post by wajih.boukaram » Thu Feb 15, 2007 12:47 pm

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.

Post Reply