Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Beginner
25 Views

Linker Error LNK2001 for win32 but succeeds for x64

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

0 Kudos
5 Replies
Highlighted
Valued Contributor II
25 Views

>>... >>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'.
0 Kudos
Highlighted
Moderator
25 Views

Could you attach the test project? Did you build the same "debug" or "release" for each architecture (ia32 | x64)?
0 Kudos
Highlighted
Valued Contributor II
25 Views

>>...Could you attach the test project? . I would be glad to see it as well. Thanks in advance!
0 Kudos
Highlighted
Valued Contributor II
25 Views

>>...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?
0 Kudos
Highlighted
Valued Contributor II
25 Views

>>...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 )?
0 Kudos