← Back to team overview

kicad-developers team mailing list archive

Solved problem for "undefined reference to 'vtable for ....'"


I tried to compile kicad on Debian linux with gcc 3.3.4.

While linking, several "undefined reference to 'vtable for ...'"
appeared (first in pinedit.o, and then other files); then using nm I
discovered that the base class for the pin edit dialog was an external
unresolved reference: strange because the file pinedit.cpp itself
should define it.

The problem, according to what stated in the gcc manual, is that those
.cpp files are missing the "#pragma implementation" keyword. The
compiler does not put the vtable and other things in the object files
if it does not see the implementation pragma. After adding, just at
the top of the file, '#pragma implementation "xxxxx.h"' everything
goes well.

Now, may be that that has to be considered a gcc bug. Anyway, kicad
has some problem thought, because these "#pragma implementation ..."
are really missing in pinedit.cpp, but they are present in other
similar files.


Just one more thing: it happened to me to have a module field (text)
laying entirely inside a thick track. There is no way to move or edit
the text, because the pop-up menu only shows options for tracks. I did
not want to delete the track to move the text, so I modified the
source in order to ignore invisible tracks:
doripc:~/kicad-dev/pcbnew# diff -b locate.cpp locate.cpp-
< if (g_DesignSettings.m_LayerColor[Track->m_Layer] &
ITEM_NOT_SHOW) continue;

This way I succeded in moving text laying into a track by hiding that
layer (copper, in this case) and then doing my editing. This could be
extended to all the other object types (this is easy), but the more
correct way would be to show menu options for every item under the
cursor; however it seems strange to me that kicad lets you operate on
invisible items... so both the corrections should be applied: show
voices for every item except invisible ones. I am not a C++
programmer, so once solved my problem I leaved all the rest as it was.

Salutation to all, and long life to kicad.