AJTC Arduino files.cpp

asked 2014-05-14 02:23:34 -0700

this post is marked as community wiki

This post is a wiki. Anyone with karma >75 is welcome to improve it.

Hi everyone, I'm learning about Alljoyn for arduino. I have just a basic question.Follow the AJTC document, we have all Arduino applications must be developped in C. But I observed that we had files .cpp in the Arduino Alljoyn examples. I don't really understand this point. Why do we have the files .cpp in a C project? I'm looking forward for your answers. Thank very much for advance,

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted

answered 2014-05-14 16:10:01 -0700

mquon gravatar image

Hi, basically it's because the AllJoyn Thin Library code presently has some C++-isms (ie. non-C89 compliant code), and also because of how the Arduino IDE invokes gcc or g++; the Arduino IDE tries to call gcc and doesn't let you override it with g++. The workaround was to rename the files as cpp files (which is also done by the SConscript for the AllJoyn Thin Library code in the output build directory).

There is a JIRA issue open to resolve the non-C89 compliant code issues - https://jira.allseenalliance.org/browse/ASACORE-82 .

edit flag offensive delete publish link more


Thanks very much for your answer

congtam ( 2014-05-19 06:03:08 -0700 )edit

No problem - could you please mark the answer as correct by clicking the check box? Thanks!

mquon ( 2014-05-22 15:38:47 -0700 )edit
Login/Signup to Answer

Question Tools

1 follower


Asked: 2014-05-14 02:23:34 -0700

Seen: 79 times

Last updated: May 14 '14