How to include .lib file?

9 messages Options
Embed this post
Permalink
Jimmy Johnson

How to include .lib file?

Reply Threaded More More options
Print post
Permalink
I forgot.  Relating to my previous post.  I have the header files and a .lib file.  How do I make the project find and use the .lib file?

Jimmy J. Johnson

Colin LeMahieu

Re: How to include .lib file?

Reply Threaded More More options
Print post
Permalink
A lib file can be included in Project Settings -> Target -> Advanced -> Externals -> Add Library

--- In [hidden email], "Jimmy J. Johnson" <boxer41a@...> wrote:
>
> I forgot.  Relating to my previous post.  I have the header files and a .lib file.  How do I make the project find and use the .lib file?
>
> Jimmy J. Johnson
>


Jimmy Johnson

Re: How to include .lib file?

Reply Threaded More More options
Print post
Permalink
Thanks, I see it now.

I have a library in which I set an include path and a library, but it seems to not do any c-compilation (i.e. freezing) to include it.  Is this a library thing?

Also, if I use the library (the ecf file) in a project must the project also set the include path and lib location?

Jimmy J. Johnson


--- In [hidden email], "colinlema" <clemahieu@...> wrote:

>
> A lib file can be included in Project Settings -> Target -> Advanced -> Externals -> Add Library
>
> --- In [hidden email], "Jimmy J. Johnson" <boxer41a@> wrote:
> >
> > I forgot.  Relating to my previous post.  I have the header files and a .lib file.  How do I make the project find and use the .lib file?
> >
> > Jimmy J. Johnson
> >
>


Colin LeMahieu

Re: Re: How to include .lib file?

Reply Threaded More More options
Print post
Permalink
The includes are done at the method level and some times it requires
deleting the EIFGENs directory and recompiling because it doesn't detect it
right.

feature
external_feature_1 (cpp_obj: POINTER val1: INTEGER val2: POINTER)
external
   "C inline use %"header.h%""
alias
"[
    // Cast $cpp_obj to type cpp_obj_type and make a member call to
cpp_feature_1 passing in $val1 and $val2.
    return ((cpp_obj_type)($cpp_obj))->cpp_feature_1 ($val1, $val2);
]"

As far as I can tell libraries are copied from referenced projects so for
each project that references the Eiffel library they need to add the
external .lib.  It would be a nice feature to have this included
automatically.

On Fri, Jun 26, 2009 at 12:33 PM, Jimmy J. Johnson <[hidden email]>wrote:

>
>
> Thanks, I see it now.
>
> I have a library in which I set an include path and a library, but it seems
> to not do any c-compilation (i.e. freezing) to include it. Is this a library
> thing?
>
> Also, if I use the library (the ecf file) in a project must the project
> also set the include path and lib location?
>
> Jimmy J. Johnson
>
>
> --- In [hidden email] <eiffel_software%40yahoogroups.com>,
> "colinlema" <clemahieu@...> wrote:
> >
> > A lib file can be included in Project Settings -> Target -> Advanced ->
> Externals -> Add Library
> >
> > --- In [hidden email]<eiffel_software%40yahoogroups.com>,
> "Jimmy J. Johnson" <boxer41a@> wrote:
> > >
> > > I forgot. Relating to my previous post. I have the header files and a
> .lib file. How do I make the project find and use the .lib file?
> > >
> > > Jimmy J. Johnson
> > >
> >
>
>  
>


[Non-text portions of this message have been removed]

Colin LeMahieu

Re: Re: How to include .lib file?

Reply Threaded More More options
Print post
Permalink
Clarification:  libraries are *not* copied from referenced projects.

On Fri, Jun 26, 2009 at 12:53 PM, Colin LeMahieu <[hidden email]>wrote:

> The includes are done at the method level and some times it requires
> deleting the EIFGENs directory and recompiling because it doesn't detect it
> right.
>
> feature
> external_feature_1 (cpp_obj: POINTER val1: INTEGER val2: POINTER)
> external
>    "C inline use %"header.h%""
> alias
> "[
>     // Cast $cpp_obj to type cpp_obj_type and make a member call to
> cpp_feature_1 passing in $val1 and $val2.
>     return ((cpp_obj_type)($cpp_obj))->cpp_feature_1 ($val1, $val2);
> ]"
>
> As far as I can tell libraries are copied from referenced projects so for
> each project that references the Eiffel library they need to add the
> external .lib.  It would be a nice feature to have this included
> automatically.
>
>
> On Fri, Jun 26, 2009 at 12:33 PM, Jimmy J. Johnson <[hidden email]>wrote:
>
>>
>>
>> Thanks, I see it now.
>>
>> I have a library in which I set an include path and a library, but it
>> seems to not do any c-compilation (i.e. freezing) to include it. Is this a
>> library thing?
>>
>> Also, if I use the library (the ecf file) in a project must the project
>> also set the include path and lib location?
>>
>> Jimmy J. Johnson
>>
>>
>> --- In [hidden email]<eiffel_software%40yahoogroups.com>,
>> "colinlema" <clemahieu@...> wrote:
>> >
>> > A lib file can be included in Project Settings -> Target -> Advanced ->
>> Externals -> Add Library
>> >
>> > --- In [hidden email]<eiffel_software%40yahoogroups.com>,
>> "Jimmy J. Johnson" <boxer41a@> wrote:
>> > >
>> > > I forgot. Relating to my previous post. I have the header files and a
>> .lib file. How do I make the project find and use the .lib file?
>> > >
>> > > Jimmy J. Johnson
>> > >
>> >
>>
>>  
>>
>
>


