Gui in C on windows cygwin - c

I'm trying to make a script that can generate a kind of chat client in cygwin on windows but I don't have a clue how to start, I saw something like gtk+ but how do I get that inside of cygwin, and what have I to do after that?

Cygwin has an assortment of gtk packages. After that you need to read some documentation and learn how to use the toolkit to make your program. Here is a tutorial to get you started.

Are you locked to Cygwin or are you using that because you think that is where Gtk+ apps can run? In any case I seem to remember those packages as options in the cygwin installer. Also this link seems valid: http://sourceware.org/cygwinports/ . I tend to generate native programs using Gtk+ on MinGW instead so my users don't have to have all of cygwin installed to run my software.

Related

GUI in Glade — application for Linux and Windows

I have written a program in C, and I would like to make a GUI for it. I would like to use Glade because it is drag and drop. I am using Linux, but I would like the application that can be made to run on both Linux and Windows. Is it possible? And if it is, is there an option exporting the GUI for Windows using Linux?
After visiting the Glade site,
I found that they have Windows binaries available. Here is a link to it:
http://ftp.gnome.org/pub/GNOME/binaries/win32/glade/
I also found this:
http://wingtk.sourceforge.net/
You can install the GCC compiler for Windows (mingw) on a Linux machine.
Afterwards, you can follow #Joe's link to get the Windows binary, and link them when you compile your program using mingw.
A quick Googling should give this link which covers step-by-step instructions on how to achieve this: http://www.tarnyko.net/en/?q=node/45

X11 installation in ECLIPSE

I have been trying to install X11 in Eclipse for C. I have to design visualization applications in C using X11. I am used to Eclipse for java. I need your help for the detailed steps to get X11 directory and getting Xlib.h, xatom.h,xos.h,xutil.h file access through eclipse.
I have been trying very hard but not able to find suitable answer. I like Eclipse because its easy to debug and I have windows operating system.
Please suggest me how can I proceed further?
X11 is a windowing system widely used on Linux and Unix systems. You have 2 options:
Go native and install you favorite Linux distro, either as a VM or on actual hardware, then install eclipse on that.
Try using Cygwin. Cygwin allows you to run *nix apps on Windows and X server is one of the apps supported.You can find more info on http://x.cygwin.com/
If you are trying to do C/C++ development then you need to install the Eclipse CDT package. This allows you to create a C/C++ project inside of eclipse in which you can then write your X11 program.
If you are doing Java development, then you don't use X11 or even Windows.h directly, instead you use the Java Swing framework to do your graphical UIs. When run on an X11 based system (unix) it will use X11 underneath to render the display, while on a carbon based system (OSX) it will use Carbon and on a Windows system it will use windows api.
However, you also mention you are using the "windows operating system" and if by that you mean Microsoft Windows, then there is no (practical) way to do X11 development on windows. You really need to stop and think about what you are trying to achieve and perhaps post a different question about how you can accomplish that.

Cross Compilation for C applications using Eclipse

I'm developing a java application which uses native code with JNI, so I developped a C shared library using Eclipse with the CDT plugin on Linux Redhat. Everything works fine since I can launch my java application and call the native methods without any problem. But my problem is, I need to compile my code on every platform (Linux, Windows, x86/x64). It's not a problem to get the libXXX.so file but I also need a .dll to run on Windows, except I can't just compile my code on it, I need a way to do that locally on Linux with Eclipse. So I am looking for some simple solutions to do that locally with Eclipse using cross compilation.
I've made some researches but I can't find a real tutorial to explain how to do that, each time people say to compile on the specified platform. So if someone could help me with this that would be great.
My configuration is : Linux RedHat, Eclipse Juno, CDT plugin 8.1
You need a Linux -> Windows cross compiler. The MinGW tools would do the job, but, last I checked, they only provide binary downloads to run on Windows (i.e. not a cross-compiler). There are some (old) instructions for building your own here.
The CodeBench compiler is probably exactly what you want, but it's not free (there is a free trial though). It's basically a professional build of the MinGW tools, and comes with it's own customized Eclipse so there's no fiddling about needed in that department.
A quick google also comes up with these tools on sourceforge, but I've not tried them.

Dos.h + Pc.h in C and Windows Vista

I am currently looking to work with Mesa3D to create a software rendered graphic application with OpenGL.
I am looking a a few tutorials right now on how to use it, and many are written with DOS or older versions of Windows in mind. As I run Vista I don't seem to have the right files I need.
The Mesa3D tutorial I am using uses outportb() and a few other commands which I can't seem to get working. After looking around I have found you require the 2 include files:
dos.h
pc.h
These do not seem to be found within the Window's SDK that comes with Visual Studio 2010 (Express) or even the older version of 2005 (Professional) which I currently have.
They seem to be found with the DJGPP compiler that only works under DOS and is not supported in Vista, even with compatability mode. Running DosBox still does not get this to work.
I am wondering - is there perhaps a new functions replacing outportb or can I use these DJGPP files with my C/C++ complier with VS or PellesC (which I find better for C-only programs)?
In addition the conio.h include file I have with both VS and PellesC doesn't have the textmode() function, but the DJGPP version does.
If anyone could help either getting DJGPP working on Vista or allowing me to use the dos,pc and conio.h files from DJGPP with either VS or PellesC that'd be a great help!
Port-manipulating functions will simply not work in Win32 programs. Either use Win32 APIs to do I/O (rendering included) or stick to DOS and run your program in DOS or whatever DOS emulator you can find that works. Vista and later Windows won't run most DOS programs directly as the support for DOS is either severely reduced or removed altogether (e.g. in 64-bit Windows).
The low-level hardware access that functions like outportb give you is not available to programs in modern Windows environments. Such capabilities are reserved for specially-trusted code (OS internals and drivers). You need to go through higher-level APIs or drivers in order to access the same functionality.
The Mesa3D website has a readme for Windows developers that has information about what you need to install and configure. It also references some official demo code that you can use as the basis for your project. The Mesa3D website also has a repository full of demo programs that will probably serve as better examples than the out-of-date tutorials that you mentioned.
Do not use 16bit compilers on vista and higher.. instead use DOSBOX to run your programs.

Any way of running GTK libraries In Windows OS using C?

After a whole week of trying to get GTK working on Cygwin and MinGW using makefile, I've hit a stone cold wall. Does anyone please, anyone know how I can program using C and GTK libraries in widows operating system that WORKS? If there is can anyone give me step by step instructions please! The environment has to run the hello world program as an example: http://en.wikipedia.org/wiki/GTK%2B
Thanks in advance!
It's a bit tricky to configure GTK+ toolchain on Windows.
The easiest way is to use this GTK+ bundle. It provide easy to use and install GTK+ runtime environment. You will find there note how to extend this runtime for developing purposes.
According to GTK+'s mailing list version 2.16 is known to be the most stable, however maybe it's good idea to try newer one.
Moreover go to GTK+'s home page and read threads about GTK+ & Windows 7 on the gtk-app-devel mailing list.

Resources