Click here to Skip to main content
15,887,596 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hello seniors,

I am new to porting. I just wanted to ask that how should we proceed porting of a c++ code for Linux to a C++ code for wince.
Do we need to just replace the header files and the library functions to do so?
If yes can somebody provide me with a link that specifies the subsequent header file in wince for unix code..
Plz reply
Posted

IMHO What you are asking is correct and incorrect at the same time...

Let me explain:
Do we need to just replace the header files and the library functions to do so?
Yes, you will need to change whatever is interacting with the OS, mainly functions that are working towards the graphical objects if there are any in your app.

If yes can somebody provide me with a link that specifies the subsequent header file in wince for unix code..
Well, no, there can be tons of functions that you will need to change, summarizing them in one link... seems extremely difficult to me...

I've never done that before but a small google search has given me tons of results (mostly from windows to linux and not what you are interested in) but in all the cases the constraints and specifics are different. If you are working with sockets, windows, ... you will have different needs...

I think your problem here will be a matter of patience and good design habilities: checking what is not 100% compatible and trying to figure out which functions and libraries you should use. And a good amount of compiling time.

Good luck with that.
 
Share this answer
 
If your project is small and you are not planning to port it to other platforms in the future then it works like you mentioned in your question. If you want to port your code by keeping it linux compatible and maybe you want to port it to a lot of other platforms in the future then you should do it like this: First just refactorize the linux program. You should do that by putting crossplatform interfaces between the crossplatform and platform independent part of your program. You can do that in small steps and you can always test if the linux program still works or not. Making the whole porting in a big program and then parying for not too many crashes is not a good strategy. After creating the crossplatform interfaces (like ISocket, IFilesystem, IFileStream, ...) you can write the platform dependent implementation of these interfaces on the other platform. you can still make a lot of bugs and it might be a big piece of code to write, but you can write small tests for each interfaces and at least the crossplatform part of your code is operable for sure because you already tested it on the old platform while you were introducing the interfaces. This is true for proting from any platform to any other platform. It might make sense to specify platforms like linux to WinCe only if we are talking about a specific library like sockets, but it isnt always important even in those cases. Another thing that can make porting hard is different hardware limitations (slower cpu, less memory, ...), but in case of relatively simple programs that dont push the limits of the hardware this isnt so important. In case of hardware limitations sometimes you have to use totally different architectural solutions in your program. But again, in case of general user progs this isnt the case.
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900