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

Pages: [1]
1
Graphics / Undefined References
« on: June 16, 2020, 02:37:54 am »
I recently Included SFML to a new Project in VS code. My IDE lists no errors but my compiler keeps throwing these errors:
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/10.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:\Users\ezj21\AppData\Local\Temp\ccZt3gio.o:main.cpp:(.text+0x5ce): undefined reference to `__imp__ZN2sf6StringC1EPKcRKSt6locale'
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/10.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:\Users\ezj21\AppData\Local\Temp\ccZt3gio.o:main.cpp:(.text+0x5f2): undefined reference to `__imp__ZN2sf9VideoModeC1Ejjj'
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/10.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:\Users\ezj21\AppData\Local\Temp\ccZt3gio.o:main.cpp:(.text+0x633): undefined reference to `__imp__ZN2sf12RenderWindowC1ENS_9VideoModeERKNS_6StringEjRKNS_15ContextSettingsE'
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/10.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:\Users\ezj21\AppData\Local\Temp\ccZt3gio.o:main.cpp:(.text+0x887): undefined reference to `__imp__ZNK2sf6Window6isOpenEv'
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/10.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:\Users\ezj21\AppData\Local\Temp\ccZt3gio.o:main.cpp:(.text+0x8a3): undefined reference to `__imp__ZN2sf6Window9pollEventERNS_5EventE'
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/10.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:\Users\ezj21\AppData\Local\Temp\ccZt3gio.o:main.cpp:(.text+0x8be): undefined reference to `__imp__ZN2sf6Window5closeEv'
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/10.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:\Users\ezj21\AppData\Local\Temp\ccZt3gio.o:main.cpp:(.text+0x8ec): undefined reference to `__imp__ZN2sf5ColorC1Ehhhh'
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/10.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:\Users\ezj21\AppData\Local\Temp\ccZt3gio.o:main.cpp:(.text+0x907): undefined reference to `__imp__ZN2sf12RenderTarget5clearERKNS_5ColorE'
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/10.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:\Users\ezj21\AppData\Local\Temp\ccZt3gio.o:main.cpp:(.text+0x917): undefined reference to `__imp__ZN2sf6Window7displayEv'
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/10.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:\Users\ezj21\AppData\Local\Temp\ccZt3gio.o:main.cpp:(.text+0x944): undefined reference to `__imp__ZN2sf12RenderWindowD1Ev'
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/10.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:\Users\ezj21\AppData\Local\Temp\ccZt3gio.o:main.cpp:(.text+0xa2b): undefined reference to `__imp__ZN2sf12RenderWindowD1Ev'
collect2.exe: error: ld returned 1 exit status
I have consulted tons of help threads and out of desperation included all of the lib files and possible SFML dependencies I could think of in my compiler command line but I have had no luck so far and it keeps throwing the same errors. If anyone has any sort of idea of a possible fix please do not hesitate to throw it at me.

2
Graphics / Re: Image Stretch with window resize
« on: January 29, 2020, 01:56:08 am »
Thanks, it helped. I was thinking something similar, but I couldn't find the right variable to draw to make it work. Like I didn't know
window.getSize().x
was a thing.

3
Graphics / Image Stretch with window resize
« on: January 28, 2020, 11:58:18 pm »
I was a bit unsure of whether to post this in Graphics or Window, but I think this will be the most relevant. I'm using SFML in C++and ran into an issue. How and I prevent my Images from resizing themselves? What I mean is that when I load a sprite, in this case a rectangle with a logo on it, how can I prevent it from being stretch with the window.
It should look like:
What it does look like:

Does anyone have any suggestions? I've already tried setting a sf::View, which did not work.

4
General / Re: Installing SFML for VS Code
« on: January 24, 2020, 01:23:57 am »
Now it gives me a long list of undefined references, but I got the code from the SFML Page:
https://www.sfml-dev.org/tutorials/2.5/start-vc.php @bottom
C:\Users\ezj21\AppData\Local\Temp\cc861KBj.o:main.cpp:(.text+0x83): undefined reference to `__imp__ZN2sf6StringC1EPKcRKSt6locale'
C:\Users\ezj21\AppData\Local\Temp\cc861KBj.o:main.cpp:(.text+0xa7): undefined reference to `__imp__ZN2sf9VideoModeC1Ejjj'
C:\Users\ezj21\AppData\Local\Temp\cc861KBj.o:main.cpp:(.text+0xeb): undefined reference to `__imp__ZN2sf12RenderWindowC1ENS_9VideoModeERKNS_6StringEjRKNS_15ContextSettingsE'
C:\Users\ezj21\AppData\Local\Temp\cc861KBj.o:main.cpp:(.text+0x127): undefined reference to `__imp__ZN2sf11CircleShapeC1Efy'
C:\Users\ezj21\AppData\Local\Temp\cc861KBj.o:main.cpp:(.text+0x130): undefined reference to `__imp__ZN2sf5Color5GreenE'
C:\Users\ezj21\AppData\Local\Temp\cc861KBj.o:main.cpp:(.text+0x13e): undefined reference to `__imp__ZN2sf5Shape12setFillColorERKNS_5ColorE'
C:\Users\ezj21\AppData\Local\Temp\cc861KBj.o:main.cpp:(.text+0x151): undefined reference to `__imp__ZNK2sf6Window6isOpenEv'
C:\Users\ezj21\AppData\Local\Temp\cc861KBj.o:main.cpp:(.text+0x170): undefined reference to `__imp__ZN2sf6Window9pollEventERNS_5EventE'
C:\Users\ezj21\AppData\Local\Temp\cc861KBj.o:main.cpp:(.text+0x18e): undefined reference to `__imp__ZN2sf6Window5closeEv'
C:\Users\ezj21\AppData\Local\Temp\cc861KBj.o:main.cpp:(.text+0x1bc): undefined reference to `__imp__ZN2sf5ColorC1Ehhhh'
C:\Users\ezj21\AppData\Local\Temp\cc861KBj.o:main.cpp:(.text+0x1da): undefined reference to `__imp__ZN2sf12RenderTarget5clearERKNS_5ColorE'
C:\Users\ezj21\AppData\Local\Temp\cc861KBj.o:main.cpp:(.text+0x1e3): undefined reference to `__imp__ZN2sf12RenderStates7DefaultE'
C:\Users\ezj21\AppData\Local\Temp\cc861KBj.o:main.cpp:(.text+0x1fc): undefined reference to `__imp__ZN2sf12RenderTarget4drawERKNS_8DrawableERKNS_12RenderStatesE'  
C:\Users\ezj21\AppData\Local\Temp\cc861KBj.o:main.cpp:(.text+0x20f): undefined reference to `__imp__ZN2sf6Window7displayEv'
C:\Users\ezj21\AppData\Local\Temp\cc861KBj.o:main.cpp:(.text+0x238): undefined reference to `__imp__ZN2sf12RenderWindowD1Ev'
C:\Users\ezj21\AppData\Local\Temp\cc861KBj.o:main.cpp:(.text+0x294): undefined reference to `__imp__ZN2sf12RenderWindowD1Ev'
C:\Users\ezj21\AppData\Local\Temp\cc861KBj.o:main.cpp:(.text$_ZN2sf11CircleShapeD1Ev[_ZN2sf11CircleShapeD1Ev]+0xf): undefined reference to `__imp__ZTVN2sf11CircleShapeE'
C:\Users\ezj21\AppData\Local\Temp\cc861KBj.o:main.cpp:(.text$_ZN2sf11CircleShapeD1Ev[_ZN2sf11CircleShapeD1Ev]+0x21): undefined reference to `__imp__ZTVN2sf11CircleShapeE'
C:\Users\ezj21\AppData\Local\Temp\cc861KBj.o:main.cpp:(.text$_ZN2sf11CircleShapeD1Ev[_ZN2sf11CircleShapeD1Ev]+0x3b): undefined reference to `__imp__ZN2sf5ShapeD2Ev'
collect2.exe: error: ld returned 1 exit status

