Include error in MCU Xpresso IDE

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Include error in MCU Xpresso IDE

5,146 Views
Prajwal123
Contributor II

Hi. I am trying to compile a C++ project. I have included all the files in the includes list. Even then I am getting error saying tx_port.h file is neither a file or directory. I am using a GNU C++ compiler. The same application in C is compiled successfully. But using C++ compiler it is failing, What can be the reason?

0 Kudos
Reply
14 Replies

5,041 Views
Prajwal123
Contributor II

Yes. I selected it

 

0 Kudos
Reply

5,037 Views
Harry_Zhang
NXP Employee
NXP Employee

Hi @Prajwal123 

Can you share the smallest project that contains errors? You can delete other codes.

BR

Harry

0 Kudos
Reply

4,984 Views
Prajwal123
Contributor II

Hi @Harry_Zhang . were you able to build the project in your system?

0 Kudos
Reply

4,885 Views
Harry_Zhang
NXP Employee
NXP Employee

Hi @Prajwal123 

I think you can import the SDK netx_duo example, and adds your code.

If you want to add C++ code, you need add <nature>org.eclipse.cdt.core.ccnature</nature> in .project.

Harry_Zhang_0-1733906541418.png

BR

Harry

0 Kudos
Reply

4,861 Views
Prajwal123
Contributor II

I tried this, but there are other errors, attached is the error log,

0 Kudos
Reply

4,837 Views
Harry_Zhang
NXP Employee
NXP Employee

Hi @Prajwal123 

I'm sorry, I also get errors when compiling. Although commenting on _tx_thread_stack_error_handler  can solve compilation problems, I don't think it solves the fundamental problem. I have reported this issue to the IDE team and hope they can resolve it as soon as possible.

BR

Harry

0 Kudos
Reply

4,815 Views
Prajwal123
Contributor II

I resolved this issue by using the extern “c” at right places in my application code. But I still have problem while creating a new project and using .cpp files in that. 
If you get it, please let me know the steps for it.

4,915 Views
Harry_Zhang
NXP Employee
NXP Employee

Hi @Prajwal123 

My error is the same as yours. I am currently investigating this issue.

BR

Harry

0 Kudos
Reply

5,029 Views
Prajwal123
Contributor II
Sure
0 Kudos
Reply

4,996 Views
Prajwal123
Contributor II

Please find the attached project

0 Kudos
Reply

5,069 Views
Harry_Zhang
NXP Employee
NXP Employee

Hi @Prajwal123 

You imported the project from the SDK, and then added your C++ file, the compilation did not succeed?

BR

Harry

0 Kudos
Reply

5,065 Views
Prajwal123
Contributor II
I did not import the project from the sdk. I created new project and added the files
0 Kudos
Reply

5,049 Views
Prajwal123
Contributor II
I have created a new project with .cpp file and compiled. It is not detecting the tx_port.h even though I have included its's path in the includes for both compilers
0 Kudos
Reply

5,041 Views
Harry_Zhang
NXP Employee
NXP Employee

Hi @Prajwal123 

When you create a new project, did you select C++ Project ?

Harry_Zhang_0-1733736912557.png

BR

Harry

 

0 Kudos
Reply