> For the complete documentation index, see [llms.txt](https://developer.magtek.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://developer.magtek.com/sdks-and-tools/universal-sdk-documentation/linux/how-to-set-up-the-mtusdk-libraries.md).

# How to Set Up the MTUSDK Libraries

### How to Install Dependencies

1. Install libjsoncpp-dev for json api

{% code overflow="wrap" %}

```
sudo apt install libjsoncpp-dev
```

{% endcode %}

2. Install libcurl for http/https access.

{% code overflow="wrap" %}

```
sudo apt install libcurl4-openssl-dev
```

{% endcode %}

3. Install restclient-cpp.

{% code overflow="wrap" %}

```
git clone https://github.com/mrtazz/restclient-cpp 
```

{% endcode %}

{% code overflow="wrap" %}

```
sudo apt install libtool
```

{% endcode %}

{% code overflow="wrap" %}

```
cd restclient-cpp
```

{% endcode %}

{% code overflow="wrap" %}

```
./autogen.sh
```

{% endcode %}

(installs to usr/local/lib)

{% code overflow="wrap" %}

```
sudo make install
```

{% endcode %}

4. Install libusb.

{% code overflow="wrap" %}

```
sudo apt-get install libusb-1.0-0-dev
```

{% endcode %}

5. Install lissl-dev for base64 encoding/decoding.

{% code overflow="wrap" %}

```
sudo apt-get install libusb-1.0-0-dev
```

{% endcode %}

6. Cryptopp from [<mark style="color:red;">**https://github.com/weidai11/cryptopp**</mark>.](https://github.com/weidai11/cryptopp) Cryptopp is automatically downloaded during the make build of mtusdk static library. Cryptopp is a static library to implement hash sha256.

### How to Build <a href="#id-2.2_how_to_build" id="id-2.2_how_to_build"></a>

#### **Build libraries**

1. To build libraries:
   1. Extract mtusdk\_linux.zip.
   2. Run the make command.
2. The libraries are built and sent to the mtusdk\_test folder.

* libmtmms.so (shared object)
* libmtscra.so (shared object)
* libmtusdk.a (static library)

#### **Rebuild MTUSDK Test Console**

1. To rebuild the MTUSDK Test app after any modifications to main.cpp.
   1. Navigate to mtusdk\_test folder.
   2. Modify main.cpp.
   3. Run the make command for DynaFlex devices.

{% code overflow="wrap" %}

```
make -f makefile.mms
```

{% endcode %}

2. Run the make command for DynaFlex devices.

{% code overflow="wrap" %}

```
make -f makefile
```

{% endcode %}

#### **Run the MTUSDK Test Console**

1. To run the MTUSDK Test app:

{% code overflow="wrap" %}

```
sudo ./mtusdk_test.mms
```

{% endcode %}

2. The response is similar as below:

{% code overflow="wrap" %}

```
SDK version 118 
    Model:
    Name: B62CA5F0
<- (Connection State) connected
<- (Operation Status) operation_done,0000D101,Operation Done,00000000
<- (Device Response) AA... 
    Serial Number: B62CA5F0
Select an operation :
1.	Transaction (Quick Chip)
2.	Transaction (Full)
3.	Send configuration file
4.	Update firmware
5.	Display a message
6.	Send an image and display
9. Enable event driven transaction
a. Disable event driven transaction
0. Quit

```

{% endcode %}

3. If the command is not successful but is similar to:

{% code overflow="wrap" %}

```
librestclient-cpp.so cannot open shared object file no such file or directory.
```

{% endcode %}

then send the following command to link the shared object file. Retry after this.

{% code overflow="wrap" %}

```
sudo /sbin/ldconfig
```

{% endcode %}

4. For details on running and modifying the test console see <mark style="color:red;">**UNIVERSAL SDK FOR MMS DEVICES TEST CONSOLE MANUAL ( LINUX )**</mark>       &#x20;


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://developer.magtek.com/sdks-and-tools/universal-sdk-documentation/linux/how-to-set-up-the-mtusdk-libraries.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
