hi all. im trying to create a C++ library but i faced with this error " error: 'number1' is not a type"...
here is my code, what should i do ??
many thanks
# arthemticopration.pro
__________________________________________________Quote:
#-------------------------------------------------
#
# Project created by QtCreator 2012-08-22T12:05:19
#
#-------------------------------------------------
QT -= gui
TARGET = ArthemticOpration
TEMPLATE = lib
DEFINES += ARTHEMTICOPRATION_LIBRARY
SOURCES += arthemticopration.cpp
HEADERS += arthemticopration.h\
ArthemticOpration_global.h
symbian {
MMP_RULES += EXPORTUNFROZEN
TARGET.UID3 = 0xE0E61B47
TARGET.CAPABILITY =
TARGET.EPOCALLOWDLLDATA = 1
addFiles.sources = ArthemticOpration.dll
addFiles.path = !:/sys/bin
DEPLOYMENT += addFiles
}
unix:!symbian {
maemo5 {
target.path = /opt/usr/lib
} else {
target.path = /usr/lib
}
INSTALLS += target
}
// arthemticopration.cpp
__________________________________________________ _Quote:
#include "arthemticopration.h"
ArthemticOpration::ArthemticOpration()
{
}
int ArthemticOpration::add(number1, number2)
{
return number1+number2;
}
// arthemticopration.h
__________________________________________________ ________________________Quote:
#ifndef ARTHEMTICOPRATION_H
#define ARTHEMTICOPRATION_H
#include "ArthemticOpration_global.h"
//ARTHEMTICOPRATIONSHARED_EXPORT void foo();
class ARTHEMTICOPRATIONSHARED_EXPORT ArthemticOpration {
public:
ArthemticOpration();
private:
ARTHEMTICOPRATIONSHARED_EXPORT int number1;
ARTHEMTICOPRATIONSHARED_EXPORT int number2;
ARTHEMTICOPRATIONSHARED_EXPORT int add(ARTHEMTICOPRATIONSHARED_EXPORT number1,ARTHEMTICOPRATIONSHARED_EXPORT number2);
};
#endif // ARTHEMTICOPRATION_H
// ArthemticOpration_global.h
Quote:
#ifndef ARTHEMTICOPRATION_GLOBAL_H
#define ARTHEMTICOPRATION_GLOBAL_H
#include <QtCore/qglobal.h>
#if defined(ARTHEMTICOPRATION_LIBRARY)
# define ARTHEMTICOPRATIONSHARED_EXPORT Q_DECL_EXPORT
#else
# define ARTHEMTICOPRATIONSHARED_EXPORT Q_DECL_IMPORT
#endif
#endif // ARTHEMTICOPRATION_GLOBAL_H