0

I've been working on the following code for several weeks. But I've come across this error and despite the huge amount of identical problems I've googled, I still can't solve it. I would appreciate a lot if someone could help :)

On the TVideoIOYuv.cpp, inside writePlane() function I call goToCorrectError() function:

Bool writePlane(ostream& fd, Pel* src, Bool is16bit,
                   UInt stride,
                   UInt width, UInt height, bool temErro, bool chroma, TComPic*& pPic,
                   TComList<TComPic*>::iterator itPic, TComList<TComPic*>* pcListPic) 
{ 
   (...)
   goToCorrectError(itPic, pcListPic);
   (..)
}

In TVideoIOYuv.h I have declared goToCorrectError as

extern void goToCorrectError(TComList<TComPic*>::iterator itPic, TComList<TComPic*>* pcListPic);

since the function is defined in TAppDecTop.cpp as:

void goToCorrectError(TComList<TComPic*>::iterator itPic, TComList<TComPic*>* pcListPic)
{
TAppDecTop aux;
TComPic* dPic = getDamagedPic();
aux.CorrectsError(itPic, dPic, pcListPic);
}

and declared in TAppDecTop.h as:

(...)
#include "TLibVideoIO/TVideoIOYuv.h"
(...)
void goToCorrectError(TComList<TComPic*>::iterator itPic, TComList<TComPic*>* pcListPic);

When I try to compile I get the "error LNK2001: unresolved external symbol "void __cdecl goToCorrectError(class std::_List_iterator > >,class TComList *)" (?goToCorrectError@@YAXV?$_List_iterator@V?$_List_val@U?$_List_simple_types@PEAVTComPic@@@std@@@std@@@std@@PEAV?$TComList@PEAVTComPic@@@@@Z)" error.

The funny part is that when I click "Go to Definition" over goToCorrectError on TVideoIOYuv.cpp it goes to its definition on TAppDecTop.cpp so it knows where it's defined. Thank you all :)

PedRocha
  • 1
  • 1
  • 1
    The compiler, the linker, and the IDE are different programs. It's very possible for the IDE to find a definition (because it's in your project) while the linker can't (because it didn't get compiled or isn't in the list of things to link). – molbdnilo Jun 12 '14 at 11:47
  • Is TAppDecTop.cpp included as a source in your project? – drescherjm Jun 12 '14 at 13:02
  • @ drescherjm Yes it is. @molbdnilo Well, the purpose of the question is to find an answer to that. How to make the linker find a definition of the function.. If you have any suggestion :) – PedRocha Jun 12 '14 at 13:24
  • Verify that the .obj file was created and it has the correct date / time. – drescherjm Jun 12 '14 at 13:31

0 Answers0