c++ - Compiled library's headers not being able to reach each other -


i'm having issue regarding library called jsbsim. library not relevant, issues surrounding multiple cases of cyclic dependency in header files.

background info:

running centos 7 64 bit - libraries statically linked headers located in usr/local/include , corresponding .a , .la in usr/local/lib

the directory structure /usr/local/include/jsbsim followed:

initialization input_output math models simgear fgfdmexec.h fgjsbbase.h 

i'm running makefile following content:

all:     g++ *.cpp -ljsbsim -o output  clean:     /bin/rm -f output 

i'm writing wrapper jsbsim basic following skeleton:

#include <jsbsim/fgfdmexec.h>  class jsbsimwrapper { }; 

i following error when run makefile:

compilation terminated. in file included /usr/local/include/jsbsim/fgfdmexec.h:47:0,                  jsbsimwrapper.hpp:7,                  main.cpp:1: /usr/local/include/jsbsim/initialization/fgtrim.h:53:23: fatal error: fgfdmexec.h: no such file or directory  #include "fgfdmexec.h"                        ^ compilation terminated. make: *** [all] error 1 

the errors don't come class itself; rather inclusion of main header file of library. did investigating, , file fgtrim.h located in initialization, , in fgtrim's include's:

#include "fgfdmexec.h" 

it looks fgtrim can't see fgfdmexec.h because it's down directory, fgfdmexec.h can see fgtrim fine because in fgfdmexec.h has following include:

#include "initialization/fgtrim.h" 

is there way around this? don't want have reorganize header structure or rewrite headers , recompile library if don't have to.

thanks!

i solved issue.

i edited makefile following:

jsbsim=/usr/local/include/jsbsim cxxflags=-i$(jsbsim) cxxflags+=-i$(jsbsim)/initialization cxxflags+=-i$(jsbsim)/simgear/xml cxxflags+=-i$(jsbsim)/simgear cxxflags+=-i$(jsbsim)/models/atmosphere cxxflags+=-i$(jsbsim)/models/propulsion cxxflags+=-i$(jsbsim)/models/flight_control cxxflags+=-i$(jsbsim)/models cxxflags+=-i$(jsbsim)/input_output cxxflags+=-i$(jsbsim)/math  output: main.cpp jsbsimwrapper.cpp     g++ main.cpp jsbsimwrapper.cpp $(cxxflags) -ljsbsim -o output clean:     /bin/rm -f output 

hopefully helps somebody!


Comments

Popular posts from this blog

account - Script error login visual studio DefaultLogin_PCore.js -

xcode - CocoaPod Storyboard error: -