Can't build

Hi,

Wanting to address Michael’s feature request on QFileDialog filters I tried to
svn up and build avogadro, but without any success!

This is with revision 1272 of avogadro, and Qt 4.3.4 (kubuntu 8.04 packages).

Cheers,

Benoit

directorytreemodel.cpp:(.text+0x18b): undefined reference to
Avogadro::TreeItem::childCount() const' CMakeFiles/drawtool.dir/directorytreemodel.o: In functionAvogadro::DirectoryTreeModel::setupModelData(QStringList const&,
Avogadro::TreeItem*)’:
directorytreemodel.cpp:(.text+0x233): undefined reference to
Avogadro::TreeItem::deleteChildren()' directorytreemodel.cpp:(.text+0x482): undefined reference toAvogadro::TreeItem::TreeItem(QList const&, Avogadro::TreeItem*,
QString)‘
directorytreemodel.cpp:(.text+0x497): undefined reference to
Avogadro::TreeItem::appendChild(Avogadro::TreeItem*)' directorytreemodel.cpp:(.text+0x523): undefined reference toAvogadro::TreeItem::childCount() const’
directorytreemodel.cpp:(.text+0x54b): undefined reference to
Avogadro::TreeItem::child(int)' directorytreemodel.cpp:(.text+0xb22): undefined reference toAvogadro::TreeItem::TreeItem(QList const&, Avogadro::TreeItem*,
QString)‘
directorytreemodel.cpp:(.text+0xb41): undefined reference to
Avogadro::TreeItem::appendChild(Avogadro::TreeItem*)' directorytreemodel.cpp:(.text+0xbcd): undefined reference toAvogadro::TreeItem::childCount() const’
directorytreemodel.cpp:(.text+0xbf5): undefined reference to
Avogadro::TreeItem::child(int)' directorytreemodel.cpp:(.text+0xcf6): undefined reference toAvogadro::TreeItem::TreeItem(QList const&, Avogadro::TreeItem*,
QString)‘
directorytreemodel.cpp:(.text+0xd15): undefined reference to
Avogadro::TreeItem::appendChild(Avogadro::TreeItem*)' CMakeFiles/drawtool.dir/directorytreemodel.o: In functionAvogadro::DirectoryTreeModel::parent(QModelIndex const&) const’:
directorytreemodel.cpp:(.text+0x1273): undefined reference to
Avogadro::TreeItem::parent()' directorytreemodel.cpp:(.text+0x129c): undefined reference toAvogadro::TreeItem::row() const’
CMakeFiles/drawtool.dir/directorytreemodel.o: In function
Avogadro::DirectoryTreeModel::index(int, int, QModelIndex const&) const': directorytreemodel.cpp:(.text+0x1355): undefined reference toAvogadro::TreeItem::child(int)‘
CMakeFiles/drawtool.dir/directorytreemodel.o: In function
Avogadro::DirectoryTreeModel::headerData(int, Qt::Orientation, int) const': directorytreemodel.cpp:(.text+0x13dc): undefined reference toAvogadro::TreeItem::data(int) const’
CMakeFiles/drawtool.dir/directorytreemodel.o: In function
Avogadro::DirectoryTreeModel::data(QModelIndex const&, int) const': directorytreemodel.cpp:(.text+0x146e): undefined reference toAvogadro::TreeItem::data(int) const’
CMakeFiles/drawtool.dir/directorytreemodel.o: In function
Avogadro::DirectoryTreeModel::filePath(QModelIndex const&) const': directorytreemodel.cpp:(.text+0x14d1): undefined reference toAvogadro::TreeItem::filePath() const’
CMakeFiles/drawtool.dir/directorytreemodel.o: In function
Avogadro::DirectoryTreeModel::columnCount(QModelIndex const&) const': directorytreemodel.cpp:(.text+0x1516): undefined reference toAvogadro::TreeItem::columnCount() const’
directorytreemodel.cpp:(.text+0x1529): undefined reference to
Avogadro::TreeItem::columnCount() const' CMakeFiles/drawtool.dir/directorytreemodel.o: In functionAvogadro::DirectoryTreeModel::~DirectoryTreeModel()’:
directorytreemodel.cpp:(.text+0x156f): undefined reference to
Avogadro::TreeItem::~TreeItem()' CMakeFiles/drawtool.dir/directorytreemodel.o: In functionAvogadro::DirectoryTreeModel::~DirectoryTreeModel()’:
directorytreemodel.cpp:(.text+0x164f): undefined reference to
Avogadro::TreeItem::~TreeItem()' CMakeFiles/drawtool.dir/directorytreemodel.o: In functionAvogadro::DirectoryTreeModel::~DirectoryTreeModel()’:
directorytreemodel.cpp:(.text+0x172f): undefined reference to
Avogadro::TreeItem::~TreeItem()' CMakeFiles/drawtool.dir/directorytreemodel.o: In functionAvogadro::DirectoryTreeModel::DirectoryTreeModel(QStringList const&,
QObject*)’:
directorytreemodel.cpp:(.text+0x18d4): undefined reference to
Avogadro::TreeItem::TreeItem(QList<QVariant> const&, Avogadro::TreeItem*, QString)' CMakeFiles/drawtool.dir/directorytreemodel.o: In functionAvogadro::DirectoryTreeModel::DirectoryTreeModel(QStringList const&,
QObject*)’:
directorytreemodel.cpp:(.text+0x1ac4): undefined reference to
Avogadro::TreeItem::TreeItem(QList<QVariant> const&, Avogadro::TreeItem*, QString)' CMakeFiles/drawtool.dir/directorytreemodel.o: In functionAvogadro::DirectoryTreeModel::DirectoryTreeModel(QString const&, QObject*)’:
directorytreemodel.cpp:(.text+0x1ce1): undefined reference to
Avogadro::TreeItem::TreeItem(QList<QVariant> const&, Avogadro::TreeItem*, QString)' CMakeFiles/drawtool.dir/directorytreemodel.o: In functionAvogadro::DirectoryTreeModel::DirectoryTreeModel(QString const&, QObject*)’:
directorytreemodel.cpp:(.text+0x1efd): undefined reference to
`Avogadro::TreeItem::TreeItem(QList const&, Avogadro::TreeItem*,
QString)'
collect2: ld returned 1 exit status

On Friday 18 April 2008 20:13:33 Geoffrey Hutchison wrote:

Wanting to address Michael’s feature request on QFileDialog filters
I tried to
svn up and build avogadro, but without any success!

One problem with the current CMakeList.txt for libavogadro/src/ is
that it reflects all *.cpp and *.h files. This means that when you add
new files, you need to touch libavogadro/src/CMakeList.txt before it
recognizes the new file.

Hm I’m not sure I understand: in libavogadro/src/CMakeList.txt I can see

FILE(GLOB libavogadro_SRCS “.cpp")
FILE(GLOB libavogadro_HDRS "
.h”)

But anyway I was talking about an unmodified r1272.

Cheers,

Benoit

On Apr 18, 2008, at 2:26 PM, Benoît Jacob wrote:

Hm I’m not sure I understand: in libavogadro/src/CMakeList.txt I can
see

FILE(GLOB libavogadro_SRCS “.cpp")
FILE(GLOB libavogadro_HDRS "
.h”)

Right. So this means that when Cmake creates your Makefiles, it has
whatever *.cpp files it finds at THAT time.

Now I go create a new class, and CMake doesn’t know to update the
build system. Try this. “touch libavogadro/src/CMakeLists.txt; make”

Now that the CMakeLists.txt is updated, it’ll rebuild the Makefiles
and everything should work.

Cheers,
-Geoff

Hey, hey! you don’t believe that I would have written to this list without
having already tried emptying my builddir and retrying, right ?

Emptying my builddir erases CMake’s cache and forces it to re-evaluate the
GLOB.

But I still did what you said (one never knows…) and got the same result.

Cheers,

Benoit

On Friday 18 April 2008 20:30:11 Geoffrey Hutchison wrote:

On Apr 18, 2008, at 2:26 PM, Benoît Jacob wrote:

Hm I’m not sure I understand: in libavogadro/src/CMakeList.txt I can
see

FILE(GLOB libavogadro_SRCS “.cpp")
FILE(GLOB libavogadro_HDRS "
.h”)

Right. So this means that when Cmake creates your Makefiles, it has
whatever *.cpp files it finds at THAT time.

Now I go create a new class, and CMake doesn’t know to update the
build system. Try this. “touch libavogadro/src/CMakeLists.txt; make”

Now that the CMakeLists.txt is updated, it’ll rebuild the Makefiles
and everything should work.

Cheers,
-Geoff

Hi,

I had the same problem and solved it by addding

#include “…/treeitem.cpp”

to libavogadro/src/tools/directorytreemodel.cpp

Not that this is the best fix, but it might help…

Tim

On Fri, Apr 18, 2008 at 8:36 PM, Benoît Jacob jacob@math.jussieu.fr wrote:

Hey, hey! you don’t believe that I would have written to this list without
having already tried emptying my builddir and retrying, right ?

Emptying my builddir erases CMake’s cache and forces it to re-evaluate the
GLOB.

But I still did what you said (one never knows…) and got the same result.

Cheers,

Benoit

On Friday 18 April 2008 20:30:11 Geoffrey Hutchison wrote:

On Apr 18, 2008, at 2:26 PM, Benoît Jacob wrote:

Hm I’m not sure I understand: in libavogadro/src/CMakeList.txt I can
see

FILE(GLOB libavogadro_SRCS “.cpp")
FILE(GLOB libavogadro_HDRS "
.h”)

Right. So this means that when Cmake creates your Makefiles, it has
whatever *.cpp files it finds at THAT time.

Now I go create a new class, and CMake doesn’t know to update the
build system. Try this. “touch libavogadro/src/CMakeLists.txt; make”

Now that the CMakeLists.txt is updated, it’ll rebuild the Makefiles
and everything should work.

Cheers,
-Geoff


This SF.net email is sponsored by the 2008 JavaOne(SM) Conference
Don’t miss this year’s exciting event. There’s still time to save $100.
Use priority code J8TL2D2.
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone


Avogadro-devel mailing list
Avogadro-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/avogadro-devel

Yeah OK but this is quite bad as the filetreeitem.cpp code is present in
libavogadro.so… the question is why the linker fails to see it when
attempting to link directorytreemodel.o when linking drawtool.

It turns out that disabling “visibility” solves the problem. So this is
another one of these nice little problems that Marcus had to fix when adding
visibility support…

Cheers,

Benoit

On Saturday 19 April 2008 02:47:53 Tim Vandermeersch wrote:

Hi,

I had the same problem and solved it by addding

#include “…/treeitem.cpp”

to libavogadro/src/tools/directorytreemodel.cpp

Not that this is the best fix, but it might help…

Tim

On Fri, Apr 18, 2008 at 8:36 PM, Benoît Jacob jacob@math.jussieu.fr wrote:

Hey, hey! you don’t believe that I would have written to this list
without having already tried emptying my builddir and retrying, right ?

Emptying my builddir erases CMake’s cache and forces it to re-evaluate
the GLOB.

But I still did what you said (one never knows…) and got the same
result.

Cheers,

Benoit

On Friday 18 April 2008 20:30:11 Geoffrey Hutchison wrote:

On Apr 18, 2008, at 2:26 PM, Benoît Jacob wrote:

Hm I’m not sure I understand: in libavogadro/src/CMakeList.txt I can
see

FILE(GLOB libavogadro_SRCS “.cpp")
FILE(GLOB libavogadro_HDRS "
.h”)

Right. So this means that when Cmake creates your Makefiles, it has
whatever *.cpp files it finds at THAT time.

Now I go create a new class, and CMake doesn’t know to update the
build system. Try this. “touch libavogadro/src/CMakeLists.txt; make”

Now that the CMakeLists.txt is updated, it’ll rebuild the Makefiles
and everything should work.

Cheers,
-Geoff


This SF.net email is sponsored by the 2008 JavaOne(SM) Conference
Don’t miss this year’s exciting event. There’s still time to save $100.
Use priority code J8TL2D2.

http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/ja
vaone _______________________________________________
Avogadro-devel mailing list
Avogadro-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/avogadro-devel

On Apr 19, 2008, at 5:19 AM, Benoît Jacob wrote:

It turns out that disabling “visibility” solves the problem. So this
is
another one of these nice little problems that Marcus had to fix
when adding
visibility support…

OK, so that makes sense – I wrote it on Mac, and visibility isn’t yet
enabled on Mac. So I’ll see what needs to happen to get that working.

Thanks,
-Geoff

On Saturday 19 April 2008 08:46:58 Geoffrey Hutchison wrote:

On Apr 19, 2008, at 5:19 AM, Benoît Jacob wrote:

It turns out that disabling “visibility” solves the problem. So this
is
another one of these nice little problems that Marcus had to fix
when adding
visibility support…

OK, so that makes sense – I wrote it on Mac, and visibility isn’t yet
enabled on Mac. So I’ll see what needs to happen to get that working.

If you want it to be be exported then you need an A_EXPORT before the class
name, if you don’t then leave it as is. I will try to write more of this up
but it will help to make the Winows builds smoother too - they would have
failed for a very similar reason - the DLL wouldn’t have exported the symbols
you wanted.