Building on Linux Setup.sh fatal error: 'vector' file not found

when trying to run Setup.sh I get to the “Building ThirdParty libraries” section and then get:
If you don’t see SUCCESS message in the end, then building did not finish properly.
In that case, take a look into /home/robertb/Downloads/UnrealEngine/Engine/Build/BatchFiles/Linux/BuildThirdParty.log for details.

==> BuildHLSLCC

the log file states:

building hlslcc
+ cd Source/ThirdParty/hlslcc
+ P4Open hlslcc/lib/Linux/x86_64-unknown-linux-gnu/libhlslcc.a
+ for file in '$@'
+ '[' '!' -e hlslcc/lib/Linux/x86_64-unknown-linux-gnu/libhlslcc.a ']'
+ '[' -w hlslcc/lib/Linux/x86_64-unknown-linux-gnu/libhlslcc.a ']'
+ return
+ cd hlslcc/projects/Linux
+ set +e
++ which clang
+ CLANG_TO_USE=
+ set -e
+ '[' '!' -f '' ']'
+ CLANG_TO_USE=clang-3.5
+ set +e
++ which clang++
+ CLANGXX_TO_USE=
+ set -e
+ '[' '!' -f '' ']'
+ CLANGXX_TO_USE=clang++-3.5
+ make -j4 CC=clang-3.5 CXX=clang++-3.5 clean
rm -f ../../src/hlslcc_lib/ast_expr.o ../../src/hlslcc_lib/ast_function.o ../../src/hlslcc_lib/ast_to_hir.o ../../src/hlslcc_lib/ast_type.o ../../src/hlslcc_lib/builtin_stubs.o ../../src/hlslcc_lib/glcpp-lex.o ../../src/hlslcc_lib/glcpp-parse.o ../../src/hlslcc_lib/glsl_parser_extras.o ../../src/hlslcc_lib/glsl_symbol_table.o ../../src/hlslcc_lib/glsl_types.o ../../src/hlslcc_lib/hash_table.o ../../src/hlslcc_lib/hir_field_selection.o ../../src/hlslcc_lib/hlslcc.o ../../src/hlslcc_lib/hlsl_lexer.o ../../src/hlslcc_lib/hlsl_parser.o ../../src/hlslcc_lib/ir_basic_block.o ../../src/hlslcc_lib/ir_clone.o ../../src/hlslcc_lib/ir_constant_expression.o ../../src/hlslcc_lib/ir.o ../../src/hlslcc_lib/IRDump.o ../../src/hlslcc_lib/ir_expression_flattening.o ../../src/hlslcc_lib/ir_function_can_inline.o ../../src/hlslcc_lib/ir_function.o ../../src/hlslcc_lib/ir_function_detect_recursion.o ../../src/hlslcc_lib/ir_hierarchical_visitor.o ../../src/hlslcc_lib/ir_hv_accept.o ../../src/hlslcc_lib/ir_import_prototypes.o ../../src/hlslcc_lib/ir_print_visitor.o ../../src/hlslcc_lib/ir_rvalue_visitor.o ../../src/hlslcc_lib/ir_track_image_access.o ../../src/hlslcc_lib/ir_unused_structs.o ../../src/hlslcc_lib/ir_validate.o ../../src/hlslcc_lib/ir_variable_refcount.o ../../src/hlslcc_lib/loop_analysis.o ../../src/hlslcc_lib/loop_controls.o ../../src/hlslcc_lib/loop_unroll.o ../../src/hlslcc_lib/lower_clip_distance.o ../../src/hlslcc_lib/lower_discard.o ../../src/hlslcc_lib/lower_if_to_cond_assign.o ../../src/hlslcc_lib/lower_instructions.o ../../src/hlslcc_lib/lower_jumps.o ../../src/hlslcc_lib/lower_mat_op_to_vec.o ../../src/hlslcc_lib/lower_noise.o ../../src/hlslcc_lib/lower_output_reads.o ../../src/hlslcc_lib/lower_texture_projection.o ../../src/hlslcc_lib/lower_variable_index_to_cond_assign.o ../../src/hlslcc_lib/lower_vec_index_to_cond_assign.o ../../src/hlslcc_lib/lower_vec_index_to_swizzle.o ../../src/hlslcc_lib/lower_vector.o ../../src/hlslcc_lib/opt_algebraic.o ../../src/hlslcc_lib/opt_array_splitting.o ../../src/hlslcc_lib/opt_constant_folding.o ../../src/hlslcc_lib/opt_constant_propagation.o ../../src/hlslcc_lib/opt_constant_variable.o ../../src/hlslcc_lib/opt_copy_propagation.o ../../src/hlslcc_lib/opt_copy_propagation_elements.o ../../src/hlslcc_lib/opt_dead_code.o ../../src/hlslcc_lib/opt_dead_code_local.o ../../src/hlslcc_lib/opt_dead_functions.o ../../src/hlslcc_lib/opt_discard_simplification.o ../../src/hlslcc_lib/opt_function_inlining.o ../../src/hlslcc_lib/opt_if_simplification.o ../../src/hlslcc_lib/opt_noop_swizzle.o ../../src/hlslcc_lib/opt_redundant_jumps.o ../../src/hlslcc_lib/opt_structure_splitting.o ../../src/hlslcc_lib/opt_swizzle_swizzle.o ../../src/hlslcc_lib/opt_tree_grafting.o ../../src/hlslcc_lib/OptValueNumbering.o ../../src/hlslcc_lib/PackUniformBuffers.o ../../src/hlslcc_lib/pp.o ../../src/hlslcc_lib/ralloc.o ../../src/hlslcc_lib/ShaderCompilerCommon.o ../../src/hlslcc_lib/strtod.o ../../src/hlslcc_lib/symbol_table.o ../../src/hlslcc_exe/main.o ../../lib/Linux/x86_64-unknown-linux-gnu/libhlslcc.a ../../bin/Linux/hlslcc_64
+ make -j4 CC=clang-3.5 CXX=clang++-3.5
clang++-3.5 -fPIC -Wno-switch -Wno-unused-value -I../../src/hlslcc_lib -fvisibility=hidden -O2 -std=c++11 -o ../../src/hlslcc_lib/ast_expr.o -c ../../src/hlslcc_lib/ast_expr.cpp
clang++-3.5 -fPIC -Wno-switch -Wno-unused-value -I../../src/hlslcc_lib -fvisibility=hidden -O2 -std=c++11 -o ../../src/hlslcc_lib/ast_function.o -c ../../src/hlslcc_lib/ast_function.cpp
clang++-3.5 -fPIC -Wno-switch -Wno-unused-value -I../../src/hlslcc_lib -fvisibility=hidden -O2 -std=c++11 -o ../../src/hlslcc_lib/ast_to_hir.o -c ../../src/hlslcc_lib/ast_to_hir.cpp
clang++-3.5 -fPIC -Wno-switch -Wno-unused-value -I../../src/hlslcc_lib -fvisibility=hidden -O2 -std=c++11 -o ../../src/hlslcc_lib/ast_type.o -c ../../src/hlslcc_lib/ast_type.cpp
In file included from In file included from ../../src/hlslcc_lib/ast_type.cpp../../src/hlslcc_lib/ast_expr.cpp::3029:
:
../../src/hlslcc_lib/ShaderCompilerCommon.h../../src/hlslcc_lib/ShaderCompilerCommon.h::4141::1010::  fatal errorfatal error: : 'vector' file not found'vector' file not found

