How do I know which one (or what group) of .a files to link to?

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
poweruserm
In need of some credit
In need of some credit
Posts: 7
Joined: Thu Mar 22, 2018 1:10 pm

How do I know which one (or what group) of .a files to link to?

Post by poweruserm » Tue Jul 23, 2019 3:38 am

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?

alys666
Super wx Problem Solver
Super wx Problem Solver
Posts: 274
Joined: Tue Oct 18, 2016 2:31 pm

Re: How do I know which one (or what group) of .a files to link to?

Post by alys666 » 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

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.
Last edited by alys666 on Tue Jul 23, 2019 4:16 am, edited 1 time in total.
ubuntu 16.04, wxWidgets 3.0.4

New Pagodi
Super wx Problem Solver
Super wx Problem Solver
Posts: 309
Joined: Tue Jun 20, 2006 6:47 pm
Contact:

Re: How do I know which one (or what group) of .a files to link to?

Post by New Pagodi » Tue Jul 23, 2019 4:12 am

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.

New Pagodi
Super wx Problem Solver
Super wx Problem Solver
Posts: 309
Joined: Tue Jun 20, 2006 6:47 pm
Contact:

Re: How do I know which one (or what group) of .a files to link to?

Post by New Pagodi » 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.

alys666
Super wx Problem Solver
Super wx Problem Solver
Posts: 274
Joined: Tue Oct 18, 2016 2:31 pm

Re: How do I know which one (or what group) of .a files to link to?

Post by alys666 » Tue Jul 23, 2019 4:18 am

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.
ubuntu 16.04, wxWidgets 3.0.4

User avatar
doublemax
Moderator
Moderator
Posts: 14187
Joined: Fri Apr 21, 2006 8:03 pm
Location: $FCE2

Re: How do I know which one (or what group) of .a files to link to?

Post by doublemax » Tue Jul 23, 2019 5:07 am

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.
Use the source, Luke!

poweruserm
In need of some credit
In need of some credit
Posts: 7
Joined: Thu Mar 22, 2018 1:10 pm

Re: How do I know which one (or what group) of .a files to link to?

Post by poweruserm » Tue Jul 23, 2019 5:12 am

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.

Post Reply