Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Build] error C2653: 'system_clock': is not a class or namesp ace name #24145

Open
sandeepdegirum opened this issue Mar 24, 2025 · 1 comment
Labels
build build issues; typically submitted using template

Comments

@sandeepdegirum
Copy link

Describe the issue

Following steps were followed

Downloaded a pre built package onnxruntime-win-x64-1.21.0
cd c_cxx
mkdir build
cd build
cmake .. -A x64 -T host=x64 -DONNXRUNTIME_ROOTDIR=D:\onnxruntime-win-x64-1.21.0
msbuild onnxruntime_samples.sln /p:Configuration=Release

Got 12 errors ... top errors given below

"D:\onnxruntime-inference-examples\c_cxx\build\onnxruntime_samples.sln" (default target) (1) ->
"D:\onnxruntime-inference-examples\c_cxx\build\imagenet\image_classifier.vcxproj.metaproj" (default target) (7) ->
"D:\onnxruntime-inference-examples\c_cxx\build\imagenet\image_classifier.vcxproj" (default target) (10) ->
(ClCompile target) ->
D:\onnxruntime-inference-examples\c_cxx\imagenet\main.cc(92,3): error C2653: 'system_clock': is not a class or namesp
ace name [D:\onnxruntime-inference-examples\c_cxx\build\imagenet\image_classifier.vcxproj]

On further observation observed that imagenet\main.cc needs to include upon which build was clean.

Did I miss something or the file imagenet\main.cc needs to updated with #include

Urgency

Normal

Target platform

Windows

Build script

cmake .. -A x64 -T host=x64 -DONNXRUNTIME_ROOTDIR=D:\onnxruntime-win-x64-1.21.0
msbuild onnxruntime_samples.sln /p:Configuration=Release

Error / output

"D:\onnxruntime-inference-examples\c_cxx\build\onnxruntime_samples.sln" (default target) (1) ->
"D:\onnxruntime-inference-examples\c_cxx\build\imagenet\image_classifier.vcxproj.metaproj" (default target) (7) ->
"D:\onnxruntime-inference-examples\c_cxx\build\imagenet\image_classifier.vcxproj" (default target) (10) ->
(ClCompile target) ->
D:\onnxruntime-inference-examples\c_cxx\imagenet\main.cc(92,3): error C2653: 'system_clock': is not a class or namesp
ace name [D:\onnxruntime-inference-examples\c_cxx\build\imagenet\image_classifier.vcxproj]
D:\onnxruntime-inference-examples\c_cxx\imagenet\main.cc(92,28): error C2955: 'std::chrono::time_point': use of class
template requires template argument list [D:\onnxruntime-inference-examples\c_cxx\build\imagenet\image_classifier.vcxp
roj]
D:\onnxruntime-inference-examples\c_cxx\imagenet\main.cc(121,33): error C2512: 'std::chrono::time_point': no appropri
ate default constructor available [D:\onnxruntime-inference-examples\c_cxx\build\imagenet\image_classifier.vcxproj]
D:\onnxruntime-inference-examples\c_cxx\imagenet\main.cc(140,19): error C2653: 'system_clock': is not a class or name
space name [D:\onnxruntime-inference-examples\c_cxx\build\imagenet\image_classifier.vcxproj]
D:\onnxruntime-inference-examples\c_cxx\imagenet\main.cc(140,33): error C3861: 'now': identifier not found [D:\onnxru
ntime-inference-examples\c_cxx\build\imagenet\image_classifier.vcxproj]
D:\onnxruntime-inference-examples\c_cxx\imagenet\main.cc(140,17): error C2582: 'operator =' function is unavailable i
n 'std::chrono::time_point' [D:\onnxruntime-inference-examples\c_cxx\build\imagenet\image_classifier.vcxproj]
D:\onnxruntime-inference-examples\c_cxx\imagenet\main.cc(166,22): error C2653: 'system_clock': is not a class or name
space name [D:\onnxruntime-inference-examples\c_cxx\build\imagenet\image_classifier.vcxproj]
D:\onnxruntime-inference-examples\c_cxx\imagenet\main.cc(166,36): error C3861: 'now': identifier not found [D:\onnxru
ntime-inference-examples\c_cxx\build\imagenet\image_classifier.vcxproj]
D:\onnxruntime-inference-examples\c_cxx\imagenet\main.cc(166,42): error C2677: binary '-': no global operator found w
hich takes type 'std::chrono::time_point' (or there is no acceptable conversion) [D:\onnxruntime-inference-examples\c_c
xx\build\imagenet\image_classifier.vcxproj]
D:\onnxruntime-inference-examples\c_cxx\imagenet\main.cc(167,56): error C3536: 'elapsed': cannot be used before it is
initialized [D:\onnxruntime-inference-examples\c_cxx\build\imagenet\image_classifier.vcxproj]
D:\onnxruntime-inference-examples\c_cxx\imagenet\main.cc(167,33): error C2672: 'std::chrono::duration_cast': no match
ing overloaded function found [D:\onnxruntime-inference-examples\c_cxx\build\imagenet\image_classifier.vcxproj]
D:\onnxruntime-inference-examples\c_cxx\imagenet\main.cc(169,115): error C3536: 'eta': cannot be used before it is in
itialized [D:\onnxruntime-inference-examples\c_cxx\build\imagenet\image_classifier.vcxproj]

4 Warning(s)
12 Error(s)

Visual Studio Version

1.98.2

GCC / Compiler Version

No response

@sandeepdegirum sandeepdegirum added the build build issues; typically submitted using template label Mar 24, 2025
@yuslepukhin
Copy link
Member

Contributions are welcome

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
build build issues; typically submitted using template
Projects
None yet
Development

No branches or pull requests

2 participants