PDA

View Full Version : Writing graphical windows app in Linux?


Kimm
February 19th, 2006, 11:46 AM
Hi,

I have a plan on making a CD containing software for Linux, FreeBSD, Mac OS X and windows. As windows has an autorun feature I think it would be bad not not use it. However I have a problem, I want to write the application in Linux preferably without using any windows APIs (one reason being: I dont know them...), can this be done?

I would like to use GTK, but as most windows computers dont have this installed I think it would be difficult to just write it as a normal GTK app and put it on the CD.

Can anyone come with suggestions?

dee.dw
February 19th, 2006, 12:20 PM
If you want to have a GUI that is platform-independent I would recommend Java. Most computers habe Java Runtime installed and would work with autostart I think.

Greetings, Dee

Kimm
February 19th, 2006, 12:23 PM
The idea crossed my mind, but I dont know Java. I would like to write it in something like C or C++.

I do know wxWidgets, but most computers dont have that eighter.

LordHunter317
February 19th, 2006, 01:06 PM
installing the GTK+ runtime on Windows is trivial.

Kimm
February 19th, 2006, 01:22 PM
Perhaps, but then the CD would have to promt them to install GTK before the autorun program starts, something that may seem irritating to some.

dee.dw
February 19th, 2006, 01:25 PM
You could programm with wxWidgets and link the code dynamically. Then you must create some dlls from wxWidgets and put them on the disc too. This should help...

Greetings, Dee

Kimm
February 19th, 2006, 01:28 PM
That could work, thanks dee.dw

I havn't done this before... how would I go about doing it?

dee.dw
February 19th, 2006, 02:00 PM
Hm... if I think about it: Dynamically linking would be no advantage because under Linux you must use .so and under Windows .dll... So you can link them statically and get some two executables for Linux and Windows separatly.

This means write your code in wxWidgets as normal and compile them for Windows and then for Linux and burn this on CD. (Hm, but I don't know about architectures and kernel versions. So I don't know if one executable for all Linux-Distris is enough.)

@all: If I talk nonsense please correct me! I have never linked something dynamically. :)

Greetings, Dee

LordHunter317
February 19th, 2006, 02:01 PM
Hm... if I think about it: Dynamically linking would be no advantage because under Linux you must use .so and under Windows .dll... So you can link them statically and get some two executables for Linux and Windows separatly.Except that most code won't work correctly if linked statically.

Link them dynmically and ship the libraries. Not hard. VMware does this, for example.

Kimm
February 19th, 2006, 02:04 PM
The app was acctually not intended to run in Linux, only windows, for the simple reason that Linux users are usualy more experianced then windows users and since Linux has no CD autorun feature.

dee.dw
February 19th, 2006, 02:40 PM
@LordHunter: What do you mean with "won't work correctly" exactly?

@Kimm: Hm, I thought from your first post that it shoudl be platform independet what you program. But as I see now you only meant the Win autostart. So I think there is no reason not using wxWidgets maybe with Bloodshed Dev-C++ under Windows!

Greetings, Dee

LordHunter317
February 19th, 2006, 02:49 PM
@LordHunter: What do you mean with "won't work correctly" exactly?Anything that depends on NSS switch, or PAM, would break outright.

Qt applications can't be safely statically linked in most situations (you have to code for it). KDE can't be at all.

Kimm
February 19th, 2006, 03:17 PM
Hm, I thought from your first post that it shoudl be platform independet what you program. But as I see now you only meant the Win autostart. So I think there is no reason not using wxWidgets maybe with Bloodshed Dev-C++ under Windows!


That may work. Perhaps bloodshed could work in Wine...

dee.dw
February 19th, 2006, 04:02 PM
Why use Wine? ;) A similar (or identical) IDE for C++ you can get at http://www.parinyasoft.com/ called MinGW Developer Studio. Unfortunately I found this thing really instable and it crashed everytime I tried to compile something. Now I use Code::Blocks (http://www.codeblocks.org/) which works really fine with wxWindows. (And Code::Blocks is for Windows too, so you can test it there.)

Qt applications can't be safely statically linked in most situations (you have to code for it). KDE can't be at all.Hm, may be... In my case everything works fine! :) Maybe I just had luck... But I think a for a simply frame with some buttons you do not need to link dynamically.

Greetings, Dee

LordHunter317
February 19th, 2006, 04:08 PM
Hm, may be... In my case everything works fine! :) Maybe I just had luck... But I think a for a simply frame with some buttons you do not need to link dynamically.You do know that unless you're asking for static linking, you're not getting it, right?

dee.dw
February 20th, 2006, 03:16 AM
You do know that unless you're asking for static linking, you're not getting it, right?Hm, unfortunately I don't understand this sentence... So you're right: I don't get it! :(

But anyway if the answer is not related to the topic of Kimm it's not that important that I understand it. :)

Greetings, Dee

LordHunter317
February 20th, 2006, 03:18 AM
What I'm saying is that unless you explictly link -static, you don't ever static link on Linux.

dee.dw
February 20th, 2006, 06:35 AM
Ah, thank you. Now I got it. :) I didn't know that linux link everything dynamically... Do not program that often there!

Thanks for explanation,
Dee