Welcome, Guest. Please login or register. Did you miss your activation email?

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - Fabrizio Caruso

Pages: [1]
1
C / Re: CSFML under Cygwin/Windows? How?
« on: January 17, 2022, 09:12:01 am »
Thanks!
I will try to set up VS with CSFML but I have not found any tutorial on how to do it.
I have never used VS. I will need to figure it out. I see tutorials for SFML. I wonder if I could just follow them for CSFML.

I may give up Cygwin. I am not using its default compiler which aims at Cygwin and not Windows.
I am using MinGW (which exists under Cygwin and Windows proper).
Is MinGW supported by CSFML (in Windows proper)?
I downloaded precompiled versions of CSFML of:
https://www.sfml-dev.org/files/CSFML-2.5.1-windows-32-bit.zip
https://www.sfml-dev.org/files/CSFML-2.5.1-windows-64-bit.zip

I supposed that the .a files were meant for GCC under Windows (MinGW?)

My first attempt with MinGW (under Cygwin) fails with the linker complaining about them being incompatible:
/usr/lib/gcc/x86_64-w64-mingw32/11/../../../../x86_64-w64-mingw32/bin/ld: skipping incompatible
...

I will also try MinGW under Windows proper (no Cygwin).

2
C / Re: How to get started with CSFML?
« on: January 13, 2022, 11:33:54 pm »
Thanks! Of course I have figured out EXIT_SUCCESS/FAILURE. I will see if I can find one in the github page.

I was looking for a trivial example that would just compile with the simplest command line, just to get started. I didn't know that window depended on graphics. Thanks for the hint.

By the way, I understand I cannot use CSFML on my other targets. I only want to use it with Windows and/or Linux. Cygwin is my prefered enviroment because it makes my life easier to handle my massively multi-target project (as it is both POSIX and capable of running Windows binaries).

3
C / Re: CSFML under Cygwin/Windows? How?
« on: January 13, 2022, 11:24:43 am »
Ideally I would like to use Cygwin as environment but I can use Windows and/or Linux.
Is MINGW under Cywin supported MINGW in Cygwin targets WIN32 (and not Cygwin).
The reason why I prefer Cygwin is that it is the main environment I use for my project:
https://github.com/Fabrizio-Caruso/CROSS-LIB
I can also use plain Linux. I would prefer not to add a third environment (msys) unless I have no other choice or the other choices are way more complex.

I am a beginner with CSFML. What is the simplest setup that can get me started?
Does GCC under Linux work out of the box?

4
C / Re: How to get started with CSFML?
« on: January 13, 2022, 11:20:29 am »
The example above won't compile with my setup...
What do I need to use CSFML? Which compilers should I use?
GCC under Cygwin won't work probably because it targets Cygwin (I get an error about the system not being supported).
I have also tried MINGW which targets Windows and I get these error:

x86_64-w64-mingw32-gcc test.c -o test   -I../CSFML-2.5.1-windows-64-bit/include/  -L../CSFML-2.5.1-windows-64-bit/lib/gcc/ -lcsfml-window -lcsfml-graphics -lcsfml-system
In file included from ../CSFML-2.5.1-windows-64-bit/include/SFML/Window/Window.h:32,
                 from ../CSFML-2.5.1-windows-64-bit/include/SFML/Window/Context.h:33,
                 from ../CSFML-2.5.1-windows-64-bit/include/SFML/Window.h:34,
                 from ../CSFML-2.5.1-windows-64-bit/include/SFML/Graphics.h:32,
                 from test.c:2:
../CSFML-2.5.1-windows-64-bit/include/SFML/Window/Event.h:132:1: warning: type is deprecated [-Wdeprecated-declarations]
  132 | } sfMouseWheelEvent;
      | ^
../CSFML-2.5.1-windows-64-bit/include/SFML/Window/Event.h:126:9: note: declared here
  126 | typedef struct CSFML_DEPRECATED
      |         ^~~~~~
test.c: In function ‘main’:
test.c:18:16: error: ‘EXIT_FAILURE’ undeclared (first use in this function)
   18 |         return EXIT_FAILURE;
      |                ^~~~~~~~~~~~
test.c:18:16: note: each undeclared identifier is reported only once for each function it appears in
test.c:76:12: error: ‘EXIT_SUCCESS’ undeclared (first use in this function)
   76 |     return EXIT_SUCCESS;
      |            ^~~~~~~~~~~~
make: *** [Makefile:8: test] Error 1

(EXIT_SUCCESS and FAILURE is just one more missing include with their defs).

5
C / Re: How to get started with CSFML?
« on: January 09, 2022, 05:20:06 pm »
Thanks! Indeed I had figured out the includes.

Thanks for the github link. This is where I got the zip file with CSML which comes with no documentation.
I now have to figure out if and how it can be used in Cygwin.
Otherwise I will switch to Linux.

6
C / CSFML under Cygwin/Windows? How?
« on: January 09, 2022, 12:48:13 am »
Is it possible to use CSFML under Cygwin/Windows?

I have never used CSFML. I am trying to compile a simple example but I have not found the C-specific documentation.

If I compile one example I am getting this error message:
...
In file included from ../CSFML-2.5.1-windows-64-bit/include/SFML/System.h:32,
                 from ../CSFML-2.5.1-windows-64-bit/include/SFML/Audio.h:32,
                 from test.c:1:
../CSFML-2.5.1-windows-64-bit/include/SFML/Config.h:73:6: error: #error This operating system is not supported by SFML library
   73 |     #error This operating system is not supported by SFML library
...

Does this mean I cannot use CSFML under Cygwin?

7
C / Re: How to get started with CSFML?
« on: January 09, 2022, 12:27:48 am »
Thanks!

I think your example is incomplete as it has no includes. Where can I find the full example?

I know how to link a static library (gcc ... -l<name of the lib without lib prefix>).
So I suppose I will have to statically link all the .a files (or most of them).

Where can I find the documentation? It is not included in the file I downloaded.

I cannot use C++ for my main project because it is written in C and there are no C++ compilers for 99% of the targets I am interested in:
https://github.com/Fabrizio-Caruso/CROSS-LIB

I could use C++ for other projects.

8
C / How to get started with CSFML?
« on: January 08, 2022, 03:04:22 pm »
Hi everyone!

How can I get started with CSFML? I have downloaded and uncompressed CSFML Windows 64-bit. I am using Cygwin as my main environment.

I supposed I need to have CSFML location in the PATH variable.

Could someone please give a trivial helloworld example in ANSI C (no C++) and the exact command line to compile it?

Pages: [1]