ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
well i suppose you can port it to whatever OS you want, but you may have to change the source ( a lot even! ). is it a console application? does it use only standard C/C++/whatever? or does it use a specific win library. in that case you will have to change it.
it is an application with a Gui? than you will have to change it also, from the win32 api to any other that linux uses (QT, wxwindows, gtk, etc). you may be lucky and it uses a portable api like QT and wxwindows or even gtk but it may also not work, cause again it may use windows specific library.
so here's the case: you'll have to check the code for windows dependencies and change those to linux.
Ok, in windows it runs standalone, no console, with a GUI. im pretty sure that I have QT and gtk stuff on here, so what would i do to change the api once i find it?
in the code it calls windows.h and a couple others to be included, im assuming/hoping that deals with program windows and not the OS, but im not sure...
<edit> Right after i posted i found this:
if (LOWORD(Vbwcc) < BWCCVERSION) then {
sprintf(szBuff, "BWCC.DLL is v%d.%02x!\nNeed BWCC.DLL v2.0 or higher\nCheck C:\\WINDOWS directory\nfor older version...",
bwcc1, bwcc2);
which is the error printed by the program if it cant find a specific DLL, how would i change it to look for something that linux has/can have?
</edit>
You'll have to determine what API is used to create the Window. If it's not some portable API, which it doesn't sound like it probably is, then you are going to have to get your hands dirty by learning that API, and learning an equivalent API available for Linux, or a portable API that does the same thing.
(e.g. if it is using the Win32 API, you will probably find a WinMain function that calls CreateWindow (or CreateWindowEx). These APIs are NOT found for Linux, but you can learn the glX functions, or any of the other windowing libraries you can use under Linux.)
BWCC.dll is the borland custom controls library, borland never released this for linux so there is no equivelent file so at best the gui will need to be re-written, im sorry to say but this is impossible for someone with just a little knowledge of C - you'll need to know both the windows API and the api your porting to qt/gtk/motif/etc pretty well.
assuming it doesnt use MFC(probably wont with BWCC) then you might have a chance of compiling it under winelib but i have no experience of this.
what does the application do because it would be much easier to find a linux equivelent
by scm86 It is a Rocket Altitude Simulation Program
so does it just do some numerical integration and draw graphs/pictures? if its that simple send me the sourcecode(kev82@khn.homelinux.net) and i'll have a look at it. if its quite complicated then as you say you've got a lot to learn.
for a simple intro to C - chapter 22 of this book
for the windows API (you'll need to fully understand what the program does now) - go here
for a reasonably simple gui toolikt - look here
it takes a file with thrust-time data and uses user inputed weight, diameter, coefficient of drag to plot both time-altitude and time-velocity to one chart, showing where mach is on that chart, as well as plotting the thrust of the individual motor and all the motors combined...
slightly more than just a simple plot... it needs to work on the same input/output files as the win prog, though that shouldnt be too hard should it?
BTW, i have QT installed, came with RH9, would this work well enuff?
I think how I'd approach it is first design the GUI in Linux the same as it was layed out in Windows, using QTDesigner or a GTK designer, etc. Then link it to the code and fill it in with the "guts" from the windows program. Then run it and fine-tune it as you need. For example, if you had an "OK" button on a form you would design an OK button on a QTDsigner or GTK designer form, link it into your program project in say, KDevelop, then fill in the code that was for the OK button in the Windows program put it in for the OK button in the Linux program. If it's standard C++ commands and stuff, it should work, but if not, you might want to find equivelent commands, etc.
Unfortunately, it's not as simple as bring in source code into linux and compile with gc++ and it would work. It won't. The Windows API is very different from X, GTK and QT.
yeah, it probably can work under wine, but that would require users to download or buy another program to use a free program, if it can be ported over and packaged up, then its just a small download and install to use it.
Is there a tutorial somewhere on how to use glade or QT? Ive been able to get a window and the file edit help menus, but thats about it...
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.