#include <vector>#include <vector>
In file included from 
         ^../../src/hlslcc_lib/ast_function.cpp         ^
:
30:
../../src/hlslcc_lib/ShaderCompilerCommon.h:41:10: fatal error: 'vector' file not found
#include <vector>
         ^
In file included from ../../src/hlslcc_lib/ast_to_hir.cpp:58:
../../src/hlslcc_lib/ShaderCompilerCommon.h:41:10: fatal error: 'vector' file not found
#include <vector>
         ^
1 error generated.
1 error generated.
make: *** [../../src/hlslcc_lib/ast_expr.o] Error 1
make: *** Waiting for unfinished jobs....
make: *** [../../src/hlslcc_lib/ast_type.o] Error 1
1 error generated.
make: *** [../../src/hlslcc_lib/ast_function.o] Error 1
1 error generated.
make: *** [../../src/hlslcc_lib/ast_to_hir.o] Error 1

Most likely you don’t have libstdc++ installed. I guess we should add that to Setup.sh

I did sudo apt-get install libstdc++6 and then received the same set of errors.

#include

 int main() {
     std::cout << "Hello, world!\n";
     return 0;
 }

g++ hello_world.cpp
./a,out
Hello, world!

Try compiling a hello world program that uses STL.

Please try with clang++, not g++.

cpp_stuff$ clang+±3.5 hello_world.cpp
hello_world.cpp:1:10: fatal error: ‘iostream’ file not found
#include
^
1 error generated.

cpp_stuff$ clang++ hello_world.cpp
The program ‘clang++’ can be found in the following packages:
* clang-3.3
* clang-3.4
* clang-3.5
Try: sudo apt-get install

cpp_stuff$ clang+±3.5 hello_world.cpp -v
…"

#include "..." search starts here:

#include <...> search starts here:

 /usr/bin/../lib/gcc/x86_64-linux-gnu/4.9/../../../../include/c++

 /usr/local/include

 /usr/lib/llvm-3.5/bin/../lib/clang/3.5.0/include

 /usr/bin/../lib/gcc/x86_64-linux-gnu/4.9/include

 /usr/include/x86_64-linux-gnu

 /usr/include

End of search list.

hello_world.cpp:1:10: fatal error: 'iostream' file not found

#include <iostream>

         ^

1 error generated.

there was other stuff in there but too much to paste
link text

here is the full output from trying to run Setup.sh:

 ./Setup.sh
Registering git hooks... (this will override existing ones!)

Github build
Checking / downloading the latest archives
Checking dependencies (excluding Win32, Win64, Mac, Android)...
Updating dependencies: 100% (1/1), 0.5 MiB cached, done.
Result: 0
Fixing inconsistent case in filenames.
Removing a stable libLND.so binary that was relocated in 4.8

Building ThirdParty libraries

If you don't see SUCCESS message in the end, then building did not finish properly.
In that case, take a look into /home/robertb/Downloads/UnrealEngine/Engine/Build/BatchFiles/Linux/BuildThirdParty.log for details.

==> BuildHLSLCC

You can use -v to work out what paths it is checking and from that try to find out what particular package is missing on your distribution.

It seems like you need to install g++ 4.9.

Thanks, I was able to successfully setup and build.

I had same issue and I resolve that problem.

Set CPATH, LIBRARY_PATH environment variable like below. ( in my case, clang 3.5 include directory )

export CPATH=/usr/lib/clang/3.5/include

export LIBRARY_PATH=/usr/lib/clang/3.5/lib

And, run Setup.sh