Re: Including C code on A4GL
Mike Aubury <[email protected]>
| Newsgroups | gmane.comp.lang.4gl.aubit.general |
|---|---|
| Message-ID | <CAGAq4WFizuczP1POfNX9kJsfc+WmLCaEgS1-NeSBnJUeYHrAMg@mail.gmail.com> |
You cant include a C file based on a variable - so anything based on :
LET l_path = "/some/other/directory/my_c_file.c"
isn't going to work - the variable usage is a runtime thing - whereas
the #include is done at compile time..
There are several ways to do what you want though.
First - include the file by using the absolute file name :
{!
code
#include "/path/to/c/file/my_c_file.c"
endcode
!}
Or specify the path on the compile line using the C compilers -I
(capital i) and the path :
{!
code
#include "my_c_file.c"
endcode
!}
and then
4glpc -o somefile.4ae somefile.4gl -I /path/to/c/file
The final way - is not to include the file at all - but just link with it..
4glpc -o somefile.4ae somefile.4gl /path/to/c/file/my_c_file.c
HTH
On 3 August 2013 18:50, Alain Siverly <[email protected]> wrote:
> Hi,
>
> my goal ist to include a c file which is not at the same directory as
> the 4gl code.
>
> I began this way. This runs (if my_c_file.c is in the same directory):
> {!
> code
> #include "my_c_file.c"
> endcode
> !}
>
> But this fails:
> LET l_path = "/some/other/directory/my_c_file.c"
> {!
> code
> #include l_path
> endcode
> !}
> The error message is:
> menu_show_hide.c:11119:13: error: #include expects "FILENAME" or <FILENAME>
>
> This also fails:
> {!
> code
> #include "l_pfad"
> endcode
> !}
> The error message ist:
> ...menu_show_hide.c:11119:21: error: l_pfad: No such file or directory
> The same error produces #include <l_pfad>
>
> Thank you in advance!
>
> Regards
> Alain
> VENTAS AG
>
> ------------------------------------------------------------------------------
> Get your SQL database under version control now!
> Version control is standard for application code, but databases havent
> caught up. So what steps can you take to put your SQL databases under
> version control? Why should you start doing it? Read more to find out.
> http://pubads.g.doubleclick.net/gampad/clk?id=49501711&iu=/4140/ostg.clktrk
> _______________________________________________
> Aubit4gl-discuss mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/aubit4gl-discuss
------------------------------------------------------------------------------
Get your SQL database under version control now!
Version control is standard for application code, but databases havent
caught up. So what steps can you take to put your SQL databases under
version control? Why should you start doing it? Read more to find out.
http://pubads.g.doubleclick.net/gampad/clk?id=49501711&iu=/4140/ostg.clktrk