# how to add a library

**URL:** <https://forum.sierrawireless.com/t/how-to-add-a-library/1384>\
**Category:** Development tools\
**Created:** [June 11, 2007, 2:54pm UTC](https://forum.sierrawireless.com/t/how-to-add-a-library/1384 "2007-06-11T14:54:19Z")\
**Posts on this page:** 18\
**Page:** 1

<div class="post-metadata">

**Author:** ![ofernandez](https://avatars.discourse-cdn.com/v4/letter/o/838e76/32.png) [@ofernandez](https://forum.sierrawireless.com/u/ofernandez)\
**Post date:** [June 11, 2007, 2:54pm UTC](https://forum.sierrawireless.com/t/how-to-add-a-library/1384/1 "2007-06-11T14:54:19Z")

</div>

Hi all,

i built a library using a library project from wavecom wizard, thats is simple, but the thing is, how to add this library to a binary app project?

i am trying to do that from wmnew script aditional options but i am still on it,

can someone give some guide about that?

cheers

---

<div class="post-metadata">

**Author:** ![tomalex](https://avatars.discourse-cdn.com/v4/letter/t/71e660/32.png) [@tomalex](https://forum.sierrawireless.com/u/tomalex)\
**Post date:** [June 11, 2007, 6:26pm UTC](https://forum.sierrawireless.com/t/how-to-add-a-library/1384/2 "2007-06-11T18:26:56Z")

</div>

Hello ofernandez,

I have two other idea in my mind:

1. Simply edit the makefile of your binary project.

2. I think it can work altough i have not tried myself the following method.  
Create your libary directory in the OpenAT\Plug-in directory with the same directory structure as the other directories like WIP. Tailor the manifest.xml file for your needs. It doesn’t look complicated. Finally you can use the Open AT Wizard to link your libary.

Cheers,  
tom

---

<div class="post-metadata">

**Author:** ![Ralf\_Ebert](https://avatars.discourse-cdn.com/v4/letter/r/b38774/32.png) [@Ralf\_Ebert](https://forum.sierrawireless.com/u/Ralf_Ebert)\
**Post date:** [June 12, 2007, 5:23am UTC](https://forum.sierrawireless.com/t/how-to-add-a-library/1384/3 "2007-06-12T05:23:44Z")

</div>

Hi,

in my projects I handle my own libraries in the same way like the libraries shipped by wavecom and use the -otherlib option to include them to my binary projects …

Regards  
Ralf

---

<div class="post-metadata">

**Author:** ![ofernandez](https://avatars.discourse-cdn.com/v4/letter/o/838e76/32.png) [@ofernandez](https://forum.sierrawireless.com/u/ofernandez)\
**Post date:** [June 12, 2007, 7:58am UTC](https://forum.sierrawireless.com/t/how-to-add-a-library/1384/4 "2007-06-12T07:58:42Z")

</div>

edit the makefile can work for some generation but since the IDE enviroment is set too better use the wizard.

-otherlib try to find a plugin, it does not work for me, i do not know why, but i add the library in the following way,  
-rootlib PATHlibrary -inc PATHlibrary/inc -libpref LIBNAME

and the lib is add to the project and i can build rigth.

---

<div class="post-metadata">

**Author:** ![awneil](https://avatars.discourse-cdn.com/v4/letter/a/49beb7/32.png) [@awneil](https://forum.sierrawireless.com/u/awneil)\
**Post date:** [December 6, 2007, 6:51pm UTC](https://forum.sierrawireless.com/t/how-to-add-a-library/1384/5 "2007-12-06T18:51:30Z")

</div>

> [@ofernandez](#):
>
> -otherlib try to find a plugin, it does not work for me

I get the same. 😠

It is possible that -otherlib used to work with older versions of the Wizard, but it certainly doesn’t work with the one in Open-AT v3.12/3.13

> [@ofernandez](#):
>
> i add the library in the following way,  
> -rootlib PATHlibrary -inc PATHlibrary/inc -libpref LIBNAME

Note that there’s a catch here: you must use the “wrong” folder delimiters; ie, unix-style forward slashes, rather than the “proper” MS-style backslashes. 😠

Also, it only seems to work for me if I provide the full source project for the library - I can’t get it to work so that I can provide just the library without the source. 😠

So, is there any way to provide just the library and not its source ❓

---

<div class="post-metadata">

**Author:** ![fft](https://avatars.discourse-cdn.com/v4/letter/f/e8c25b/32.png) [@fft](https://forum.sierrawireless.com/u/fft)\
**Post date:** [December 7, 2007, 10:42am UTC](https://forum.sierrawireless.com/t/how-to-add-a-library/1384/6 "2007-12-07T10:42:49Z")

</div>

There’s an explanation of how to build the Open AT Lua library that shows you how to do this:

[wavecom.com/lua/wiki/tiki-in … structions](http://www.wavecom.com/lua/wiki/tiki-index.php?page=InstallationInstructions)

The interesting line is when configuring the binary using the lib:

> [@](#):
>
> ```
> * wmnew script options must setup link with the oatlua library: "-inc ../oatlua/itf -rootlib ../oatlua -libpref oatlua" (if oatlua is in the same directory as the sample's directory). 
> 
> ```

You need a -inc for all the header files you need, a -rootlib to indicate where the whole library is positioned, and a -libpref to give the actual name of the library.

EDIT: I was wrong, don’t read this. look down the thread for the actual method.

---

<div class="post-metadata">

**Author:** ![awneil](https://avatars.discourse-cdn.com/v4/letter/a/49beb7/32.png) [@awneil](https://forum.sierrawireless.com/u/awneil)\
**Post date:** [December 7, 2007, 10:54am UTC](https://forum.sierrawireless.com/t/how-to-add-a-library/1384/7 "2007-12-07T10:54:46Z")

</div>

> [@fft](#):
>
> You need a -inc for all the header files you need, a -rootlib to indicate where the whole library is positioned, and a -libpref to give the actual name of the library.

But won’t that inlcude the library as a full source project?

How can you add a library without exposing the full source?

---

<div class="post-metadata">

**Author:** ![fft](https://avatars.discourse-cdn.com/v4/letter/f/e8c25b/32.png) [@fft](https://forum.sierrawireless.com/u/fft)\
**Post date:** [December 7, 2007, 10:57am UTC](https://forum.sierrawireless.com/t/how-to-add-a-library/1384/8 "2007-12-07T10:57:13Z")

</div>

> [@](#):
>
> But won’t that inlcude the library as a full source project?

It won’t: sources are exposed when you use a -src option, and I didn’t. Here I only used -inc, which only imports public header files. Something you can’t avoid in C…

---

<div class="post-metadata">

**Author:** ![awneil](https://avatars.discourse-cdn.com/v4/letter/a/49beb7/32.png) [@awneil](https://forum.sierrawireless.com/u/awneil)\
**Post date:** [December 7, 2007, 11:12am UTC](https://forum.sierrawireless.com/t/how-to-add-a-library/1384/9 "2007-12-07T11:12:13Z")

</div>

> [@fft](#):
>
> It won’t: sources are exposed when you use a -src option

My experience is that, if I use the -rootlib, -inc, and -libpref options, the wizard does not add the library unless the source files are present. 😠  
If the source files are present, it then adds the library as a complete source project. 😠

But I shall have to look more closely at how LUA does it…

> [@](#):
>
> … imports public header files. Something you can’t avoid in C…

Of course!

---

<div class="post-metadata">

**Author:** ![awneil](https://avatars.discourse-cdn.com/v4/letter/a/49beb7/32.png) [@awneil](https://forum.sierrawireless.com/u/awneil)\
**Post date:** [December 7, 2007, 11:27am UTC](https://forum.sierrawireless.com/t/how-to-add-a-library/1384/10 "2007-12-07T11:27:11Z")

</div>

OK, I looked at the LUA Wiki:

> [@LUA Wiki Installation Instructions](#):
>
> wmnew script options must setup link with the oatlua library: “-inc …/oatlua/itf -rootlib …/oatlua -libpref oatlua” (if oatlua is in the same directory as the sample’s directory).

That is what I’ve tried, and it didn’t work if the -rootlib folder structure contained only the library and header but no source - the wizard completely failed to inlcude anything about the library into the VisualStudio Solution and, obviously, the builds would then fail due to unresolved references to the library. 😠

It would only work if the -rootlib folder structure contained the complete library source project - and then it would include that complete source project in the VisualStudio Solution 😠

I’m using Open-AT v3.12 - is this a fault that has been fixed in a later version of the Project Wizard?  
Or, is it just a fault when using Visual Studio?

---

<div class="post-metadata">

**Author:** ![tobias](https://avatars.discourse-cdn.com/v4/letter/t/c67d28/32.png) [@tobias](https://forum.sierrawireless.com/u/tobias)\
**Post date:** [December 7, 2007, 11:42am UTC](https://forum.sierrawireless.com/t/how-to-add-a-library/1384/11 "2007-12-07T11:42:24Z")

</div>

I haven’t tried this myself, so not sure if this works or not, but how about using the same way as the included plug-ins?  
Example folder structure and where to put libs and headers, just look at WIP.

---

<div class="post-metadata">

**Author:** ![fft](https://avatars.discourse-cdn.com/v4/letter/f/e8c25b/32.png) [@fft](https://forum.sierrawireless.com/u/fft)\
**Post date:** [December 7, 2007, 12:03pm UTC](https://forum.sierrawireless.com/t/how-to-add-a-library/1384/12 "2007-12-07T12:03:49Z")

</div>

Actually, it appears that the method I’ve given up there tries to track dependencies across the libs for recompilation, so it depends on the sources being there indeed. A “wmnew -h” (or a look at text file ${OPENAT}/IDE/IDE/${VERSION}/data/wmnew.hlp) will give you the details, namely that you should use “-extlib ${COMPLETE\_PATH\_TO\_THE\_COMPILED\_LIB\_FILE} -libname ${FULL\_NAME\_OF\_THE\_COMPILED\_LIB\_FILE} -inc ${PATH\_TO\_THE\_HEADERS}”.

(Disclaimer: I haven’t tried. I’m interested in success reports).

---

<div class="post-metadata">

**Author:** ![tobias](https://avatars.discourse-cdn.com/v4/letter/t/c67d28/32.png) [@tobias](https://forum.sierrawireless.com/u/tobias)\
**Post date:** [December 7, 2007, 12:08pm UTC](https://forum.sierrawireless.com/t/how-to-add-a-library/1384/13 "2007-12-07T12:08:18Z")

</div>

By copying the structure of the WIP lib, and replacing the libs, and editing the manifest.xml file, I’ve succeeded in getting my own lib to be selected in the Project Wizard…

---

<div class="post-metadata">

**Author:** ![awneil](https://avatars.discourse-cdn.com/v4/letter/a/49beb7/32.png) [@awneil](https://forum.sierrawireless.com/u/awneil)\
**Post date:** [December 7, 2007, 12:51pm UTC](https://forum.sierrawireless.com/t/how-to-add-a-library/1384/14 "2007-12-07T12:51:36Z")

</div>

> [@tobias](#):
>
> By copying the structure of the WIP lib, and replacing the libs, and editing the manifest.xml file, I’ve succeeded in getting my own lib to be selected in the Project Wizard…

Yes, that is what I’m also doing! 8)  
I didn’t want to mention it incase it might be “frowned upon” by Wavecom - this is clearly hacking into their territory, and not intended for mere customers… 😉

One thing to note: for the Remote-mode library, you have to rename it from the “_rte" (suffixed) name created by the build to a "rte_” (prefixed) name required for a plug-in… 😒  
(and add the version suffix, of course…)

---

<div class="post-metadata">

**Author:** ![awneil](https://avatars.discourse-cdn.com/v4/letter/a/49beb7/32.png) [@awneil](https://forum.sierrawireless.com/u/awneil)\
**Post date:** [December 11, 2007, 4:29pm UTC](https://forum.sierrawireless.com/t/how-to-add-a-library/1384/15 "2007-12-11T16:29:42Z")

</div>

> [@fft](#):
>
> -libname ${FULL\_NAME\_OF\_THE\_COMPILED\_LIB\_FILE}

But the full name of the required LIB file will differ depending on whether you’re doing a Remote build or a Target build - so how does one specify that?

---

<div class="post-metadata">

**Author:** ![awneil](https://avatars.discourse-cdn.com/v4/letter/a/49beb7/32.png) [@awneil](https://forum.sierrawireless.com/u/awneil)\
**Post date:** [December 12, 2007, 2:37pm UTC](https://forum.sierrawireless.com/t/how-to-add-a-library/1384/16 "2007-12-12T14:37:15Z")

</div>

> [@I](#):
>
> But the full name of the required LIB file will differ depending on whether you’re doing a Remote build or a Target build - so how does one specify that?

It would appear that the answer should be to use ‘libpref’; but that doesn’t work - neither Linker (VS nor GCC) finds the library file.  
(even if you manually copy the library file into the gcc/out folder) ☹

It seems that the wmnew script just ignores ‘libpref’ unless it is used in conjunction with ‘rootlib’ and ‘inc’ - but that insists on having the full source of the library! ☹

So it looks like the only options are:

1. Have a full source library;

2. Hack it to make a plug-in.

😠

---

<div class="post-metadata">

**Author:** ![awneil](https://avatars.discourse-cdn.com/v4/letter/a/49beb7/32.png) [@awneil](https://forum.sierrawireless.com/u/awneil)\
**Post date:** [December 12, 2007, 2:40pm UTC](https://forum.sierrawireless.com/t/how-to-add-a-library/1384/17 "2007-12-12T14:40:32Z")

</div>

> [@I](#):
>
> So it looks like the only options are:  
> 1. Have a full source library;  
> 2. Hack it to make a plug-in.

Even having muddled-through to this sorry state, the Remote-mode Library doesn’t link properly anyway!! 😠😠😠

Aaaaaaggghhhhh!!

Time for a separate thread…

---

<div class="post-metadata">

**Author:** ![awneil](https://avatars.discourse-cdn.com/v4/letter/a/49beb7/32.png) [@awneil](https://forum.sierrawireless.com/u/awneil)\
**Post date:** [April 1, 2008, 1:11pm UTC](https://forum.sierrawireless.com/t/how-to-add-a-library/1384/18 "2008-04-01T13:11:08Z")

</div>

> [@I](#):
>
> Time for a separate thread…

It’s here: [viewtopic.php?f=19&t=1894&p=6979](http://www.wavecom.com/modules/movie/scenes/forums/viewtopic.php?f=19&t=1894&p=6979)
