# Libtorch build does not work in MFC environment

**URL:** <https://discuss.pytorch.org/t/libtorch-build-does-not-work-in-mfc-environment/71215>\
**Category:** Uncategorized\
**Created:** [February 27, 2020, 12:39am UTC](https://discuss.pytorch.org/t/libtorch-build-does-not-work-in-mfc-environment/71215 "2020-02-27T00:39:25Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![HwanUng\_Lee](https://discuss.pytorch.org/user_avatar/discuss.pytorch.org/hwanung_lee/32/20987_2.png) [@HwanUng\_Lee](https://discuss.pytorch.org/u/HwanUng_Lee)\
**Post date:** [February 27, 2020, 12:39am UTC](https://discuss.pytorch.org/t/libtorch-build-does-not-work-in-mfc-environment/71215/1 "2020-02-27T00:39:25Z")

</div>

Hello.  
I took the model from the console to the Libtorch and tested it using VS2015.

However, in the MFC environment, the inclusion of “torch\script” in the header results in an error.

I tested it in the console environment again for comparison, but I found it working properly on the console.

Is Libtorch not available in MFC environments?

- Visual Studio 2015
- CUDA = 10.0
- Libtorch = [https://download.pytorch.org/libtorch/cu101/libtorch-win-shared-with-deps-1.4.0.zip](https://download.pytorch.org/libtorch/cu101/libtorch-win-shared-with-deps-1.4.0.zip)

 ![캡처](https://discuss.pytorch.org/uploads/default/original/3X/7/c/7cf885b5ebbd6fc8bf41b8e79ada1b3621c2fea0.jpeg)

---

<div class="post-metadata">

**Author:** ![Valerio\_1](https://discuss.pytorch.org/user_avatar/discuss.pytorch.org/valerio_1/32/31470_2.png) [@Valerio\_1](https://discuss.pytorch.org/u/Valerio_1)\
**Post date:** [December 2, 2021, 5:33pm UTC](https://discuss.pytorch.org/t/libtorch-build-does-not-work-in-mfc-environment/71215/2 "2021-12-02T17:33:38Z")

</div>

Hi.  
I have the same problem, I need to use PyTorch C++ API in an existing MFC application. No problem in a console application, but somehow MFC seems to be incompatible with the PyTorch C++ API.  
Did you manage to solve the problem? Any idea?  
Many thanks and kind regards,  
VALERIO
