# Try using C++ interface but files dosen't compile well

**URL:** <https://swi-prolog.discourse.group/t/try-using-c-interface-but-files-dosent-compile-well/5528>\
**Category:** Tools\
**Created:** [June 21, 2022, 11:22am UTC](https://swi-prolog.discourse.group/t/try-using-c-interface-but-files-dosent-compile-well/5528 "2022-06-21T11:22:37Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![ElhaiAgassi](https://yyz2.discourse-cdn.com/free1/user_avatar/swi-prolog.discourse.group/elhaiagassi/32/4488_2.png) [@ElhaiAgassi](https://swi-prolog.discourse.group/u/ElhaiAgassi)\
**Post date:** [June 21, 2022, 11:22am UTC](https://swi-prolog.discourse.group/t/try-using-c-interface-but-files-dosent-compile-well/5528/1 "2022-06-21T11:22:37Z")

</div>

Hi, I’m not sure if I’m doing it well - I try to compile CPP file to prolog file using the swipl library.  
But after compiling with the command: `swipl-ld -gcc -o output myfile.cpp`  
the output file is from type `output.so` and it doesn’t work when I consult it. doesn’t also work to define ` -o output.pl`

what I’m doing wrong?  
Generally, I think it will be very helpful to have a tutorial for beginners step by step  
Thank you
