Hi,
I am trying to compile some code from the root command line where I use std:array. However, already including the header produces lots of error messages. This is how my code looks like:
#include <array>
#include <iostream>
void main(){
std::cout << "HALLO WELT" << std::endl;
}
With CL.exe it compiles without problems, but when i try
I get the following errors (xyz is my working directory):
299252_cint.cxx
D:\xyz\AutoDict_vector_vector_string_allocator_string_____.cxx(2)
: fatal error C1083: Cannot open include file: 'C:\vector': No such file or dir
ectory
Error: external preprocessing failed. (0)
!!!Removing D:\xyz\AutoDict_vector_vector_string_allocator_string
______cxx_ACLiC_dict.cxx D:\xyz\AutoDict_vector_vector_string_all
ocator_string______cxx_ACLiC_dict.h !!!
Error: C:\root_v5.34.21\bin\rootcint: error loading headers...
Error in <ACLiC>: Dictionary generation failed!
2203252_cint.cxx
D:\xyz\AutoDict_random_access_iterator_vector_string_allocator_st
ring____long_.cxx(2) : fatal error C1083: Cannot open include file: 'C:\vector':
No such file or directory
Error: external preprocessing failed. (0)
!!!Removing D:\xyz\AutoDict_random_access_iterator_vector_string_
allocator_string____long__cxx_ACLiC_dict.cxx D:\xyxz\AutoDict_rand
om_access_iterator_vector_string_allocator_string____long__cxx_ACLiC_dict.h !!!
Error: C:\root_v5.34.21\bin\rootcint: error loading headers...
Error in <ACLiC>: Dictionary generation failed!
and when I try
I get
Info in <ACLiC>: script has already been loaded in interpreted mode
Info in <ACLiC>: unloading D:\xyz\TestArrayInclude.cpp and compil
ing it
Error: Symbol G__ARRAYMAX is not defined in current scope graphbuf.h(139)
Error: Binary operator oprand missing graphbuf.h(139)
Info in <TWinNTSystem::ACLiC>: creating shared library D:\xyz\TestArrayInclude_cpp.dll
2431252_cint.cxx
Error: Symbol _Size is not defined in current scope C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\INCLUDE\array(21)
Error: no such template array<_Ty,_Size> C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\INCLUDE\array(22)
Error: class,struct,union or type _Ty not defined C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\INCLUDE\array(23)
Error: class,struct,union or type _Ty not defined C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\INCLUDE\array(26)
Error: class,struct,union or type _Ty not defined C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\INCLUDE\array(27)
Error: class,struct,union or type _Ty not defined C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\INCLUDE\array(28)
Error: class,struct,union or type _Ty not defined C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\INCLUDE\array(29)
Error: no such template _Array_iterator<_Ty,_Size> C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\INCLUDE\array(31)
Error: no such template _Array_const_iterator<_Ty,_Size> C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\INCLUDE\array(32)
Error: class,struct,union or type _STD not defined C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\INCLUDE\array(34)
Error: class,struct,union or type _STD not defined C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\INCLUDE\array(35)
Error: Symbol _Size is not defined in current scope C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\INCLUDE\array(210)
Error: Symbol _Size is not defined in current scope C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\INCLUDE\array(210)
Error: Symbol _Ty _Elems[_Size==0?1:_Size] is not defined in current scope C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\INCLUDE\array(210)
Error: Symbol array is not defined in current scope C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\INCLUDE\array(537)
Error: Symbol get is not defined in current scope C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\INCLUDE\array(538)
Error: Symbol tuple_element is not defined in current scope C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\INCLUDE\array(539)
Error: Symbol tuple_size is not defined in current scope C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\INCLUDE\array(540)
Warning: Error occurred during reading source files
Warning: Error occurred during dictionary source generation
!!!Removing D:\xyz\TestArrayInclude_cpp_ACLiC_dict.cxx D:\xyz\TestArrayInclude_cpp_ACLiC_dict.h !!!
Error: C:\root_v5.34.21\bin\rootcint: error loading headers...
Error in <ACLiC>: Dictionary generation failed!
Info in <ACLiC>: Invoking compiler to check macro's validity
!!!Dictionary position not recovered because G__unloadfile() is used in a macro!
!!
*** Interpreter error recovered ***
What is wrong with including ?
I always thought that “.L …++” is simply calling the compiler (CL.exe in this case) with appropriate options and that it is more or less equivalent to building the lib “by hand” via using the compiler (CL.exe) outside of root. What is the difference?
PS: I can include e.g. and use them without problems. Thats why I think the problem is not related to environment variables / include paths.