[Non-text portions of this message have been removed]

Jimmy Johnson

Re: How to include .lib file?

Reply Threaded More More options
Print post
Permalink
Yes, I figured.  Thanks Colin for the example c++ code.  It seems to cover most cases.  But how do I call a constructor.  I tried to follow an example I got from EiffelRoom (I think):

        c_create: POINTER is
                        -- Call the cpp constructor
                external
                        "C++ inline use %"iNXTIterator.h%""
                alias
                        "[
                                return new iNXTIterator;
                        ]"
                end

but I get this error during c compilation:

c:\e_projects\eifgens\mindstorms_tester\w_code\c1\nx586.cpp(34) : error C2061: syntax error : identifier 'iNXTIterator'




--- In [hidden email], Colin LeMahieu <clemahieu@...> wrote:

>
> Clarification:  libraries are *not* copied from referenced projects.
>
> On Fri, Jun 26, 2009 at 12:53 PM, Colin LeMahieu <clemahieu@...>wrote:
>
> > The includes are done at the method level and some times it requires
> > deleting the EIFGENs directory and recompiling because it doesn't detect it
> > right.
> >
> > feature
> > external_feature_1 (cpp_obj: POINTER val1: INTEGER val2: POINTER)
> > external
> >    "C inline use %"header.h%""
> > alias
> > "[
> >     // Cast $cpp_obj to type cpp_obj_type and make a member call to
> > cpp_feature_1 passing in $val1 and $val2.
> >     return ((cpp_obj_type)($cpp_obj))->cpp_feature_1 ($val1, $val2);
> > ]"
> >
> > As far as I can tell libraries are copied from referenced projects so for
> > each project that references the Eiffel library they need to add the
> > external .lib.  It would be a nice feature to have this included
> > automatically.
> >
> >
> > On Fri, Jun 26, 2009 at 12:33 PM, Jimmy J. Johnson <boxer41a@...>wrote:
> >
> >>
> >>
> >> Thanks, I see it now.
> >>
> >> I have a library in which I set an include path and a library, but it
> >> seems to not do any c-compilation (i.e. freezing) to include it. Is this a
> >> library thing?
> >>
> >> Also, if I use the library (the ecf file) in a project must the project
> >> also set the include path and lib location?
> >>
> >> Jimmy J. Johnson
> >>
> >>
> >> --- In [hidden email]<eiffel_software%40yahoogroups.com>,
> >> "colinlema" <clemahieu@> wrote:
> >> >
> >> > A lib file can be included in Project Settings -> Target -> Advanced ->
> >> Externals -> Add Library
> >> >
> >> > --- In [hidden email]<eiffel_software%40yahoogroups.com>,
> >> "Jimmy J. Johnson" <boxer41a@> wrote:
> >> > >
> >> > > I forgot. Relating to my previous post. I have the header files and a
> >> .lib file. How do I make the project find and use the .lib file?
> >> > >
> >> > > Jimmy J. Johnson
> >> > >
> >> >
> >>
> >>  
> >>
> >
> >
>
>
> [Non-text portions of this message have been removed]
>


rfo

RE: Re: How to include .lib file?

Reply Threaded More More options
Print post
Permalink
In reply to this post by Jimmy Johnson
While the actual include file name is indeed specified in within the
external feature, it might be necessary to add to the include path (just
as you would in a Make-powered system).  The project settings
"Externals" tree is where to do that.
I have seen no need to remove the EIFGEN directory on external changes.
Simply freezing should do the trick.

   R

==================================================
Roger F. Osmond
----------------------------------------
Amalasoft Corporation
273 Harwood Avenue
Littleton, MA 01460

