X11 installation in ECLIPSE - c

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.

Related

Linux-native C libraries: How to configure Visual Studio Code to work with them on Windows?

total noob here.
There are a few a few C libraries I would like to use, like unistd.h and sys/time.h, in a Windows machine. I have found many threads discussing is it simply not possible without using alternative packages. But I wonder does the Windows Subsystem for Linux come with those libraries? If so, how do I configure Visual Studio Code work with WSL?
But I wonder does the Windows Subsystem for Linux come with those
libraries?
Yes compiler in WSL will contain these headers.
If so, how do I configure Visual Studio Code work with WSL?
You need to enable WSL in Windows features, install linux distro you like via Microsoft Store, install "Remote - WSL" extension in VS Code.
More information can be found here: https://code.visualstudio.com/docs/remote/wsl
Keep in mind though, that applications that you will compile in this setup will be linux applications. They will only be able to operate under linux or WSL.
There is no way you can compile applications using these libs for Windows. These libs are platform depended.

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.

How to develop GTK+ programs on windows?

There isn't a windows binary release, so when it says that they are cross-OS, they mean you can write source to compile on windows, but you have to develop in linux/osx? But then what if you want to make calls to win32api within the app, and want to test as you go along?
They mean you can develop under Windows and you do not have to compile the libraries for yourself.
Binaries for GTK+ and its dependencies can be found here.
Cross OS means that the same API is available across all supported platforms.
Direct calls to the win32 API can be made normally in a GTK+ application.

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.

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