Solved

Source code that compiles on Win NT as well as LINUX

Posted on 2002-05-27
15
209 Views
Last Modified: 2010-04-22
Hi all,
I am new to LINUX development. We have a requirement where a customer wants to write a C/C++ application in such a way that it can be compiled seamlessly both on Win NT as well as Win2000.

In my opinion, what we will need is a kind of NT/LINUX compatible C++ library on which we write the application. This intermediate layer will take care of the OS dependent features.

I would like to know from the experts if such a possibility exists or are there any other approaches.

(JAVA is ruled out because of performance issues)

Thank you.

0
Comment
Question by:saurabh_dasgupta
  • 4
  • 3
  • 3
  • +5
15 Comments
 
LVL 4

Author Comment

by:saurabh_dasgupta
ID: 7038473
I forgot to mention that , a GUI is an essential requirement for the application. The GUI will need to have buttons,edit fields , radio buttons, etc.


0
 
LVL 1

Expert Comment

by:tekweni
ID: 7038739
Alas there is no all-in-one library that provides compatibility between nt/unix.  My environment requires the same codebase to run on solaris/hpux/linux/aix and also nt/2000, and the best we've been able to do is make wrappers for the functions that behave differently, so they at least look the same to the application.  That's not as nightmarish as it sounds and for my needs is confined to threading, gettime, directory io, and gethostinfo.  I use #ifdefs to conditionally compile the applicable code, pretty much like everyone else I guess.

The only way I know around this is to write for Cygwin running on top of NT - that way you get to use the Gnu compiler but you'll still be limited in other ways.

For a gui, you may want to consider FLTK (www.fltk.org).  This is basically a stripped-down clone of GTK+, but whereas a NT port of GTK+ is "coming", FLTK compiles and runs on both unix/nt today.  Quick and easy to get into, and provides a rich enough set of features.

Hope this is useful...
Kim
0
 
LVL 4

Author Comment

by:saurabh_dasgupta
ID: 7038763
Thank you for the lead. I will investigate FLTK.
0
 
LVL 51

Expert Comment

by:ahoffmann
ID: 7038915
have a look at NuTCRACKER at http://www.datafocus.com/
not shure if it is still supported,.
0
 
LVL 5

Expert Comment

by:garboua
ID: 7040428
tekweni is right on the money when it comes to your code.  #ifdef  OS will be your best friend for OS specific calls.  won't take much to master it.
I don't know about FLTk, but you cat take a tcl/tk application from one platform to another Easily, minimal work.  the libraries are almost the exact same, and you will not neet any os  specific interface, it will take care of that for you, and it supported by almost all os, solaris, IRIx, linux windows, arrrgs :-), etc etc etc.
0
 
LVL 4

Accepted Solution

by:
ct.smith earned 200 total points
ID: 7040470
Qt (www.trolltech.com) is very good at allowing the same code on Windows and Linux.  Quite often, there is no need for sections of code for a specific OS.  Also, there is the utility qmake (comes with Qt) that can generate Makefiles for Linux and Visual Studio projects automatically for the same code.
0
 
LVL 51

Expert Comment

by:ahoffmann
ID: 7040533
I'd vote for Tcl/Tk too, but the question says C/C++ (heavan knows why making things complicated when they can be sooooo simple;-)
0
How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

 
LVL 5

Expert Comment

by:garboua
ID: 7041633
ahoffmann,
true, the question sys c/C++, but then he/she wrote
>>I forgot to mention that , a GUI is an essential >>requirement for the application. The GUI will need
>>to have buttons,edit fields , radio buttons, etc.
And that is why I brough up tck/tk.  
U slipping dude, U slipping Ha ha ha ha ha ha LOL



0
 
LVL 51

Expert Comment

by:ahoffmann
ID: 7042375
BTW, I don't know anything where I need C/C++ for, which cannot be done with Tcl/Tk (except writing #ifdef in C code;-) leaving the performance issue beside ..
0
 
LVL 2

Expert Comment

by:fremsley
ID: 7044821
> (JAVA is ruled out because of performance issues)

Have you tested the new JDK 1.4 from Sun?

Hope it helps
0
 
LVL 5

Expert Comment

by:garboua
ID: 7050981
1.4 still have issues and I would not suggest it for PRODUCTION.
0
 
LVL 11

Expert Comment

by:robert_marquardt
ID: 7056243
If Pascal is possible then Delphi (for Windows) and Kylix (Delphi for Linux) could be used. It has two GUI class trees. VCL for Windows only and CLX which is based on QT and cross platform.

I prefer Delphi over MS Visual Studio because it is easier to use.
0
 
LVL 1

Expert Comment

by:MaxMaxic
ID: 7092172
Hi.
If you can consider the commercial products, I would recommend Visual MainWin of Mainsoft. (http://www.mainsoft.com).
Basically, this is a tool that enables to you to take your code from NT/2000 and port it automatically to one of the supported Unix/Linux platforms. See the web site for the details.

Hope it helps.
0
 
LVL 4

Author Comment

by:saurabh_dasgupta
ID: 7092737
I would like to thank all of you for the attempts that you have made and put an end to this thread:

I have been using the leads provided here, and I will have to accept more than 1 comment as an answer:

[+]
Java approach is ruled out. JAVA is several times slower than it's native counterpart. (w.r.t JDK 1.3, 1.4 has not been tried out. I understand that it has a better graphics architecture)

[+]
TCL/TK and Pascal development is also ruled out, because my organization does not have trained resources.

[+]
FLTK ,TROLLTECH and MAINSOFT are very good suggestions. Out of these 3, my team has zeroed down on TROLLTECH and MAINSOFT as the probable candidates.

So I would like to split the points between
MaxMaxic   and ct.smith


Thank you everybody
0
 
LVL 4

Author Comment

by:saurabh_dasgupta
ID: 7092761
Thank you. I will float another dummy question for MaxMaxic.
0

Featured Post

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
script 11 136
yum update fails 11 372
CENTOS7 DL380 G5  failed to install even after hpsa allowed 5 953
Embeded Linux on Router 9 93
Have you ever been frustrated by having to click seven times in order to retrieve a small bit of information from the web, always the same seven clicks, scrolling down and down until you reach your target? When you know the benefits of the command l…
The purpose of this article is to demonstrate how we can upgrade Python from version 2.7.6 to Python 2.7.10 on the Linux Mint operating system. I am using an Oracle Virtual Box where I have installed Linux Mint operating system version 17.2. Once yo…
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
This video discusses moving either the default database or any database to a new volume.

708 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now