gcc compilation without using system defined header locations

Posted by bogertron on Stack Overflow See other posts from Stack Overflow or by bogertron
Published on 2010-04-12T20:55:00Z Indexed on 2010/04/12 21:03 UTC
Read the original article Hit count: 258

Filed under:
|
|
|

I am attempting to compile a c++ class using gcc. Due to the nature of the build, I need to invoke gcc from a non-standard location and include non-system defined headers, only to add a set from a different location. However, when I do this, I run into an issue where I cannot find some base symbols (suprise suprise). So i am basically running this command to compile my code:

-->(PARENT_DIR)/usr/bin/gcc # invoke compiler
-B$(PARENT_DIR)/usr/lib64/gcc/suselinux-x8664 
-B$(PARENT_DIR)/usr/lib64 
 #C/C++ flags
-fPIC -fvisibility=default -g -c -Wall -m64 -nostdinc
 # source files
-I$(SRC_DIR_ONE)/ 
-I$(SRC_DIR_TWO)
-I../include 
 # 'Mock' include the system header files
-I$(PARENT_DIR)/usr/include/c++/$(GCC_VERSION) 
-I$(PARENT_DIR)/usr/include/c++/$(GCC_VERSION)/backward 
-I$(PARENT_DIR)/usr/include/c++/$(GCC_VERSION)/x86_64-suse-linux 
-I$(PARENT_DIR)/usr/lib64/x86_64-suse-linux/$(GCC_VERSION)/include 
-I$(PARENT_DIR)/usr/lib64/gcc/x86_64-suse-linux/$(GCC_VERSION)/include 
-I$(PARENT_DIR)/usr/lib64/gcc/x86_64-suse-linux/$(GCC_VERSION)/include-fixed 
-I$(PARENT_DIR)/usr/src/linux/include 
-I$(PARENT_DIR)/usr/x86_64-suse-linux/include 
-I$(PARENT_DIR)/usr/include/suselinux-x8664 
-I$(PARENT_DIR)/usr/suselinux-x8664/include 
-I$(PARENT_DIR)/usr/include 
-I$(PARENT_DIR)/usr/include/linux 
file.cpp

I am getting several errors which indicate that the base headers are not being included: such as:

$(PARENT_DIR)/usr/include/c++/$(GCC_VERSION)/cstddef ::prtdiff_t has not been declared $(PARENT_DIR)/usr/include/c++/$(GCC_VERSION)/cstddef ::size_t has not bee declared.

Is there something that I am doing wrong when I include the header file directories? Or am I looking in the wrong place?

© Stack Overflow or respective owner

Related posts about gcc

Related posts about nostdinc