incorrect include path added - bug?

Added by Kevin Thacker almost 6 years ago

I have this setup:

MainHeader.h
Platform library directory contains a Platform.h which #include <string.h> and later a #include <String/string.h>
String library directory (containing it's own string.h and StringFuncs.cpp which includes MainHeader.h

When StringFuncs.cpp is compiled using the current jam, it reads MainHeader.h which tries to read standard library string.h but because of the include directory "String" automatically added by jamplus it then gets the wrong string.h file causing a compilation error.

The original setup is a visual studio project. I am making a jam version by hand. I am doing the same for all of our other projects.

In c.jam the line "local _hdrs = $(SEARCH_SOURCE) ; " causes the path to be added when String library is built:

/I"." /I"c:/String" /"C:/String/.." /I"c:/Program Files (x86)/Microsoft Visual Studio 10.0/vc/include"

if the line is changed to "local _hdrs = "" ; " then we get correct behaviour and the result is:

/I"." /I"C:/Project/.." /I"c:/Program Files (x86)/Microsoft Visual Studio 10.0/vc/include"

Opening the project in visual studio and looking at the compiler command-line it only has:

/I"C:/Project/.."

So it searches in the local dir (local to MainHeader.h, doesn't find it and reverts to standard libraries.

So I believe this is a bug in Jamplus.


Replies (3)

RE: incorrect include path added - bug? - Added by Joshua Jensen almost 6 years ago

Are you using the nextgen branch or the master branch? The behavior between the two for include paths is different. I believe the nextgen branch behavior is more correct.

-Josh

RE: incorrect include path added - bug? - Added by Joshua Jensen almost 6 years ago

See http://jamplus.org/boards/1/topics/392 for additional detail of the fix in the nextgen branch.

RE: incorrect include path added - bug? - Added by Kevin Thacker almost 6 years ago

Joshua Jensen wrote:

Are you using the nextgen branch or the master branch? The behavior between the two for include paths is different. I believe the nextgen branch behavior is more correct.

-Josh

I am using master branch at this time.

I did find the other thread after posting this, so I understand why.

(1-3/3)