Problems using C++ with Eclipse

2 views
Skip to first unread message

James

unread,
Apr 26, 2008, 6:30:02 PM4/26/08
to Virtual Cogs
Hi,

I have been able to use the C standalone examples with Eclipse and get
things going.

However, when I switch to C++ I just cannot get it to work with
objects. I can build it using C++ , but as soon as I try to
instantiate an Object or declare a virtual function it just won't
build.

I assume I am missing some linking parameter or something. Has anyone
used C++ to program the virtual cog? What I am really after is a
makefile that is setup for C++ and ideally eclipse.

Dan Foisy

unread,
Apr 29, 2008, 10:23:25 AM4/29/08
to virtu...@googlegroups.com
Hello James,

C++ requires a more involved startup file than regular old C, as well as
a number of other functions (e.g. dynamic memory allocation to support
new). I have never seen a standalone package of functionality to
support C++ on ARM. If you wish to use C++, I would recommend using Linux.

Dan

--
Daniel Foisy
Virtual Cogs Embedded Systems Inc.
Unit 4, 5694 Highway 7 East, Suite 311
Markham, Ontario, Canada L3P 1B4
www.virtualcogs.com
416-238-2231

"Your future is modular"

James

unread,
Apr 29, 2008, 5:01:11 PM4/29/08
to Virtual Cogs
Hmm.. Ok.

I have a C++ library I need to bind to the camera output, so it seems
I either have write some linux device drivers so I can use C++ or port
the needed parts of the C++ library to C and work in standalone mode.
Now, I have no idea how hard or easy to create linux device drivers
but since they don't exist yet I expect it is on the harder side. I
have seen mention of a memory mapped camera device driver in this list
but no code is available.

So i suppose I need to create linux drivers for
- I2C access - To be able to drive the camera registers
- Camera module - To capture the image via DMA
- UART - In linux mode can I access the UART using /dev/ttyS0 or
similar as is?

Any feel for how long it takes to write device drivers like these for
a good C programmer but with no linux device driver experience. I am
after some sort of ball park estimate for writing the linux device
drivers timewise to choose between C++/linux & C/Standalone?

Regards,
James
> "Your future is modular"- Hide quoted text -
>
> - Show quoted text -

Dan Foisy

unread,
Apr 29, 2008, 7:47:16 PM4/29/08
to virtu...@googlegroups.com
James,

Yes, you can access the uart as /dev/ttyS0. Assuming you don't need to
share the I2C resources with another task, it wouldn't take too long to
write that driver (or to use the existing GPIO driver) - essentially,
you can take the GPIO driver code and modify that appropriately, say
under a week or so. I've got an i.MX31 V4L driver for the camera that
works but am not sure how much effort it would be to port to the i.MX21.

Dan

Reply all
Reply to author
Forward
0 new messages