qtGUI.o:(.bss+0x0): multiple definition of `R'
rWidgetPlots.o:(.bss+0x0): first defined here
qtGUI.o:(.rodata+0x0): multiple definition of `qtToR'
rWidgetPlots.o:(.rodata+0x0): first defined here
main.o:(.bss+0x0): multiple definition of `R'
rWidgetPlots.o:(.bss+0x0): first defined here
main.o:(.rodata+0x0): multiple definition of `qtToR'
rWidgetPlots.o:(.rodata+0x0): first defined here
moc_qtGUI.o:(.bss+0x0): multiple definition of `R'
rWidgetPlots.o:(.bss+0x0): first defined here
moc_qtGUI.o:(.rodata+0x40): multiple definition of `qtToR'
rWidgetPlots.o:(.rodata+0x0): first defined here
rWidgetPlots.h
#ifndef RWIDGETPLOTSH
#define RWIDGETPLOTSH
#include <iostream>
#include <RInside.h>
#include <Rcpp.h>
#include <vector>
#include <limits>
#include <QRect>
#include <fstream>
#include "zoomAndCornerDatabaseParser.h"
RInside R (0, NULL);
RInside & qtToR (R);
typedef struct
{
double latitude;
double longitude;
unsigned int vehicleId;
} vehicle;
extern std :: vector <vehicle> vehicleInfo;
typedef struct
{
float latitude;
float longitude;
} coordinate;
extern std :: vector <coordinate> previousPoints;
class rdaTilesOnR
{
public:
static std :: string returnCenterPoint (std :: string fileName);
static std :: string findPanningDirection (float newLatitude, float newLongitude,
std :: string topLeftLat, std :: string topLeftLng,
std :: string northEastLat, std :: string northEastLng,
std :: string bottomRightLat, std :: string bottomRightLng,
std :: string southWestLat, std :: string southWestLng);
static void storeVehicleInfo (float latitude, float longitude, unsigned int vehicleId);
static void loadNewTileAndPlotPointsOnRWidget (unsigned short option, float newLongitude, float newLatitude);
static std :: string doesPointLieInBoundaries (unsigned short option, float newLatitude, float newLongitude, float currentCenterLatitude, float currentCenterLongitude);
};
#endif
qtGUI.h
#ifndef QTGUIH
#define QTGUIH
#include <QApplication>
#include <QMainWindow>
#include <QtCore>
#include <QtGui>
#include <QPushButton>
#include <unistd.h>
#include <iostream>
#include <string.h>
#include "rWidgetPlots.h"
class controlRThroughQt : public QWidget
{
Q_OBJECT
QTextEdit *textEdit;
public:
void qtInterface ();
public slots:
void slotPanLeft ();
void slotPanRight ();
void slotPanTop ();
void slotPanBottom ();
void slotZoomIn ();
void slotZoomOut ();
void slotRefresh ();
void findInfoByClicking ();
};
#endif
qtToR
こちらが参考になります。その場で定義する必要があります。このエラーを解決するにはどうすればよいですか? 使用extern
しても役に立ちません。