undefined reference to `wxGrid::SetColSize(int, int)'

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
spflanze
Earned some good credits
Earned some good credits
Posts: 118
Joined: Tue Feb 15, 2011 10:02 pm

undefined reference to `wxGrid::SetColSize(int, int)'

Post by spflanze » Thu Apr 25, 2019 3:15 am

I have this linker error:

Code: Select all

obj\Release\TIA Designer\src\opamp.o:opamp.cpp|| undefined reference to `wxGridCellChoiceEditor::wxGridCellChoiceEditor(wxArrayString const&, bool)'||
and many other errors like it.

In Code::Blocks 17.12, in "Settings => Global variables", I have these settings:

Under "Current variable" there is one entry which is "wx". For this in the "Built-in fields" group I have:
base: C:\wxWidgets-3.0.4
include: \include
lib: \lib\gcc_lib
bin: \bin
Left blank are: obj, cflags, lflags

PB
Part Of The Furniture
Part Of The Furniture
Posts: 1937
Joined: Sun Jan 03, 2010 5:45 pm

Re: undefined reference to `wxGrid::SetColSize(int, int)'

Post by PB » Thu Apr 25, 2019 5:12 am

Do you link with wxAdvanced library, i.e., did you add libwxmsw30u_adv.a (or libwxmsw30ud_adv.a for the Debug build target) in your Project build options / Linker settings / Link libraries?

spflanze
Earned some good credits
Earned some good credits
Posts: 118
Joined: Tue Feb 15, 2011 10:02 pm

Re: undefined reference to `wxGrid::SetColSize(int, int)'

Post by spflanze » Sat Apr 27, 2019 12:50 am

I started a new project and copied all files from the new project's directory, with the exception of the .cbp file. In this new project I added all the files that had be copied into the directory, and added the search directories for the headers.

During project creation the wizard presented me with a list of "Additional libraries", many of which a recognized I needed, or would like to have available. On my first attempt at project creation I added them all, and got 3 compilation linker errors for libraries it could not find. On my next attempt at project creation I found that to get it to compile I had to exclude from this list these libraries:

wxDbGrid
wxOdbc
wxQa

I am using Code::Blocks 17.12 with wxWidgets 3.0.4

PB
Part Of The Furniture
Part Of The Furniture
Posts: 1937
Joined: Sun Jan 03, 2010 5:45 pm

Re: undefined reference to `wxGrid::SetColSize(int, int)'

Post by PB » Sat Apr 27, 2019 6:06 am

As the thread is is not marked solved.... Does it work for you or not now, and did you have the advanced library linked?

As for the three missing libraries you listed: the first two are for wxWidgets 2.8 only and the third one is built only when using MSVC.

spflanze
Earned some good credits
Earned some good credits
Posts: 118
Joined: Tue Feb 15, 2011 10:02 pm

Re: undefined reference to `wxGrid::SetColSize(int, int)'

Post by spflanze » Wed May 01, 2019 5:53 am

It is solved.

Post Reply