cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Highlighted
Newbie
Newbie
551 Views
Registered: ‎06-15-2020

Creating a C++ application in Vitis

Jump to solution

I have a problem with Vitis.

when I creat a C application it generate some files like : platform.h, platfor.c,...

But when I create it with C++ it doesn't and it generate an error with the debug folder.

0 Kudos
1 Solution

Accepted Solutions
Highlighted
Xilinx Employee
Xilinx Employee
333 Views
Registered: ‎05-21-2013

I'm still working through some of these C++ configurations myself. I'm looking into finding a decent tutorial or documentation on this topic.

In the meantime, try this:

1) build a platform project for your hardware.

2) right-click the system project you want to add the application project to

3) Select New > Add Application Project - this opens the application project details dialog opens

4) add the application project name and select the domain to associate this application with

5) Select Empty Application (C++)

6) add the sources and compile them.

I was able to run the application under QEMU.

Let me know if this does it for you. If so, please mark this as a "solution" and feel free to give a "Kudos". Thanks!

View solution in original post

6 Replies
Highlighted
Moderator
Moderator
483 Views
Registered: ‎03-27-2013

Hi @3daerospace ,

 

Are you using Alveo platfom or MPSoC platform.

For Alveo you could add a lot of Vitis accel example templates if necessary.

Best Regards,
Jason
-----------------------------------------------------------------------------------------------
Please mark the Answer as "Accept as solution" if the information provided is helpful.

Give Kudos to a post which you think is helpful and reply oriented.
-----------------------------------------------------------------------------------------------
0 Kudos
Highlighted
Moderator
Moderator
456 Views
Registered: ‎11-09-2015

Hi @3daerospace 

You can get the files which are used with the c template and use it with the c++ blank template. This is working fine for me


Florent
Product Application Engineer - Xilinx Technical Support EMEA
**~ Don't forget to reply, give kudos, and accept as solution.~**
Highlighted
Xilinx Employee
Xilinx Employee
438 Views
Registered: ‎05-21-2013
One item that has changed is that the Vitis IDE no longer allows you to select C++ as the compiler and therefore the C++ templates are not available.
When you get to the templates page, select the "Empty Application (C++)" this should cause the proper compiler to be selected.
The C language templates are compatible with the C++ compiler (as C++ is a "super-set" of C) so any of the Xilinx templates or your own C code can be imported.
Does this help? If so, a Kudo or accepted solution would be greatly appreciated! If not, let me know what I can do to help clarify this for you.
Highlighted
Visitor
Visitor
355 Views
Registered: ‎07-04-2020

Hello!

@williamk, I would be very grateful if you could help with a follow on question from this? I have been creating my own user application templates and I can select them when creating an application project using the C compiler.  However when I try to make a C++ project (i.e. C++ compiler selected) I cannot see my user application templates in the available list.  Only the "Empty Application" template is present.  My user application templates are stored in '<my_repo>/sw_apps' (<my_repo> software repository has been added).  Do user templates for C++ applications need to be stored some where different to templates for C applications? I am trying to figure out why I cannot use my own user templates for C++ applications!

 

Thank you for any information you can provide!

Regards,

K

0 Kudos
Highlighted
Xilinx Employee
Xilinx Employee
334 Views
Registered: ‎05-21-2013

I'm still working through some of these C++ configurations myself. I'm looking into finding a decent tutorial or documentation on this topic.

In the meantime, try this:

1) build a platform project for your hardware.

2) right-click the system project you want to add the application project to

3) Select New > Add Application Project - this opens the application project details dialog opens

4) add the application project name and select the domain to associate this application with

5) Select Empty Application (C++)

6) add the sources and compile them.

I was able to run the application under QEMU.

Let me know if this does it for you. If so, please mark this as a "solution" and feel free to give a "Kudos". Thanks!

View solution in original post

Highlighted
Observer
Observer
228 Views
Registered: ‎03-05-2010

I ran into the same problem and spent an hour or so trying to figure out what setting to change.  It did occur to me to use the blank c++ template, but I assumed there would be a more efficient solution.  While this is a workaround, I hope that moving forward a simpler solution to adding c++ files to a project created with a c template will be provided.  The obvious detect c++ files and invoke the c++ compiler would be best, but a check box somewhere would work.

I can understand not wanting to provide duplicate templates, but creating a second project and moving files seems like an inefficient solution to such a simple problem.

Thanks,

James

0 Kudos