Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

make threadx compiles with c++ compilers #408

Open
rahmanih opened this issue Sep 5, 2024 · 1 comment
Open

make threadx compiles with c++ compilers #408

rahmanih opened this issue Sep 5, 2024 · 1 comment
Labels
feature New feature or enhancement request

Comments

@rahmanih
Copy link

rahmanih commented Sep 5, 2024

Hi,
When compiling threadx with g++ compilers, some errors are thrown.
this request is about fixing all those errors.

PS: attached the error log when compilinga project using arm-none-g++.(not all files where compiled in this project).
build_errors.txt

@rahmanih rahmanih added the feature New feature or enhancement request label Sep 5, 2024
@hwmaier
Copy link

hwmaier commented Sep 6, 2024

It appears you are using g++ to compile ThreadX code. ThreadX is written in C not C++, so try using gcc instead of g++.

In case you want to compile C++ code with ThreadX header files, set the compiler flag -fpermissive.

I tend to add the following line to my CMakefiles for mixed language (C/C++)projects:

add_compile_options($<$<COMPILE_LANGUAGE:CXX>:-fpermissive>) # Allow passing const char * to char * in C++

I hope that helps to overcome your compilation issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature or enhancement request
Projects
None yet
Development

No branches or pull requests

2 participants