0

I'm in the process of porting one of my project to an existing framework I've been developing. As a result I have two project, one that's the original I developed and then the ported one.

The problem I'm having is that the new project doesn't link. The error is "... unresolved external symbol ..." where the symbols should be defined in a library that's linked together with the project. By using VS command line tool dumpbin.exe I confirmed that the symbols said to be missing are in the library. The original project works fine, only by removing the library from the Linker->Input->Additional Dependencies do I get the same errors for that project.

Are there other reasons for "... unresolved external symbol ..." or am I simply not linking the library?

Details

The library in question is OpenCL.lib and the errors are "error LNK2019: unresolved external symbol _clBuildProgram@24 referenced in function ..." for all OpenCL API calls. Using the technique described in Tools for inspecting .lib files? I get the symbols for each function as one would expect.

Community
  • 1
  • 1
Jens Åkerblom
  • 898
  • 8
  • 19

1 Answers1

1

Okay, figured it out. The library I'm linking with is only for x64 architectures, switching to that platform got it working.

Would've liked a more descriptive error from VS but what can you do...

Jens Åkerblom
  • 898
  • 8
  • 19
  • 2
    It is recommended to change Visual Studio verbosity when issues happen during build, http://blogs.msdn.com/b/saraford/archive/2008/10/07/did-you-know-you-can-configure-the-msbuild-verbosity-in-the-output-window-329.aspx, as in that way you can read more information and probably can identify the cause more easily. – Lex Li May 10 '13 at 06:19