# Loading a library from a script

**URL:** <https://root-forum.cern.ch/t/loading-a-library-from-a-script/24306>\
**Category:** ROOT\
**Created:** [April 3, 2017, 10:21pm UTC](https://root-forum.cern.ch/t/loading-a-library-from-a-script/24306 "2017-04-03T22:21:03Z")\
**Posts on this page:** 1\
**Showing post:** 14

<div class="post-metadata">

**Author:** ![ksmith](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/ksmith/32/12567_2.png) [@ksmith](https://root-forum.cern.ch/u/ksmith)\
**Post date:** [April 7, 2017, 3:30pm UTC](https://root-forum.cern.ch/t/loading-a-library-from-a-script/24306/14 "2017-04-07T15:30:02Z")

</div>

My problem here is that I am using CMake and `ROOT_GENERATE_DICTIONARY`. This macro builds a rootmapfile, but it doesn’t work correctly.

First, it needs to be manually installed, more of an annoyance than anything else:

```auto
#Install the ROOT 6 PCM and rootmap files.
if (${ROOT_VERSION} VERSION_GREATER "6.0")                                                             
   install(                                                                                            
      FILES
         ${CMAKE_CURRENT_BINARY_DIR}/libFooDict_rdict.pcm                                      
         ${CMAKE_CURRENT_BINARY_DIR}/libFooDict.rootmap                                        
      DESTINATION lib/)
endif (${ROOT_VERSION} VERSION_GREATER "6.0")

```

Secondly the rootmap file is incorrectly named for the library `libFooDict.rootmap` and top of the rootmap file reads:

```auto
[libFooDict.so]

```

This is incorrect as I am on a Mac and the extension should by `.dylib` and in addition it should not have the `Dict`. At some point I will make a small example and open a new thread with issues related to `ROOT_GENERATE_DICTIONARY` (I have a couple additional issues as well).

---

_[View the full topic](https://root-forum.cern.ch/t/loading-a-library-from-a-script/24306)._
