I am new to OpenCL. When I tried the examples from the website of Altera, I got several LNK2001 errors as follows
Severity Code Description Project File Line Error LNK2001 unresolved external symbol __imp_sprintf hello_world C:\Users\S_KW\OpenCL\hello_world\alteracl.lib(acl_hal_mmd.obj) 1 Error LNK2001 unresolved external symbol __imp___iob_func hello_world C:\Users\S_KW\OpenCL\hello_world\alteracl.lib(acl_hal_mmd.obj) 1 Error LNK2001 unresolved external symbol __imp_fprintf hello_world C:\Users\S_KW\OpenCL\hello_world\alteracl.lib(acl_hal_mmd.obj) 1 Error LNK2001 unresolved external symbol __imp_sprintf hello_world C:\Users\S_KW\OpenCL\hello_world\alteracl.lib(acl_mem.obj) 1 Error LNK2001 unresolved external symbol __imp___iob_func hello_world C:\Users\S_KW\OpenCL\hello_world\alteracl.lib(acl_offline_hal.obj) 1 Error LNK2001 unresolved external symbol __imp__set_output_format hello_world C:\Users\S_KW\OpenCL\hello_world\alteracl.lib(acl_printf.obj) 1 Error LNK2001 unresolved external symbol __imp_fprintf hello_world C:\Users\S_KW\OpenCL\hello_world\alteracl.lib(acl_profiler.obj) 1 Error LNK2001 unresolved external symbol __imp_sprintf hello_world C:\Users\S_KW\OpenCL\hello_world\alteracl.lib(acl_program.obj) 1 Error LNK2001 unresolved external symbol __imp___iob_func hello_world C:\Users\S_KW\OpenCL\hello_world\alteracl.lib(acl_support.obj) 1 Error LNK2001 unresolved external symbol __imp_vsprintf hello_world C:\Users\S_KW\OpenCL\hello_world\alteracl.lib(acl_support.obj) 1 Error LNK2001 unresolved external symbol __imp_vsnprintf hello_world C:\Users\S_KW\OpenCL\hello_world\alteracl.lib(acl_support.obj) 1 Error LNK2001 unresolved external symbol __imp_vfprintf hello_world C:\Users\S_KW\OpenCL\hello_world\alteracl.lib(acl_support.obj) 1 Error LNK2001 unresolved external symbol __imp___iob_func hello_world C:\Users\S_KW\OpenCL\hello_world\alteracl.lib(acl_threadsupport.obj) 1 Error LNK1120 8 unresolved externals hello_world C:\Users\S_KW\OpenCL\hello_world\bin\hello_world.exe 1 Error IntelliSense: argument of type "void (*)(const char *errinfo, const void *, size_t, void *)" is incompatible with parameter of type "void (__stdcall *)(const char *, const void *, size_t, void *)" hello_world c:\Users\S_KW\OpenCL\hello_world\host\src\main.cpp 145 Warning LNK4044 unrecognized option '/LC:\Users\S_KW\arrow_c5sockit_bsp\arm32\lib'; ignored hello_world C:\Users\S_KW\OpenCL\hello_world\LINK 1 Warning LNK4044 unrecognized option '/lalterahalmmd'; ignored hello_world C:\Users\S_KW\OpenCL\hello_world\LINK 1 Warning LNK4044 unrecognized option '/lalterammdpcie'; ignored hello_world C:\Users\S_KW\OpenCL\hello_world\LINK 1 Error LNK2001 unresolved external symbol __imp_vsnprintf hello_world C:\Users\S_KW\OpenCL\hello_world\MSVCRT.lib(vsnprintf.obj) 1 Error LNK2001 unresolved external symbol __imp__vsnprintf hello_world C:\Users\S_KW\OpenCL\hello_world\MSVCRT.lib(vsnprintf.obj) 1 Error LNK2001 unresolved external symbol __imp___iob_func hello_world C:\Users\S_KW\OpenCL\hello_world\pkg_editor.lib(pkg_editor.obj) 1 Error LNK2001 unresolved external symbol __imp_fprintf hello_world C:\Users\S_KW\OpenCL\hello_world\pkg_editor.lib(pkg_editor.obj) 1
I have already added path of the libs and head files. I am confused by those errors. What can I do to solve this?
----------------------------UPDATE------------------------------
OK, as Hadi Brais said, I added it to additional dependencies. And all of the old errors are gone. But there comes a new one.
Severity Code Description Project File Line Error LNK1120 1 unresolved externals hello_world C:\Users\S_KW\OpenCL\hello_world\bin\hello_world.exe 1 Error LNK2001 unresolved external symbol __imp_sprintf hello_world C:\Users\S_KW\OpenCL\hello_world\OpenCL.lib(icd_windows.obj) 1 Warning LNK4044 unrecognized option '/LC:\Users\S_KW\arrow_c5sockit_bsp\arm32\lib'; ignored hello_world C:\Users\S_KW\OpenCL\hello_world\LINK 1 Warning LNK4044 unrecognized option '/lalterahalmmd'; ignored hello_world C:\Users\S_KW\OpenCL\hello_world\LINK 1 Warning LNK4044 unrecognized option '/lalterammdpcie'; ignored hello_world C:\Users\S_KW\OpenCL\hello_world\LINK 1
This one has something to do with OpenCL.lib, I think. It seems that the lib cannot see the printf function. But I think the printf is built in C++. It is confusing. Someone know how to handle this? Thank you very much!!!