Using CDK and Ncurses under Microsoft Windows - c

I wrote a program in C that uses the CDK to create an user interface. It works great under Linux, but some people under Windows need it.
I've heard that Cygwin could help me, so last 3 days I was trying to recompile my program with the help of Cygwin. I tried a lot of things, like differents compilers, recompile nCurses from source, recompile CDK from source, using PDCurses... but I always failed. I got many types of problems and errors so I just can't list that here...
Is there a solution to use the CDK library under Windows ?

Related

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.

How do I get a C program to work as a Windows Application Form?

Hi I am a beginner in C programming and I have made a C program that automatically logins into a website using socket programming, particularly made for UNIX systems. I am now interested in bringing this program into "life" in windows application form, so that it would be much easier to use. But I am clueless on where to start because I have never programmed in Windows before. A simple guide to what steps I should take would be very much appreciated. Thank You.
Get yourself a Windows installation and install an express version of the C++ IDE. In there you can create Win32 API applications from which you could start to build your app. You will need to use the Win32 API to build your form. This API is fairly well documented on the internet. Here is a website with some tutorials on it.
Hope this helps.
You could use a library for that. For example i like Qt but it tends to be large but it is multiplatform. You could also use Win32++ for that. But it requires some reading since it is very close to the windows api (WinAPI).
Just for completeness there is also ATL, WTL, MFC, GTK (multiplatform), wxWidgets and some others i don't recall.

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.

Gui in C on windows cygwin

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.

Resources