# Is there any serial port library suport Cling on windows?

**URL:** <https://root-forum.cern.ch/t/is-there-any-serial-port-library-suport-cling-on-windows/41254>\
**Category:** Newbie\
**Created:** [September 2, 2020, 11:12am UTC](https://root-forum.cern.ch/t/is-there-any-serial-port-library-suport-cling-on-windows/41254 "2020-09-02T11:12:30Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Zhenhao](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/zhenhao/32/23177_2.png) [@Zhenhao](https://root-forum.cern.ch/u/Zhenhao)\
**Post date:** [September 2, 2020, 11:12am UTC](https://root-forum.cern.ch/t/is-there-any-serial-port-library-suport-cling-on-windows/41254/1 "2020-09-02T11:12:30Z")

</div>

Hello,

I try to communicate to COM port on windows. I find there are some c++ library for serial communication. I try some of them but neither can work in Cling. For example the " [wjwwood](https://github.com/wjwwood/serial) serial" in the github and another [header-only library](https://medium.com/manash-en-blog/serial-communication-with-an-arduino-using-c-on-windows-d08710186498#.f94efw74b) .

For the " [wjwwood](https://github.com/wjwwood/serial) serial", my problem is that I don’t know how to use the compiled serial.lib file (using vs2019) in Cling. Actually I can use it in Ubuntu system easily. For the header-only library, my problem is that Cling linker ask for shared library.

Could you please give me a very basic example to realize serial communication in Cling on windows? My ROOT version is 6.22.

Thank you very much!

---

<div class="post-metadata">

**Author:** ![bellenot](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/bellenot/32/29217_2.png) [@bellenot](https://root-forum.cern.ch/u/bellenot)\
**Post date:** [September 2, 2020, 11:17am UTC](https://root-forum.cern.ch/t/is-there-any-serial-port-library-suport-cling-on-windows/41254/2 "2020-09-02T11:17:33Z")

</div>

You will have to write your own application and link with `serial.lib` and the ROOT libraries, I’m afraid there is no other way…

---

<div class="post-metadata">

**Author:** ![Zhenhao](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/zhenhao/32/23177_2.png) [@Zhenhao](https://root-forum.cern.ch/u/Zhenhao)\
**Post date:** [September 2, 2020, 11:20am UTC](https://root-forum.cern.ch/t/is-there-any-serial-port-library-suport-cling-on-windows/41254/3 "2020-09-02T11:20:57Z")

</div>

Do you mean it’s impossible to use serial communication in Cling interpreter in the interavtive way? I have to compile the code?

---

<div class="post-metadata">

**Author:** ![bellenot](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/bellenot/32/29217_2.png) [@bellenot](https://root-forum.cern.ch/u/bellenot)\
**Post date:** [September 2, 2020, 11:23am UTC](https://root-forum.cern.ch/t/is-there-any-serial-port-library-suport-cling-on-windows/41254/4 "2020-09-02T11:23:27Z")

</div>

Well, yes, as far as I know… But maybe @vvassilev can think of another way

---

<div class="post-metadata">

**Author:** ![Zhenhao](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/zhenhao/32/23177_2.png) [@Zhenhao](https://root-forum.cern.ch/u/Zhenhao)\
**Post date:** [September 2, 2020, 11:38am UTC](https://root-forum.cern.ch/t/is-there-any-serial-port-library-suport-cling-on-windows/41254/5 "2020-09-02T11:38:06Z")

</div>

Thank you very much! Forgive me to leave this post still open. I really hope there will be some positive suprise.🙂
