Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Transfering Borland C++ to XTools



On Aug 25, 2004, at 6:41 PM, Nico Christie wrote:

Hello, this is my first post! So hi to everyone!

Hi!

I have just aquired XTools and I wanted to know what options (if any) I
should choose when creating a new proyect so that I can use code allready
written, but for Borland's C++ for Windows. I wrote some programs for University
and I would like to keep developing them on my Mac, but keeping them useful
when transfering to PC again, at University. The thing is we use PC there,
and I have a Mac (obviuslly, I know), so I would need to be able to write
code that is compilable on both platforms.

The most important thing to keep in mind here will be to use functions that exist on both platforms. That can sometimes be a bit of a challenge, as I'll explain next....


A few problems I'm having is with functions, such as 'getch()' and the conio.h
library. I don't know if they can be added, where?

conio.h is a Borland-specific library. It isn't even Windows-specific; it's only part of Borland's tools. The closest thing on Unix-like systems (including Mac OS X) is the 'curses' library. You can use the curses library by adding /usr/lib/libncurses.dylib to your project. If you look at the man page for getch ('man getch' in Terminal), you'll see that it's in curses.h. Just #include that header, link against the library, and it'll work.


Other functions from conio.h might be tougher to implement, since ones like kbhit() just don't exist on Unix-like systems. A quick Google search for each API and either "Unix" or "Linux" should help you figure out how to implement them on Mac OS X.

Hope this helps,
Eric
_______________________________________________
xcode-users mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/xcode-users
Do not post admin requests to the list. They will be ignored.


References: 
 >Transfering Borland C++ to XTools (From: "Nico Christie" <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.