LinuxQuestions.org
Support LQ: Use code LQ3 and save $3 on Domain Registration
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices

Reply
 
LinkBack Search this Thread
Old 08-02-2004, 04:07 PM   #1
Bondfire
LQ Newbie
 
Registered: Jul 2004
Posts: 17

Rep: Reputation: 0
Porting C++ code from XP to Linux


Hi pple.

I have a C++ program that runs on Windows XP (written using Borland C++ 5.02) but i am required to use Linux (Redhat 9.0) as the platform ; being a newbie to linux i have several questions.

I know for Linux we have built in C and C++ compilers (gcc and g++)....my main frustration is the interface i have to work with in Linux. Does anyone know of any freeware graphical compiler that i can use with Linux?

Also my code contains statements(functions and headers) that are not part of standard C++ , like outportb() fucntions to access ports ; if i am using the g++ compiler how can i use it to see what functions and headers are available/recognised in the compiler......does the [I]man[/1] command work with the g++ compiler too? Is there any way in which i can browse the compiler to see what help features are contained in it just like i can use the Help menu bar of Borland.

If you know of any freeware Linux C++ compiler,preferbly one that can be used to make GUI's as well.....plizzzzzz do let me know....

Thanks in advance...i know i won't be let down

Bondfire
 
Old 08-02-2004, 04:26 PM   #2
Komakino
Senior Member
 
Registered: Feb 2004
Location: Somerset, England
Distribution: Slackware 10.2, Slackware 10.0, Ubuntu 9.10
Posts: 1,938

Rep: Reputation: 52
g++ can be used to make GUI's, but in linux, unlike windows, the GUI is not a standard part of the windowing environment. That's to say that in Windows you can include macros or functions or graphical tools to create a GUI in the compiler because you know every windows user will have the necessary libraries/DLL's installed to use the GUI you create; in linux this isn't so as GUI's can be created in Motif, wxWindows, gtk, Qt, Tk...you can't include support for ALL of those!! There are tools to help you though... Glade helps create GUI gtk applications, and there are similar tools for Qt and Tk.

Personally I use only vim for programming. Anything else is unnecessary.
 
Old 08-02-2004, 06:31 PM   #3
Tinkster
Moderator
 
Registered: Apr 2002
Location: in a fallen world
Distribution: slackware by choice, others too :} ... android.
Posts: 22,627
Blog Entries: 10

Rep: Reputation: 776Reputation: 776Reputation: 776Reputation: 776Reputation: 776Reputation: 776Reputation: 776
Moved: This thread is more suitable in Programming and has been moved accordingly to help your thread/question get the exposure it deserves.
 
Old 08-02-2004, 06:38 PM   #4
itsme86
Senior Member
 
Registered: Jan 2004
Location: Oregon, USA
Distribution: Slackware
Posts: 1,246

Rep: Reputation: 53
g++ will always be your backend compiler. You might look at KDevelop if you use the KDE window manager.

outb() (I believe) is linux's equivalent to Windows' outportb().
 
Old 08-02-2004, 09:53 PM   #5
Bondfire
LQ Newbie
 
Registered: Jul 2004
Posts: 17

Original Poster
Rep: Reputation: 0
Hi there,

Can you tell me more about this KDE window manager....i have downloaded Kdevelop....but i'm afraid that i don't know what to do next!
 
Old 08-03-2004, 07:57 AM   #6
Marius2
Member
 
Registered: Jan 2004
Location: Munich
Distribution: SuSE 9.2, 10.2, 10.3, knoppix
Posts: 274

Rep: Reputation: 30
What to do with KDevelop

KDevelop probably comes with your distribution, so you probably won't
have to install it manually or even compile it (whatever you have
downloaded).
If you are using SuSE, install it via YaST. If you are using RH, Mandrake or any other distributions, there are quite likely similar installation tools.
You need KDE installed and working, of course.
I personally dislike KDevelop, because although it's pretty close to the
MSVC GUI (even with Intellisense) it creates far too many files in your
project, and just like MSVC tends to keep you in the dark about what is
happending "under the hood". I use Kate and makefiles instead, learning curve probably is slightly steeper but you'll be more portable afterwards,
and are more likely to understand what you are doing instead of just
having dumbly learned to press the proper buttons.
You may want to take a look at GTK. If you stick to hard coding your GUI
port rather than creating it graphically (you won't be able to use your
Borland code 1:1 under any linux environment, anyway), you'll be off well
with GTK because it is really simple to program, there are good tutorials,
and it's really free (different from KDE, which is based on QT, which be-
longs to Troll Tech).

For your os api port, may I suggest you write some c++ os abstraction
class, something like

unsigned long C_abstraction_layer::_mymmtime(){
unsigned long result=0;
#ifdef _WIN32
result=timeGetTime();
#endif
#ifdef __linux__
timeval gtod_now_time;
gettimeofday(&gtod_now_time,0);
result=(gtod_now_time.tv_usec-gtod_start_time.tv_usec)/1000;
result+=(gtod_now_time.tv_sec-gtod_start_time.tv_sec)*1000;
#endif
}

HTH
 
Old 08-03-2004, 07:58 AM   #7
Marius2
Member
 
Registered: Jan 2004
Location: Munich
Distribution: SuSE 9.2, 10.2, 10.3, knoppix
Posts: 274

Rep: Reputation: 30
Could you post which distribution and version you are using?
 
Old 08-12-2004, 03:42 PM   #8
Bondfire
LQ Newbie
 
Registered: Jul 2004
Posts: 17

Original Poster
Rep: Reputation: 0
Hi there,

Sorry for the late reply...

As of now my PC has been taken by the I.T pple....i understand that they gonna install Redhat 9.

Thx!

Bondfire
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Porting C++ code from windows to Linux ashwinipahuja Programming 9 06-03-2004 02:09 AM
Porting c++ code to linux Moons Programming 3 06-03-2004 01:24 AM
Porting C++ code from windows to Linux ashwinipahuja Linux - General 1 03-22-2004 02:57 AM
porting a C++ code to redhat Linux environment KevinG Programming 12 01-02-2004 03:55 PM
porting windows ce code to linux rainmann Programming 7 06-12-2003 07:19 AM


All times are GMT -5. The time now is 06:48 PM.

Main Menu
 
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: @linuxquestions
Open Source Consulting | Domain Registration