문제

I am fightingwith QT now. I add a method to my APIinmoov.h, and I fill it in API.cpp. That works, but when I call it in another class that include it

#include "APIinmoov.h"

It told me:

 tiempomanual.obj:-1: error: LNK2019: unresolved external symbol "public: void     __thiscall Inmoov::saveTray(class QString,class QString,class QString)" (?    saveTray@Inmoov@@QAEXVQString@@00@Z) referenced in function "public: void __thiscall     TiempoManual::total(void)" (?total@TiempoManual@@QAEXXZ)

After the function, all works very well but when I create it, the LNK2019 appears

The method in apiInmoov.h

  void saveTray(QString, QString, QString);

The method in apiInmoov.cpp

   void saveTray(QString destFile, QString orderFile, QString tiempo)
  {
QFile desFil(destFile);
desFil.open(QIODevice::WriteOnly | QIODevice::Append);
QTextStream dets(&desFil);

QFile orFil(orderFile);
orFil.open(QIODevice::ReadOnly);
QTextStream orts(&orFil);


QString todo=orts.readAll();
dets<<todo;
dets<<";"<<tiempo;

}

And the call in the main function:

inmT->saveTray(fich, fichO,tiempoQ);

And after that, I call this other function and dont give me an error:

inmT->saveAction(fich,tiempoQ,pPosT,pArticT);

I tried run QMake, rebuild the project,delete the folder with the compiled project and create it again and nothing.

Anyone knows another solution or the problem? Thanks for your time.

도움이 되었습니까?

해결책

Okay,I found the problem. In the apiimoov.cpp, when I put the header of the method, I forgot the Inmoov:: ,So the method will be

void Inmoov:: saveTray(...)

Instead of

void saveTray(..)

Sorry for the question

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top