Hi, I am trying to run basic OCR code listed in your web page. I just managed to compile the C++ code successfully but during build (.obj file, *exe files) , an error message popped up saying “unresolved external symbol_imp_page_rect in function main”.
Can anybody help me out on this problem?? Please!!
Hi, I am trying to run your OCR C++ code listed in this website. Asemble went through OK but there is a error msg syaing “unresolved external symbol_imp_page_rect” in .obj file.
Can you help me on this problem??
We have already noticed your similar inquiry. We are trying to replicate this behavior in our environment and will get back to you shortly.
We tested the case in our environment and could not reproduce the issue. We need following additional information from you side:
- Have you downloaded the API directly using NuGet Package Manager or you have included it manually in the project?
- What is the Complier Type?
Thank you for quick reponse
First question : No. The environment is just “as is” when the Visual C++ installed.
Secon question:. This environment is “MS Microsoft Visual Studio Professional 2022 (64-bit) - Current
Version 17.4.5”. As mentioned above, since it’s installation (Dec 2022) on my desktop, no environment change. And conpiler is C++.
Would you please try using VS 2019 as the issue seems related to the outdated C++ runtimes and compiler versions. Meanwhile, we are trying to replicate this behavior and will share our findings with you soon.
Hi, Assad.
Per your advice, I did test on both platforms, VS2019 and VS2022. I just installed the VS2019 (with v142). After that, my VS2022 (with v143) was also updated with recent updates. Still the problem remains uncorrected.
Please see the 2 results below.
Microsoft Visual Studio Professional 2019 Version 16.11.24 with toolset v142
Build started…
1>------ Build started: Project: yj_AsposeOCR, Configuration: Debug Win32 ------
1>yj_AsposeOCR.cpp
1>yj_AsposeOCR.obj : error LNK2019: unresolved external symbol __imp__page_rect referenced in function _main
1>F:\yj_VisualStudio_Work\yj_App_VS2019\yj_AsposeOCR\Debug\yj_AsposeOCR.exe : fatal error LNK1120: 1 unresolved externals
1>Done building project “yj_AsposeOCR.vcxproj” – FAILED.
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
Microsoft Visual Studio Professional 2022 Version 17.5.1 with toolset v143
Build started…
1>------ Build started: Project: yj_AsposeOCR, Configuration: Debug x64 ------
1>yj_AsposeOCR.obj : error LNK2019: unresolved external symbol __imp_page_rect referenced in function main
1>F:\yj_VisualStudio_Work\yj_Apps\yj_AsposeOCR\x64\Debug\yj_AsposeOCR.exe : fatal error LNK1120: 1 unresolved externals
1>Done building project “yj_AsposeOCR.vcxproj” – FAILED.
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
========== Build started at 10:20 PM and took 01.727 seconds ==========
Your help is greatly appreciated.
Thank you.
Please create a new simple console application in Visual Studio and right click on the project in Solution Explorer. Select Manage NuGet Packages Option and install Aspose.OCR for C++ using NuGet Gallery window. Build the project. If any issue occurs, please add the console application in .zip archive and share with us. We will further investigate. Please note that we are still unable to replicate this error in our environment.
Hi, Assda. The attchment here is what I did per your instruction.
Please read it.
Many thanks.To_Assad_03072023.docx (110.6 KB)
You have checked path to the current directory of application. It looks like that it is wrong path. Can you please check again?
In case issue still happens, please share the above-requested information so that we can further proceed to assist you accordingly.