Home | News | Documentation | Download

How to use Windows API functions?

_ROOT Version:6.22
_Platform:Windows10 10.0.18362.0
_Compiler:Visual studio 2019 16.6.5


Hi, Rooters:
When I read a binary file, I used a memory mapping method to increase the file reading rate. Windows API functions were used, but when I was running, ROOT gave me the following prompt:

IncrementalExecutor::executeFunction: symbol '_imp__UnmapViewOfFile@4' unresolved while linking function '??__Eid@?$num_put@DV?$ostreambuf_iterator@DU?$char_traits@D@std@@@std@@@std@@2V0locale@2@A@YAXXZcling_module_16_'!
You are probably missing the definition of _imp__UnmapViewOfFile@4
Maybe you need to load the corresponding shared library?
IncrementalExecutor::executeFunction: symbol '_imp__CreateFileA@28' unresolved while linking function '??__Eid@?$num_put@DV?$ostreambuf_iterator@DU?$char_traits@D@std@@@std@@@std@@2V0locale@2@A@YAXXZcling_module_16_'!
You are probably missing the definition of _imp__CreateFileA@28
Maybe you need to load the corresponding shared library?
IncrementalExecutor::executeFunction: symbol '_imp__MapViewOfFile@20' unresolved while linking function '??__Eid@?$num_put@DV?$ostreambuf_iterator@DU?$char_traits@D@std@@@std@@@std@@2V0locale@2@A@YAXXZcling_module_16_'!
You are probably missing the definition of _imp__MapViewOfFile@20
Maybe you need to load the corresponding shared library?
IncrementalExecutor::executeFunction: symbol '_imp__CreateFileMappingA@24' unresolved while linking function '??__Eid@?$num_put@DV?$ostreambuf_iterator@DU?$char_traits@D@std@@@std@@@std@@2V0locale@2@A@YAXXZcling_module_16_'!
You are probably missing the definition of _imp__CreateFileMappingA@24
Maybe you need to load the corresponding shared library?
IncrementalExecutor::executeFunction: symbol '_imp__GetFileSize@8' unresolved while linking function '??__Eid@?$num_put@DV?$ostreambuf_iterator@DU?$char_traits@D@std@@@std@@@std@@2V0locale@2@A@YAXXZcling_module_16_'!
You are probably missing the definition of _imp__GetFileSize@8
Maybe you need to load the corresponding shared library?
IncrementalExecutor::executeFunction: symbol '_imp__GetSystemInfo@4' unresolved while linking function '??__Eid@?$num_put@DV?$ostreambuf_iterator@DU?$char_traits@D@std@@@std@@@std@@2V0locale@2@A@YAXXZcling_module_16_'!
You are probably missing the definition of _imp__GetSystemInfo@4
Maybe you need to load the corresponding shared library?
IncrementalExecutor::executeFunction: symbol '_imp__CloseHandle@4' unresolved while linking function '??__Eid@?$num_put@DV?$ostreambuf_iterator@DU?$char_traits@D@std@@@std@@@std@@2V0locale@2@A@YAXXZcling_module_16_'!
You are probably missing the definition of _imp__CloseHandle@4
Maybe you need to load the corresponding shared library?
IncrementalExecutor::executeFunction: symbol '_imp__GetLastError@0' unresolved while linking function '??__Eid@?$num_put@DV?$ostreambuf_iterator@DU?$char_traits@D@std@@@std@@@std@@2V0locale@2@A@YAXXZcling_module_16_'!
You are probably missing the definition of _imp__GetLastError@0
Maybe you need to load the corresponding shared library?

Could you gives some advices?

You cannot call Windows API functions with the interpreter. You must compile your code and create a standalone application

OK, Thanks!

You’re welcome! And note that you might encounter issues when mixing Windows API code and ROOT. To prevent redefinition errors, please use #include <Windows4root.h> instead of the standard #include <Windows.h>