Interestingly, my working example was on a V5R3 system. This morning I took that same working sample to another system, and it will not compile with any of the INCLUDE values I had tried before.

Unfortunately I am not in a position where I can compare PTFs, but (if available) I'd look hard for PTFs in that area for V5R3.

My test case:

/home/dlovelady/source/try-c.c
#include "try-c.h"
int main(int argc, char *argv[]) {
}

/home/dlovelady/source/include/try-c.h
// This is my include file and you cannot have it

ADDENVVAR INCLUDE '/home/dlovelady/source/include/'


Dennis Lovelady
http://www.linkedin.com/in/dennislovelady
--
"The only kind of love that makes a lifetime
Into a life well lived,
The only kind of love that ever fills you,
Is the love you give."
-- David Wilcox


I finally got the opportunity to play with this. INCLUDE values that
did
not work for me:
./include
include

But both of these worked for me:
./include/
include/

I hope it's that simple for you!

All,
thanks a lot for your involvement, but for me it still does not work.

(It is really extremely frustrating for me that IBMâs C/C++ guides are
so
confusing.)


I have done the following test.

The compilation environment and source code details:
(1) OS version: 5.3;
(2) IFS structure:
/my_dir/my_project/syscsrc/
/my_dir/my_project/include/syscinc/
(3) current directory:
/my_dir/my_project
(4) source code mod_name.cpp with #include directive:
LINE 10: #include "syscinc/sys006i.hpp"

Tests done:
0. using INCLUDE env. variable:

CRTCPPMOD MODULE(my_lib/mod_name)
SRCSTMF('syscsrc/mod_name.cpp')
OUTPUT(*PRINT)
with:
(1) INCLUDE './include/'
(2) INCLUDE './include/:'
(3) INCLUDE './include'
(4) INCLUDE './include:'
(5) INCLUDE 'include/'
(6) INCLUDE 'include/:'
(7) INCLUDE 'include'
(8) INCLUDE 'include:'
(9) INCLUDE '/my_dir/my_project/include/'
(10)INCLUDE '/my_dir/my_project/include/:'
(11)INCLUDE '/my_dir/my_project/include'
(12)INCLUDE '/my_dir/my_project/include:'

THE COMPILATION FAILED with the message:
"syscsrc/mod_name.cpp", line 10.10: CZP0836(30) The #include
file "syscinc/sys006i.hpp" is not found.

1. using INCLUDE env. variable:

CRTCPPMOD MODULE(my_lib/mod_name)
SRCSTMF('syscsrc/mod_name.cpp')
OUTPUT(*PRINT)
OPTION(*INCDIRFIRST)
with:
(1) INCLUDE './include/'
(2) INCLUDE './include/:'
(3) INCLUDE './include'
(4) INCLUDE './include:'
(5) INCLUDE 'include/'
(6) INCLUDE 'include/:'
(7) INCLUDE 'include'
(8) INCLUDE 'include:'
(9) INCLUDE '/my_dir/my_project/include/'
(10)INCLUDE '/my_dir/my_project/include/:'
(11)INCLUDE '/my_dir/my_project/include'
(12)INCLUDE '/my_dir/my_project/include:'

THE COMPILATION FAILED with the message:
"syscsrc/mod_name.cpp", line 10.10: CZP0836(30) The #include
file "syscinc/sys006i.hpp" is not found.

2. using INCDIR command parameter:

CRTCPPMOD MODULE(my_lib/mod_name)
SRCSTMF('syscsrc/mod_name.cpp')
OUTPUT(*PRINT)
with:
(1) INCDIR('./include')
(2) INCDIR('./include/')
(3) INCDIR('include')
(4) INCDIR('include/')
(5) INCDIR('/my_dir/my_project/include/')
(6) INCDIR('/my_dir/my_project/include')

Module MOD_NAME was CREATED in library MY_LIB


Either I am doing something which is 'completely stupid' (and I am not
able to
find it) or the INCLUDE env. variable is ignored by the compiler.


Dennis,
can you please provide me with the following your test's
details/parameters?

1. OS version
2. IFS directory structure, where the source and include files exist;
3. the current directory name;
4. compilation command;
5. source code snapshot with #include directive


Thanks,
Darek



This thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2019 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].