Hi,
I have the following codes:
#include <QVector>
template <typename Type>
class MyVector : public QVector<Type>
{
,,,
};
template class IMPORT_EXPORT MyVector<float>;
typedef MyVector<float> MyFloatVector;
#include <QVector>
template <typename Type>
class MyVector : public QVector<Type>
{
,,,
};
template class IMPORT_EXPORT MyVector<float>;
typedef MyVector<float> MyFloatVector;
To copy to clipboard, switch view to plain text mode
The above code is built into a dll library, with IMPORT_EXPORT properly defined.
Then I have another dll using QVector<float> directly, such as
#include <QVector>
class AnotherClass
{
public:
QVector<float> foo() const {
return QVector<float>();
}
}
#include <QVector>
class AnotherClass
{
public:
QVector<float> foo() const {
return QVector<float>();
}
}
To copy to clipboard, switch view to plain text mode
When linking them together, I got QVector<float>::QVector<float> already defined error. This only happens on Windows. Linux is fine.
Can someone tell me what is the problem?
Many thanks.
Bookmarks