I don't know why I'm having so much trouble

5
General / Re: Installing SFML for VS Code
« on: January 23, 2020, 11:19:34 pm »
I wrote this as a batch file:
g++ main.cpp -IC:\SFML-2.5.1\include\SFML\Graphics.hpp -o hero.exe resources\hero.res
and tried to to compile the following code(gotten from SFML website):
#include <SFML/Graphics.hpp>

int main()
{
    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;
}
It returns the error:
C:\Users\ezj21\OneDrive\Desktop\Utilities\Coding\LearningC++>g++ main.cpp -IC:\SFML-2.5.1\include\SFML\Graphics.hpp -o hero.exe resources\hero.res
cc1plus.exe: warning: C:\SFML-2.5.1\include\SFML\Graphics.hpp: not a directory
main.cpp:1:10: fatal error: SFML/Graphics.hpp: No such file or directory
 #include <SFML/Graphics.hpp>
          ^~~~~~~~~~~~~~~~~~~
compilation terminated.
Am I doing something wrong?

6
General / Re: Installing SFML for VS Code
« on: January 22, 2020, 02:47:15 am »
I tried several Google searches, all of which either came up with information on extensions, or were for VS and not VS Code. I've even tried adding SFML into my compiler's file to no avail.

7
General / Installing SFML for VS Code
« on: January 21, 2020, 03:24:53 pm »
I am attempting to use SFML for my next project, however I have yet to find reliable information on how to install SFML for MinGW, the page on the main SFML website for SFML is for using code::blocks, and I would prefer to keep using VS Code if I could. Additionally all of the tutorials for Visual Studio are not for VS Code. I was hoping that someone who has installed it could guide me through the steps they used to install it. Thanks.

I am on Windows.

Pages: [1]
anything