cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
3daerospace
Newbie
Newbie
1,720 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
williamk
Xilinx Employee
Xilinx Employee
1,502 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

7 Replies
jasonwu
Moderator
Moderator
1,652 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
florentw
Moderator
Moderator
1,625 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.~**
williamk
Xilinx Employee
Xilinx Employee
1,607 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.
k_iso
Visitor
Visitor
1,524 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
williamk
Xilinx Employee
Xilinx Employee
1,503 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

j1s1e1
Observer
Observer
1,397 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
andyk
Visitor
Visitor
854 Views
Registered: ‎07-15-2019

I am having the same issue but with a twist..
I can go through the MENU steps you mention to create the application project and can get it to compile my sources..
but if i try to create the application project via xsct.. It does not recognize the parts and says there is nothing to build
I tried specifying the template "Empty Application" and tried with no template  and get the same results.
No Debug folder is created (with no template it looks like a "hello world" application is created.
Here is the command I'm trying to use
xsct%  app create -name ANDYYYYY -domain XYX_domain -template {Empty Application} os standalone -lang c++ -arch 64

if I go through the menu and pick the "Empty Application (C++) it works fine

0 Kudos