Overview
Features
Download
Documentation
Community
Add-Ons & Services

Use of POCO libary within C code?

A general discussion forum.

Use of POCO libary within C code?

Postby rdnaik » 22 Apr 2010, 15:16

Given few embedded C applications that use threads, files, network protocols and other such specificities of the OS and the compiler libaries, I am required to make them OS independent (atleast wrt popular OSes like Windows and Linux). I am thinking of using POCO, as POCO promises to be a cross-platform library, and would make the applications easily portable (in the best case, just a re-compile).
One possibility is to "migrate" the OS-specific calls in the C applications to equivalent POCO library calls. Without really re-designing the C code, is this approach feasible? Ofcourse, this would mean instantiation of necessary objects at appropriate place in the C code, maybe affecting the 'understandability' of the C code... Has anybody tried similar approach? What could be the potential pitfalls of this?
rdnaik
 
Posts: 2
Joined: 22 Apr 2010, 14:46

Re: Use of POCO libary within C code?

Postby aderouineau » 23 Apr 2010, 20:53

I'd say that it's pretty hard to mix C and C++ like that, especially for complex projects.

It might take as much time trying to integrate POCO than to rewrite your code...
aderouineau
 
Posts: 163
Joined: 18 May 2009, 17:38

Re: Use of POCO libary within C code?

Postby rdnaik » 17 May 2010, 14:45

ThanX.
While it is true that the code is complex (the code base is few million lines of C code with atleast 20-25% code using OS specific calls), I thought it would be easier to "migrate" the OS-specific calls to use POCO rather than re-write the whole code...
Using POCO from C code will mean having the calls placed in a CPP file, and having the function headers (containing the calls) enclosed in extern 'C'. Do you see any more complexities? Any architecture-related issues? Any issues with when to free objects?
rdnaik
 
Posts: 2
Joined: 22 Apr 2010, 14:46

Re: Use of POCO libary within C code?

Postby aderouineau » 21 May 2010, 04:29

You might encounter very-hard-to-solve (or perhaps unsolvable) linking issues if you mix up a large C project with a fairly large c++ library. I guess it would depend on what components you use. You can always try with simple uses of Foundation only, and go from there.

PS: Sorry for the late reply
aderouineau
 
Posts: 163
Joined: 18 May 2009, 17:38


Return to General Discussion

Who is online

Users browsing this forum: No registered users and 2 guests