Guidance
指路人
g.yi.org
Guidance Forums / wxWidgets (wxWindows) in C++ / How do you know when you need to link a lib?

Register 
注册
Search 搜索
首页 
Home Home
Software
Upload

  
Forum List • Thread List • Reply • Refresh • New Topic • Search • Previous • Next First 1 Last
Message1. How do you know when you need to link a lib?
#3305
Posted by: 2004-02-03 23:13:47
I have a couple of questions:

 1) When you add a directory to the Dev-C++ for including and/or linking, does it automatically search sub-directories?

 2) I've installed Dev-C++ and wxWindows to separate paths, but I'm not sure how to get Dev-C++ to see the include directories under the wxWindows directories.

 3) How the heck do you know you need to link in a wxWindows Library?  How can I get Dev-C++ to automatically find any lib in the wxWindows directory structure so I don't have to know which lib to link manually?

Thanks for your assistance with any of these questions.

Patrick
Message2. Re: How do you know when you need to link a lib?
#3307
Posted by: KaReL 2004-02-04 04:52:45
1/ If it has the same behaviour as Visual Studio: no
2/ Again if it is the same as VS... Add them somewhere in your configuration (I am sure upCASE can answer that more easily ;))
3/ From experience. Not. Most of the time you will need to link base & core... Myself I linked regex in it too because I needed it ...

------------------------
Website: www.KaReLs0ft.be
Message3. Re: How do you know when you need to link a lib?
#3311
Posted by: upCASE 2004-02-05 02:24:19
Hi!
1. No, but you can use #include <dir/header> so you won't need to include every dir, just the top level of the hierarchy.
2. Go to "Tools" -> "Compiler Options" -> "Directories" -> "C++ includes" and add $WXDIRinclude and maybe $WXDIRcontribinclude there. Under "libraries" add $WXDIRlib.
3. Since I'm using a monolithical build I link the libwxmsw.a and the image lib (sometimes regex and xrc). That shouldn't be a problem. Sometimes it's hard to find out "what else" you need (windows specific libs lic odbc e.g.).
Here's my setup for the libs:
-lwxmsw
-lole32
-lwsock32
-lcomctl32
-lctl3d32
-lgcc
-lstdc++
-lshell32
-loleaut32
-ladvapi32
-luuid
-lodbc32
-ltiff
-lpng
-ljpeg
-lzlib

upCASE
-----------------------------------
If it was hard to write, it should be hard to read!- Do. Or do not. There is no try!
Message4. Re: How do you know when you need to link a lib? Thanks
#3314
Posted by: 2004-02-05 10:50:26
Ok.  That clarifies some things.

I put the -llibtolink commands in the Tools:Compiler Options:Compiler: "Add these commands to the linker command line section", and separated them with new lines.

On my system, the var is $WXWIN (vs. $WXDIR), and I'm guessing I can use the variable vs. the string in the Directories.

I have a lot to learn.

Thanks again,

Patrick
Forum List • Thread List • Reply • Refresh • New Topic • Search • Previous • Next First 1 Last
掌柜推荐
 
 
 
 
 
 
 
 
 
 
 
 
© Thu 2022-8-18  Guidance Laboratory Inc.
Email:webmaster1g.yi.org Hits:0