Adding external Graphics library in Ubuntu10.04 - c

i am a beginner to c progmmng, right nw m coding c on ubuntu using gedit and compiling in gcc, i want to plot a graph in c prog, i read regarding gnuplot and koolplot, but when i include those files in my prog i get output as: fatal error/no such directory etc..can anyone tell me how to work it out..please give in detail ans..coz m new to using ubuntu...
i appreciate your answers thankx

How did you install gnuplot and how are you using it in your program? Did you follow the instructions in the gnuplot manual?
Koolplot appears to be designed for the MingW environment under Windows, I wouldn't recommend using it if you're in a Linux environment.

Why not to use GPL library MathGL? It is cross-platform, have C interface and is specially designed as plotting library (not an external program). However it has external GUI and console tools too.

Related

How can I use Gnuplot as a library in CLion?

I'm trying to use gnuplot on my m1 Mac. I installed Gnuplot with homebrew. Now I am trying to add Gnuplot as a library to my C code but I don't now how? Another problem is that I have no idea how the library file from Gnuplot is called
I have searched for the library file but couldn't find it.

How can I compile a C console program using Cairo library (that compiles ok on Ubuntu) on Windows 11?

I made a console C program that reads a .obj 3d model and unflatten it into a multipage PDF. At first I used a little PDF library (https://github.com/AndreRenaud/PDFGen) that worked fine and I was able to compile my code on Windows 11, but I needed to have text rotated and it wasn't possible with PDFGen, so I changed for Cairo Library (https://github.com/freedesktop/cairo). With Cairo my code does exactly what I want, but I didn't find how to compile it on Windows.
I'm using Geany to edit/compile my C code, my build command is :
gcc -Wall -o "%e" "%f" -lcairo -lm
I tried to do the same on Geany on Windows and it didn't work.
I found a repository with standalone cairo DLL for Windows, but didn't manage to use it.
I'm looking for another PDF library that could be used both on Linux and Windows, but for the moment didn't find any.
my code is here (https://github.com/gilboonet/Deplieur-C/blob/main/deplieur.c)
It's my first post here, I'm a long time C programmer but not IT pro and I'm not a Windows user, I only want to compile my code on it because lots of people that will use my program are windows users. Thank you.
I've found a project called "cairo-windows" on Github that creates resources needed to build a C project using Cairo, and it works, even if I needed to use Visual Studio. Sadly, it seems to have problem with pdf creation that only creates a blank file. To make it work I changed the resources (dll and includes) it needs to build the project to those from my gtk windows build it comes with Cairo 1.16.0. If you want to do the same, you must replace the extern directory from cairo-windows (initially fetched by setup-win32.py): lib by cairo.lib, cairo.dll expat.dll fontconfig-1.dll freetype-6.dll and libpng16.dll from your gtk build (..gtk\x64\release\bin) and include by the content of ..\gtk\x64\include.

How do you build Lua with Dev-C++ compiler?

I've been coding in C for a while and I only compiled and debugged with Dev-C++ compiler. Now I'm trying to learn Lua programming language. Just downloaded the Lua source code and I want to compile it with Dev-C++. Can you explain how can I use them? My OS is Win 7.
Edit: Sorry for the explaining mistake. I downloaded the original Lua source code and I want to use the header files that the original source code contains. So I do not know how to add header files to the project that you can open in Dev-C++.
I recommend that you download and use the IDE called SciTE, it is as simple as DEV C++ and comes with a compiler ready to run Lua.
But if you really want to customize a lua compiler, you can call lua.exe to compile and run your Lua file
for example, my Lua is installed in C:\Lua
so I use the following command to compile my codes:
C:\Lua\lua.exe myScript.lua

How do you add PGPLOT for C?

How do you add the PGPLOT library? I'm specifically coding in C, using Cygwin64 as the runtime environment, gcc as the compiler, and Windows 7 as the computer operating system.
I'm trying to get the PGPLOT 5.2 library found here:
http://www.astro.caltech.edu/~tjp/pgplot/
Thanks in advance!
As the cygwin package is not present you need to compile and install it,
by yourself
http://www.astro.caltech.edu/~tjp/pgplot/install.html

Dealing with static libraries when porting C code from one operating system to another

I have been working on some C code on a windows machine and now I am in the process of transferring it to a Linux computer where I do not have full privileges. In my code I link to several static libraries.
Is it correct that these libraries need to be re-made for a Linux computer?
The library in question is GSL-1.13 scientific library
Side question, does anyone have a pre-compiled version of the above for Linux?
I have tried using automake to compile the source on the Linux machine, but no makefile seems to be created and no error is output.
Thanks
Yes, you do need to compile any library again when you switch from Windows to GNU/Linux.
As for how to do that, you don't need automake to build GSL. You should read the file INSTALL that comes inside the tarball (the file gsl-1.16.tar.gz) very carefully. In a nutshell, you run the commands
$ ./configure
$ make
inside the directory that you unpacked from the tarball.

Resources