Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

porting apps written in VisC++

Status
Not open for further replies.

ADoozer

Programmer
Dec 15, 2002
3,487
AU
hopefully avoiding the response in thread116-516675

how does one go about porting an application written in Visual C++ to be compatible with linux!

is there a forum here dedicated to this matter?? (i couldnt find one)

any help sites, tutorials, info is greatly appreciated.

thnx in advance

If somethings hard to do, its not worth doing - Homer Simpson
 
Windows API is just that, Windows API. It does not work on Linux because it is unique to Windows, and you cannot get around this unless you get libraries that implement all of the Windows APIs in terms of Linux APIs. If you write code using only standard libraries, just recompile the code on a computer running the other OS and you'll be fine. If you want to write cross platform application code, you might try Java or the .NET framework. I know there are at least two implementations of the .NET framework on Linux (but you really wouldn't be able to expect anyone to have them preinstalled).
 
Depends whether this is a retrospective question or not.

If you're looking to write some new cross-platform code and you want to avoid some porting issues, then perhaps you could consider one of these API's to make the UI portable.
There are others like these by the way.

Or perhaps this for something you've already got

--
 
to be honest its curiosity with the possibility of trying to port an existing app.

im just information gathering at the moment.

will take a look at the sites.

thnx

If somethings hard to do, its not worth doing - Homer Simpson
 
If you're calling any Windows APIs you'll need to put then in #ifdef blocks like this:
Code:
#ifdef WIN32
   // Windows specific code here.
#else
   // UNIX code here.
#endif
and you'll need to come up with some equivalent code in standard C++ to do what the Windows code did.

You'll need to do that same #ifdef trick or create a function to convert paths to '\\' to '/'.

File user permissions also need to be taken into account if your application creates any files.

You'll probably also need to create a Makefile.

Those are the main porting issues I can think of.
 
> You'll need to do that same #ifdef trick or create a function to convert paths to '\\' to '/'.

Not needed - you can simply convert all '\\' to '/' - they work under Windows too.
 
I've heard that too, but I get errors when I use / instead of \ on the command line.
Is it only inside a program that you can do that?
 
hi thanks again.

hmm well after looking into this matter, i have decided the task is to much.

(there is a linux version of the code in question, however it hasnt been released, so ill be working on win32 mods only)

thnx again.. made good reading

If somethings hard to do, its not worth doing - Homer Simpson
 
> I've heard that too, but I get errors when I use / instead of \ on the command line.
> Is it only inside a program that you can do that?

In command line not - '/' supposed to be a program key prefix.
It is valid only in file names inside of C++ - fopen(), CreateFile() etc. C initially came from Unix, so Unix name conventions were preserved then.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top