> -------- Original Message --------
> Subject: Re: [eiffel_software] Re: How to include .lib file?
> From: Colin LeMahieu <[hidden email]>
> Date: Fri, June 26, 2009 1:53 pm
> To: [hidden email]
> The includes are done at the method level and some times it requires
> deleting the EIFGENs directory and recompiling because it doesn't detect it
> right.
> feature
> external_feature_1 (cpp_obj: POINTER val1: INTEGER val2: POINTER)
> external
>    "C inline use %"header.h%""
> alias
> "[
>     // Cast $cpp_obj to type cpp_obj_type and make a member call to
> cpp_feature_1 passing in $val1 and $val2.
>     return ((cpp_obj_type)($cpp_obj))->cpp_feature_1 ($val1, $val2);
> ]"
> As far as I can tell libraries are copied from referenced projects so for
> each project that references the Eiffel library they need to add the
> external .lib.  It would be a nice feature to have this included
> automatically.
> On Fri, Jun 26, 2009 at 12:33 PM, Jimmy J. Johnson <[hidden email]>wrote:
> >
> >
> > Thanks, I see it now.
> >
> > I have a library in which I set an include path and a library, but it seems
> > to not do any c-compilation (i.e. freezing) to include it. Is this a library
> > thing?
> >
> > Also, if I use the library (the ecf file) in a project must the project
> > also set the include path and lib location?
> >
> > Jimmy J. Johnson
> >
> >
> > --- In [hidden email] <eiffel_software%40yahoogroups.com>,
> > "colinlema" <clemahieu@...> wrote:
> > >
> > > A lib file can be included in Project Settings -> Target -> Advanced ->
> > Externals -> Add Library
> > >
> > > --- In [hidden email]<eiffel_software%40yahoogroups.com>,
> > "Jimmy J. Johnson" <boxer41a@> wrote:
> > > >
> > > > I forgot. Relating to my previous post. I have the header files and a
> > .lib file. How do I make the project find and use the .lib file?
> > > >
> > > > Jimmy J. Johnson
> > > >
> > >
> >
> >  
> >
> [Non-text portions of this message have been removed]

Jimmy Johnson

Re: How to include .lib file?

Reply Threaded More More options
Print post
Permalink
It apears when compiling "all" classes for a library no c-compilation is done.

--- In [hidden email], <rfo@...> wrote:

>
> While the actual include file name is indeed specified in within the
> external feature, it might be necessary to add to the include path (just
> as you would in a Make-powered system).  The project settings
> "Externals" tree is where to do that.
> I have seen no need to remove the EIFGEN directory on external changes.
> Simply freezing should do the trick.
>
>    R
>
> ==================================================
> Roger F. Osmond
> ----------------------------------------
> Amalasoft Corporation
> 273 Harwood Avenue
> Littleton, MA 01460
>
> > -------- Original Message --------
> > Subject: Re: [eiffel_software] Re: How to include .lib file?
> > From: Colin LeMahieu <clemahieu@...>
> > Date: Fri, June 26, 2009 1:53 pm
> > To: [hidden email]
> > The includes are done at the method level and some times it requires
> > deleting the EIFGENs directory and recompiling because it doesn't detect it
> > right.
> > feature
> > external_feature_1 (cpp_obj: POINTER val1: INTEGER val2: POINTER)
> > external
> >    "C inline use %"header.h%""
> > alias
> > "[
> >     // Cast $cpp_obj to type cpp_obj_type and make a member call to
> > cpp_feature_1 passing in $val1 and $val2.
> >     return ((cpp_obj_type)($cpp_obj))->cpp_feature_1 ($val1, $val2);
> > ]"
> > As far as I can tell libraries are copied from referenced projects so for
> > each project that references the Eiffel library they need to add the
> > external .lib.  It would be a nice feature to have this included
> > automatically.
> > On Fri, Jun 26, 2009 at 12:33 PM, Jimmy J. Johnson <boxer41a@...>wrote:
> > >
> > >
> > > Thanks, I see it now.
> > >
> > > I have a library in which I set an include path and a library, but it seems
> > > to not do any c-compilation (i.e. freezing) to include it. Is this a library
> > > thing?
> > >
> > > Also, if I use the library (the ecf file) in a project must the project
> > > also set the include path and lib location?
> > >
> > > Jimmy J. Johnson
> > >
> > >
> > > --- In [hidden email] <eiffel_software%40yahoogroups.com>,
> > > "colinlema" <clemahieu@> wrote:
> > > >
> > > > A lib file can be included in Project Settings -> Target -> Advanced ->
> > > Externals -> Add Library
> > > >
> > > > --- In [hidden email]<eiffel_software%40yahoogroups.com>,
> > > "Jimmy J. Johnson" <boxer41a@> wrote:
> > > > >
> > > > > I forgot. Relating to my previous post. I have the header files and a
> > > .lib file. How do I make the project find and use the .lib file?
> > > > >
> > > > > Jimmy J. Johnson
> > > > >
> > > >
> > >
> > >  
> > >
> > [Non-text portions of this message have been removed]
>


Emmanuel Stapf

RE: Re: How to include .lib file?

Reply Threaded More More options
Print post
Permalink
> It apears when compiling "all" classes for a library no c-compilation is
> done.

That's correct because since there is no root class, there is no code to be
executed. Most users use this facility to ensure that their Eiffel code is valid
even for usually not reachable classes. If you want to verify that it also C
compiles correctly, you could create and compile a precompiled library instead.

Regards,
Manu

------------------------------------------------------------------------  
Eiffel Software
805-685-1006
http://www.eiffel.com       
Customer support: http://support.eiffel.com       
User group: http://groups.eiffel.com/join       
------------------------------------------------------------------------