librelist archives

« back to archive

New Element - Include and LD paths

New Element - Include and LD paths

From:
Qasim Maqbool
Date:
2014-05-19 @ 07:12
Hi,

I am running into problems when specifying the paths to include for headers
and lib files for a new element. Here is what I did:

I put my element source files in "click/elements/local" and added the path
to my header files by using: make -I $(my_include_path). This does not seem
to work and I had to manually add this in my element source file like this:
#include "$(my_include_path)/file.h"

This approach did result in successful compilation, but I would really
prefer to do this in a better way. Similarly, when I specify the element
library files, the linker is unable to find them and returns an error. This
is the statement I use:

ELEMENT_LIBS((-L$(MY_LIB_PATH) -lethdev.a))

Can anyone point out where I am going wrong? Thanks.

--
Qasim

Re: [click] New Element - Include and LD paths

From:
Eddie Kohler
Date:
2014-05-19 @ 14:51
Can you please send the exact compile errors you get with ELEMENT_LIBS?

On Mon, May 19, 2014 at 3:12 AM, Qasim Maqbool <qasim.maqbool@gmail.com> wrote:
> Hi,
>
> I am running into problems when specifying the paths to include for headers
> and lib files for a new element. Here is what I did:
>
> I put my element source files in "click/elements/local" and added the path
> to my header files by using: make -I $(my_include_path). This does not seem
> to work and I had to manually add this in my element source file like this:
> #include "$(my_include_path)/file.h"
>
> This approach did result in successful compilation, but I would really
> prefer to do this in a better way. Similarly, when I specify the element
> library files, the linker is unable to find them and returns an error. This
> is the statement I use:
>
> ELEMENT_LIBS((-L$(MY_LIB_PATH) -lethdev.a))
>
> Can anyone point out where I am going wrong? Thanks.
>
> --
> Qasim

Re: [click] New Element - Include and LD paths

From:
Qasim Maqbool
Date:
2014-05-22 @ 05:19
Turns out, it was an issue with linking the correct libraries. Not a
problem per-se with Click.

Thanks anyways.


On Mon, May 19, 2014 at 7:51 PM, Eddie Kohler <ekohler@gmail.com> wrote:

> Can you please send the exact compile errors you get with ELEMENT_LIBS?
>
> On Mon, May 19, 2014 at 3:12 AM, Qasim Maqbool <qasim.maqbool@gmail.com>
> wrote:
> > Hi,
> >
> > I am running into problems when specifying the paths to include for
> headers
> > and lib files for a new element. Here is what I did:
> >
> > I put my element source files in "click/elements/local" and added the
> path
> > to my header files by using: make -I $(my_include_path). This does not
> seem
> > to work and I had to manually add this in my element source file like
> this:
> > #include "$(my_include_path)/file.h"
> >
> > This approach did result in successful compilation, but I would really
> > prefer to do this in a better way. Similarly, when I specify the element
> > library files, the linker is unable to find them and returns an error.
> This
> > is the statement I use:
> >
> > ELEMENT_LIBS((-L$(MY_LIB_PATH) -lethdev.a))
> >
> > Can anyone point out where I am going wrong? Thanks.
> >
> > --
> > Qasim
>

Re: [click] New Element - Include and LD paths

From:
Eddie Kohler
Date:
2014-05-23 @ 19:42
OK, thanks for the update!


On Thu, May 22, 2014 at 1:19 AM, Qasim Maqbool <qasim.maqbool@gmail.com> wrote:
> Turns out, it was an issue with linking the correct libraries. Not a problem
> per-se with Click.
>
> Thanks anyways.
>
>
> On Mon, May 19, 2014 at 7:51 PM, Eddie Kohler <ekohler@gmail.com> wrote:
>>
>> Can you please send the exact compile errors you get with ELEMENT_LIBS?
>>
>> On Mon, May 19, 2014 at 3:12 AM, Qasim Maqbool <qasim.maqbool@gmail.com>
>> wrote:
>> > Hi,
>> >
>> > I am running into problems when specifying the paths to include for
>> > headers
>> > and lib files for a new element. Here is what I did:
>> >
>> > I put my element source files in "click/elements/local" and added the
>> > path
>> > to my header files by using: make -I $(my_include_path). This does not
>> > seem
>> > to work and I had to manually add this in my element source file like
>> > this:
>> > #include "$(my_include_path)/file.h"
>> >
>> > This approach did result in successful compilation, but I would really
>> > prefer to do this in a better way. Similarly, when I specify the element
>> > library files, the linker is unable to find them and returns an error.
>> > This
>> > is the statement I use:
>> >
>> > ELEMENT_LIBS((-L$(MY_LIB_PATH) -lethdev.a))
>> >
>> > Can anyone point out where I am going wrong? Thanks.
>> >
>> > --
>> > Qasim
>
>