Results 1 to 6 of 6

Thread: C++ Binding Link Error in VS 2010

  1. #1
    Junior Member
    Join Date
    May 2011
    Posts
    3

    C++ Binding Link Error in VS 2010

    Hi All,

    I am having a link error whenever I try to use the C++ bindings in a very basic OpenCL tutorial program using MS Visual Studio 2010. I installed the Nvidia Developers toolkit and added cl.hpp into the include directory from the main OpenCL API registry page.

    I have also gone and edited the Properties page as directed by some online instructions. These included modifying:

    Additional Include Directories, where I added C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v3.2\include

    Additional Library Directories, where I added C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v3.2\lib\x64

    Additional Dependencies, where I added OpenCL.lib

    Without the C++ bindings, everything seems to work great. However, when I do include them, I get a long list of errors similar to this:

    Code :
    1>  All outputs are up-to-date.
    1>hw.obj : error LNK2019: unresolved external symbol _clGetPlatformInfo@20 referenced in function "public: int __thiscall cl::Platform::getInfo(unsigned int,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > *)const " (?getInfo@Platform@cl@@QBEHIPAV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z)
     
    ...
     
    1>C:\Users\Jon\Documents\Visual Studio 2010\Projects\HelloWorld\Debug\HelloWorld.exe : fatal error LNK1120: 20 unresolved externals

    I have looked through other messages with similar link errors on this site and others, but have not found anything helpful. Any advice would be greatly appreciated.

    Thank you in advance!

  2. #2

    Re: C++ Binding Link Error in VS 2010

    I am having the same problem and was hoping that I could get some help from this forum.

  3. #3
    Junior Member
    Join Date
    May 2011
    Posts
    3

    Re: C++ Binding Link Error in VS 2010

    Hi David,

    I haven't worked through the problem quite yet. I've had some other things come up and have had to switch focus. When I do come up with an answer, I will be sure to post the solution. If you happen to beat me to it, please do the same!

    Jon

  4. #4

    Re: C++ Binding Link Error in VS 2010

    OK Jon,

    As the saying goes, "two heads are better then one" provided they are not on top of the same shoulders

  5. #5

    Re: C++ Binding Link Error in VS 2010

    Be sure you're linking with win32 libraries and compiling in win32 platform. If you links with shrUtils64.lib but compile in win32, it reports this error.

    I hope it helps

  6. #6
    Junior Member
    Join Date
    May 2011
    Posts
    3

    Re: C++ Binding Link Error in VS 2010

    This helped tremendously, thank you. I was pointing to the x64 lib folder under the Cuda directory, instead of the Win32. Thank you very much for your help!

Similar Threads

  1. using opencl link error..
    By phoebe0105 in forum OpenCL
    Replies: 1
    Last Post: 05-31-2010, 11:44 AM
  2. ug lib link error..!
    By shellee in forum OpenGL ES general technical discussions
    Replies: 2
    Last Post: 12-13-2004, 03:21 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •