Forum Discussion

jjl3's avatar
jjl3
Icon for New Contributor rankNew Contributor
7 years ago

Some problems happened when try example of hls

Dear all

I am a starter for hls,

I have some problems, when I try this example "counter" as ug-hls-getting-started.

I am using VS2010 professional and Quartus 18.1 lite.

I don't know where is wrong.

Thanks for your support!

The detail information as below:

C:\intelFPGA_lite\18.1\hls\examples\counter>build.bat test-x86-64

i++ -march=x86-64 counter.cpp -o test-x86-64.exe

msvcrt.lib(crtexe.obj) : error LNK2019: unresolved external symbol __imp_Sleep referenced in function __tmainCRTStartup

msvcrt.lib(crtexe.obj) : error LNK2019: unresolved external symbol __imp_EncodePointer referenced in function pre_c_init

msvcrt.lib(atonexit.obj) : error LNK2001: unresolved external symbol __imp_EncodePointer

msvcrt.lib(unhandld.obj) : error LNK2019: unresolved external symbol __imp_SetUnhandledExceptionFilter referenced in function __CxxSetUnhandledExceptionFilter

msvcrt.lib(atonexit.obj) : error LNK2019: unresolved external symbol __imp_DecodePointer referenced in function _onexit

msvcrt.lib(gs_support.obj) : error LNK2019: unresolved external symbol __imp_QueryPerformanceCounter referenced in function __security_init_cookie

msvcrt.lib(gs_support.obj) : error LNK2019: unresolved external symbol __imp_GetTickCount referenced in function __security_init_cookie

msvcrt.lib(gs_support.obj) : error LNK2019: unresolved external symbol __imp_GetCurrentThreadId referenced in function __security_init_cookie

msvcrt.lib(gs_support.obj) : error LNK2019: unresolved external symbol __imp_GetCurrentProcessId referenced in function __security_init_cookie

msvcrt.lib(gs_support.obj) : error LNK2019: unresolved external symbol __imp_GetSystemTimeAsFileTime referenced in function __security_init_cookie

test-x86-64.exe : fatal error LNK1120: 9 unresolved externals

HLS Link x86-64 FAILED.

Run test-x86-64.exe to execute the test.

C:\intelFPGA_lite\18.1\hls\examples\counter>

3 Replies

  • It seems like you are missing the linking of libraries for VS. Did you run initialization script prior to running compilation ? https://www.intel.com/content/dam/www/programmable/us/en/pdfs/literature/hb/hls/ug-hls-getting-started.pdf Page 8 • On Windows systems, initialize your environment as follows: a. In your command prompt session, change directories to the hls directory in your Intel Quartus Prime installation directory. For example, C:\intelFPGA_pro\18.1\hls b. Run the following command from the hls directory to set the environment variables for the i++ command in the current terminal session: init_hls.bat The command prints out the modified environment variable settings. The environment initialization script shows the environment variables that it set, and you can now run the i++ command from this command prompt session.
    • jjl3's avatar
      jjl3
      Icon for New Contributor rankNew Contributor

      Yes, I did as the document hls/ug-hls-getting-started.pdf

      C:\intelFPGA_lite\18.1\hls\examples\counter>init_hls.bat

      Assuming current directory (C:\intelFPGA_lite\18.1\hls\) is root of i++

      Will use C:\intelFPGA_lite\18.1\hls\..\quartus to find Quartus for internal i++ use

      Quartus at C:\intelFPGA_lite\18.1\quartus\bin64\ will be used for any direct use

      Will be using Modelsim at C:\modeltech64_10.7c\win64\

      Adding C:\intelFPGA_lite\18.1\hls\bin to PATH

      Adding C:\intelFPGA_lite\18.1\hls\host\windows64\bin to PATH

      C:\intelFPGA_lite\18.1\hls\examples\counter>build.bat test-x86-64

      i++ -march=x86-64 counter.cpp -o test-x86-64.exe

      msvcrt.lib(crtexe.obj) : error LNK2019: unresolved external symbol __imp_Sleep referenced in function __tmainCRTStartup

      msvcrt.lib(crtexe.obj) : error LNK2019: unresolved external symbol __imp_EncodePointer referenced in function pre_c_init

      msvcrt.lib(atonexit.obj) : error LNK2001: unresolved external symbol __imp_EncodePointer

      msvcrt.lib(unhandld.obj) : error LNK2019: unresolved external symbol __imp_SetUnhandledExceptionFilter referenced in function __CxxSetUnhandledExceptionFilter

      msvcrt.lib(atonexit.obj) : error LNK2019: unresolved external symbol __imp_DecodePointer referenced in function _onexit

      msvcrt.lib(gs_support.obj) : error LNK2019: unresolved external symbol __imp_QueryPerformanceCounter referenced in function __security_init_cookie

      msvcrt.lib(gs_support.obj) : error LNK2019: unresolved external symbol __imp_GetTickCount referenced in function __security_init_cookie

      msvcrt.lib(gs_support.obj) : error LNK2019: unresolved external symbol __imp_GetCurrentThreadId referenced in function __security_init_cookie

      msvcrt.lib(gs_support.obj) : error LNK2019: unresolved external symbol __imp_GetCurrentProcessId referenced in function __security_init_cookie

      msvcrt.lib(gs_support.obj) : error LNK2019: unresolved external symbol __imp_GetSystemTimeAsFileTime referenced in function __security_init_cookie

      test-x86-64.exe : fatal error LNK1120: 9 unresolved externals

      HLS Link x86-64 FAILED.

      Run test-x86-64.exe to execute the test.

      C:\intelFPGA_lite\18.1\hls\examples\counter>

  • Its hard to guess, do you have multiple versions of Visual Studio installed ? "If you have multiple versions of Visual Studio, Microsoft recommends installing Visual Studio versions in the order in which the versions were released. For example, install Visual Studio 2010 before installing Visual Studio 2015. For details, see Install Visual Studio Versions Side-by-Side in the MSDN Library" Or perhaps try on a different machine, with a fresh installation of Visual Studio/ Quartus Prime Lite. thanks, Arslan