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 - AnthoJack

Pages: [1]
1
General / Re: SFML g++ undefined reference to 'WinMain@16'
« on: February 06, 2019, 09:34:09 am »
OK I kinda fixed it.
I linked lmingw32 such that now my command looks like that
g++ -LC:\lib\SFML\lib -o GUImeOfLife.exe -o main.o -lmingw32 -lsfml-system -lsfml-window -lsfml-graphics -lsfml-main
 
and TADAAAAA no error anymore.
One more problem though: I couldn't find my GUImeOfLife.exe but I fixed it by swapping "GUImeOfLife.exe" and "main.o" like that
g++ -LC:\lib\SFML\lib -o main.o -o GUImeOfLife.exe -lmingw32 -lsfml-system -lsfml-window -lsfml-graphics -lsfml-main
 
putting that here so eventual other people finding this won't do this same mistake by blindly copying

Now I've just got one last problem: my program crashes and won't display anything else than a command prompt and the infamous "GUImeOfLife.exe stopped working" even though I have my DLLs in the same folder as my program.
Any thoughts ?

2
General / Re: SFML g++ undefined reference to 'WinMain@16'
« on: February 06, 2019, 08:15:06 am »
I've tried it
g++ -LC:\lib\SFML\lib -o GUImeOfLife.exe -o main.o -lsfml-main -lsfml-graphics -lsfml-window -lsfml-system
 

Sadly it hasn't fixed my problem

C:/TDM-GCC-32/bin/../lib/gcc/mingw32/5.1.0/../../../libmingw32.a(main.o):main.c:(.text.startup+0xa7): undefined reference to `WinMain@16'
collect2.exe: error: ld returned 1 exit status
The terminal process terminated with exit code: 1
 

Quote
Note that your teacher/professor/assistant is being paid to help you, so you should always ask them first, as we're here on our own time. ;)

It is an individual and quite free project where we got to choose which "technology" we wanted to use and my teacher has confessed to not being quite familiar with SFML but he let me pick it because they are here to monitor and not to teach us how to use a technology in particular. Even if he was, there's a rotation between teachers who monitor the project and none of them could fix my problem and my teacher isn't there till friday

3
General / SFML g++ undefined reference to 'WinMain@16'
« on: February 05, 2019, 10:16:30 pm »
Hi there,

I'm trying to compile some SFML C++ code on Windows 10 with Visual Studio Code and I keep having that mistake. I'm running VSCode tasks to compile and link SFML library with g++ and while compilation (g++ -IC:\lib\SFML\include -c main.cpp -o main.o) has no problem I'm getting that error whenever I try to link the libraries (g++ -LC:\lib\SFML\lib -o GUImeOfLife.exe -o main.o -lsfml-graphics -lsfml-window -lsfml-system) as indicated in the tutorial on how to compile with g++ (a little different of course since I'm doing it on Windows)

C:/TDM-GCC-32/bin/../lib/gcc/mingw32/5.1.0/../../../libmingw32.a(main.o):main.c:(.text.startup+0xa7): undefined reference to `WinMain@16'
collect2.exe: error: ld returned 1 exit status
The terminal process terminated with exit code: 1

I've looked on the internet for quite some time now and apparently it can happen when there is no main.cpp file or main or WinMain function to compile but I've triple checked my code and even tried to replace main with WinMain or even to add the "argc" and "argv" arguments to my function but it won't fix my problem.

Here's my main.cpp code to review

#include <SFML/Graphics.hpp>

int main(int argc, char *argv[])
{
    sf::RenderWindow window(sf::VideoMode(200, 200), "SFML works!");
    sf::CircleShape shape(100.f);
    shape.setFillColor(sf::Color::Green);
    while (window.isOpen())
    {
        sf::Event event;
        while (window.pollEvent(event))
        {
            if (event.type == sf::Event::Closed)
                window.close();
        }
        window.clear();
        window.draw(shape);
        window.display();
    }
    return 0;
}
 

Could the fact that I'm working on VSCode have any impact on that ?

I have to have SFML working by the end of the week for a school project so if anyone could help me figure this out I'd be the happiest man on earth

Thanks

4
General / Re: Unable to compile SFML with Cmake and mingw32-make
« on: February 05, 2019, 04:43:04 pm »
Cool that'll be nice to know for next time  ;)

5
General / Re: Unable to compile SFML with Cmake and mingw32-make
« on: February 05, 2019, 02:17:44 pm »
OK I reinstalled Everything from scratch and I may not need to compile anymore. Keeping this post opened if someone has a suggestion for future people that might come across this same problem

6
General / Unable to compile SFML with Cmake and mingw32-make
« on: February 05, 2019, 01:27:33 pm »
Hey there,

I'm trying to make SFML work on my Windows 10 desktop and after having so many trouble with the already compiled version, I decided to compile it myself to make sure that it would be 100% compatible with my version of GCC.

However, here again and even precisely following the tutorial on how to compile SFML with Cmake, I'm encountering a problem: I've configured Cmake with MinGW Makefiles as generator, clicked on generate such that now I have "configuring done" and "generating done" printed in the box. However, when I open Powershell and enter "mingw32-make" it tells me "mingw32-make: *** No targets specified and no makefile found.  Stop.".

My PATH contains both the directories for Cmake and GCC so I doubt the problem comes from here though I see no "mingw32-make.exe" executable in the Cmake folder.

Do I have to execute the command from a particular working directory (the one which contains the sources maybe ?)

Please help

Have a nice day

Pages: [1]