简体   繁体   中英

C++ header files are not being found

Context: I am building some code for an embedded board. It calls for installing the Xilinx tools, the Linaro toolchain and then invoking a setup bash script in the development board build directory (let's call it setup.sh).

If I do not run setup.sh , I can then build one of the lower level libraries, which has it's own configure script (./configure) which calls the usual ./bootstrap script. In this scenario ./bootstrap , g++ in this case says it can find sstream (the C++ stream header). Ok. Fine.

When I run the setup.sh script (at the top level), g++ then says it CANNOT find sstream. So somehow the g++ environment is changed somehow, and it is this I am trying to figure out.

The output in this erroneous case is

g++ has streams in std:: namespace
g++ does not have sstream
g++ does not have strstream.h
g++ does not have strstrea.h

I am trying to debug this to find out what g++ thinks it is doing and why it cannot find the sstream header. What are some ways to look at what the g++ include and libstdc++ library paths are set to? What environment variables control the behavior of gcc/g++?

#

If I remember correctly, Xilinx ships their own gcc toolchain with their products.

Just add the -I compile file to point to the proper includes path. Try to search for the header files inside Xilinx's /opt path, so you don't have a mismatch between the header version and the library version.

Makefile's usual env variables are:

# C Compiler: GNU C Compiler
CC = gcc    
# Linker: GNU Linker
LD = ld    
# C++ Compiler: GNU C++ Compiler
CPP = g++

Also check

CFLAGS
CPPFLAGS
LDFLAGS

Check if $CC is set after you execute setup.sh.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM