Linker Error LNK2001 for win32 but succeeds for x64

Linker Error LNK2001 for win32 but succeeds for x64

Ritratto di NI V.

This is a strange linker error that I have been facing with Intel C++ compiler 2013. 

I have a class implemented as follows:

file1.h

class dummy {

void* foo(int x, int y);

}

inline void * dummy::foo(int x, int y) {

.........

}

In file 2, I have a function as follows:

file2.cpp

GRLIBError foo(ENUM2  *p, int x, int y, Ptr * _ptr) // GRLIBError is an ENUM

{
_ptr->ptr = reinterpret_cast< *dummy>(p)->foo(x, y);
return ERR_SUCCESS;
}


When I compile the project for x64, the project compiles fine. However when I try to compile for win32 I get the following error:

abc.exp : error LNK2001: unresolved external symbol "public: void * __thiscall dummy::foo(int,int)" (?foo@dummy@@QAEPAXHH@Z)


Note the same project compiles fine with MSVC 2008 compiler but fails with Intel Compiler 2013.


One of the other interesting things is that if I try to go to the declaration of foo function defined in file2, I get the following resolve ambiguity dialog box

--------------

Resolve Ambiguity

Symbols:

foo(GRLIBError foo(ENUM2  *p, int x, inty, Ptr * _ptr) - file2.cpp

dummy::foo(int x, int y) - file1.h

6 post / 0 new
Ultimo contenuto
Per informazioni complete sulle ottimizzazioni del compilatore, consultare l'Avviso sull'ottimizzazione
Ritratto di Sergey Kostrov

>>...
>>inline void * dummy::foo(int x, int y){ ... };
>>...
.
Could you explain what does it return? It would be nice to see a 'return ...' statement for the method 'foo'.

Ritratto di Jennifer J. (Intel)

Could you attach the test project?

Did you build the same "debug" or "release" for each architecture (ia32 | x64)?

Ritratto di Sergey Kostrov

>>...Could you attach the test project?
.
I would be glad to see it as well. Thanks in advance!

Ritratto di Sergey Kostrov

>>...GRLIBError foo( ENUM2 *p, int x, int y, Ptr * _ptr )
.
I'm trying to create a complete test-case based on your codes for a Win32 platform. My question is how did you declare a 'Ptr' type?

Ritratto di Sergey Kostrov

>>...This is a strange linker error that I have been facing with Intel C++ compiler 2013...
.
I couldn't reproduce the problem. Is there any chance you isolate the problem in a small and complete VS project ( with Win32 and x64 configurations )?

Accedere per lasciare un commento.