Page 1 of 1
How do I know which one (or what group) of .a files to link to?
Posted: Tue Jul 23, 2019 3:38 am
by poweruserm
I am using Windows 10 64 bit home edition.
I am using the TDM C++ Compiler 5.1.2 for Windows.
I am using Code::Blocks 17.12.
By means of the online web documentation, or the download copy of that,
or otherwise, if I wish to link to a particular class, when doing my wxWidgets
programming, how do I know which one, or what group, of .a files I am
supposed to link to?
-Say, for example, I wish to instantiate wxFrame. I see that I need
to #include "wx/frame.h". I have found the correct copy of that file.
But I don't know which .a file(s) to link. In this example, can someone
tells me which .a files I need to link to?
-There are 44 .a files. Is the idea that I link to all of them,
or in fact not? Where in the documentation is it going to tell
me which .a file to link to? What do I do for loading other classes
by linking and instantiation when it comes to picking a particular
.a file to link to?
Re: How do I know which one (or what group) of .a files to link to?
Posted: Tue Jul 23, 2019 4:05 am
by alys666
there is a programm - wx-config
it intended to provide you with specific information(names, paths, options...) for wxWidgets application building process.
did you read about it?
https://wiki.wxwidgets.org/Wx-Config
ps.
aah. sorry. it's for linux systems... but you're using the pure Windows wxWidgets port.
at least in linux there are just few libs you need to link against your app to build wxWidgets app. and a call "wx-config --libs all" will return actual their paths.
Cannot help you with Windows port of wxWIdgets.
Re: How do I know which one (or what group) of .a files to link to?
Posted: Tue Jul 23, 2019 4:12 am
by New Pagodi
Generally, you'll always need to link with the base library. It should be named something like 'libwxbase31XX.a' where 'XX' might be some optional letters like that give more information about the build.
For additional items, you can look up which library is needed in the documentation. For example, on the
Frame page, near the end of the brief description but before the list of methods, you'll see "Library: wxCore". That means you'll need to link with the core library when using members of the frame class. It should be named something like 'libwxmsw31XX_core.a'.
If you use the codeblocks wxWidgets wizard, it should set up the set up the base and core libraries for you. The wizard will give you the option of creating an empty project so that it won't create any files, but it will still set up all the include and linking information needed. Just one work of warning, it's important to match the settings used in the codeblocks wizard with the settings you used when building your version of the wxWidgets libraries. There are several posts in the Compiler / Linking / IDE Related subforum about how to do that.
Re: How do I know which one (or what group) of .a files to link to?
Posted: Tue Jul 23, 2019 4:13 am
by New Pagodi
alys666 wrote: ↑Tue Jul 23, 2019 4:05 am
there is a programm - wx-config
it intended to provide you with specific information(names, paths, options...) for wxWidgets application building process.
did you read about it?
https://wiki.wxwidgets.org/Wx-Config
wx-config currently doesn't work with the mingw family of compilers.
Re: How do I know which one (or what group) of .a files to link to?
Posted: Tue Jul 23, 2019 4:18 am
by alys666
New Pagodi wrote: ↑Tue Jul 23, 2019 4:13 am
alys666 wrote: ↑Tue Jul 23, 2019 4:05 am
there is a programm - wx-config
it intended to provide you with specific information(names, paths, options...) for wxWidgets application building process.
did you read about it?
https://wiki.wxwidgets.org/Wx-Config
wx-config currently doesn't work with the mingw family of compilers.
yes.. i already corrected my answer...
but a question - it could not work for compiler(in invocation string), but does it exist in wxWIdgets installation for Windows, if yes - it could be called in terminal and at least user can see its output and manually include it in his compiler invocation string?
I m completely fool in Windows, because am living in Linux for decade or more.
Re: How do I know which one (or what group) of .a files to link to?
Posted: Tue Jul 23, 2019 5:07 am
by doublemax
The documentation for each class says in which library it is, e.g. for wxFrame it says:
Library: wxCore
By that you can usually deduce which library file you need.
Re: How do I know which one (or what group) of .a files to link to?
Posted: Tue Jul 23, 2019 5:12 am
by poweruserm
Thank you very much.
As a Windows person, wx-config is no option for me.
I hand't noticed that classed have a Library: entry.
I was expecting something like that entry to be at the very
top of the class documentation,which is why I havn't seen it.
Thank you guys very much for the clarification.