简体   繁体   中英

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM