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

Pages: [1] 2
1
General discussions / Re: Is there a way to render SVG files with SFML?
« on: October 09, 2016, 11:45:36 am »
Thanks, man! I think nanosvg will do just fine :)

2
General discussions / Is there a way to render SVG files with SFML?
« on: October 09, 2016, 10:55:45 am »
Or is there a library for that stuff that works well alongside SFML?

3
General / Re: Annoying error when I try to build my game, help please
« on: September 03, 2015, 03:35:04 am »
Please post in the help forum, the description of General Discussions is explicitly "For everything that is not a help request".

You cannot copy sf::RenderWindow, pass it to the function by reference.

I would also avoid #define for constants, global variables and ALL_CAPS for function names...
Sorry.
Well, thanks, I passed it by reference and now it's working. I changed the parameters of those functions from:
void MAIN_GAME_LOOP(sf::RenderWindow w)
to
void MAIN_GAME_LOOP(sf::RenderWindow& w)

4
General / Annoying error when I try to build my game, help please
« on: September 02, 2015, 12:06:35 pm »
So I get this weird error:
||=== Build: Debug in test (compiler: GNU GCC Compiler) ===|
C:\Games\SFML Games\Test\main.cpp||In function 'int main()':|
C:\Games\SFML Games\Test\main.cpp|15|error: use of deleted function 'sf::RenderWindow::RenderWindow(const sf::RenderWindow&)'|
C:\Program Files\SFML-2.3.1\include\SFML\Graphics\RenderWindow.hpp|44|note: 'sf::RenderWindow::RenderWindow(const sf::RenderWindow&)' is implicitly deleted because the default definition would be ill-formed:|
C:\Program Files\SFML-2.3.1\include\SFML\Graphics\RenderWindow.hpp|44|error: use of deleted function 'sf::Window::Window(const sf::Window&)'|
C:\Program Files\SFML-2.3.1\include\SFML\Window\Window.hpp|57|note: 'sf::Window::Window(const sf::Window&)' is implicitly deleted because the default definition would be ill-formed:|
C:\Program Files\SFML-2.3.1\include\SFML\System\NonCopyable.hpp|67|error: 'sf::NonCopyable::NonCopyable(const sf::NonCopyable&)' is private|
C:\Program Files\SFML-2.3.1\include\SFML\Window\Window.hpp|57|error: within this context|
C:\Program Files\SFML-2.3.1\include\SFML\Graphics\RenderWindow.hpp|44|error: use of deleted function 'sf::RenderTarget::RenderTarget(const sf::RenderTarget&)'|
C:\Program Files\SFML-2.3.1\include\SFML\Graphics\RenderTarget.hpp|51|note: 'sf::RenderTarget::RenderTarget(const sf::RenderTarget&)' is implicitly deleted because the default definition would be ill-formed:|
C:\Program Files\SFML-2.3.1\include\SFML\System\NonCopyable.hpp|67|error: 'sf::NonCopyable::NonCopyable(const sf::NonCopyable&)' is private|
C:\Program Files\SFML-2.3.1\include\SFML\Graphics\RenderTarget.hpp|51|error: within this context|
C:\Games\SFML Games\Test\gameloop.hpp|10|error:   initializing argument 1 of 'void MAIN_GAME_LOOP(sf::RenderWindow)'|
||=== Build failed: 8 error(s), 0 warning(s) (0 minute(s), 1 second(s)) ===|
 
This is my code:
main.cpp:
#include <SFML/Graphics.hpp>
#include "states.hpp"
#include "menus.hpp"
#include "gameloop.hpp"

#define WINDOW_WIDTH 640
#define WINDOW_HEIGHT 480

int main()
{
    sf::RenderWindow window(sf::VideoMode(WINDOW_WIDTH, WINDOW_HEIGHT), "Game");

    INIT_MENUS();

    MAIN_GAME_LOOP(window);

    return EXIT_SUCCESS;
}
 
gameloop.cpp(where the MAIN_GAME_LOOP and INIT_MENUS functions come from)
#include "gameloop.hpp"

void INIT_MENUS()
{
    Game::MenuButton start_button1("Start", 25, 150, 35, 20, Game::State::States::MAIN_MENU);

    manager.addButton(start_button1);
}

void MAIN_GAME_LOOP(sf::RenderWindow w)
{
    while (w.isOpen())
    {
        sf::Event e;
        while (w.pollEvent(e))
        {
            if (e.type == sf::Event::Closed)
            {
                w.close();
            }
        }
        manager.Update(w);
    }
}
 
I have no idea why I get this error, help please?

5
General / Re: How can I make a Dynamic array?
« on: August 29, 2015, 12:08:02 pm »
Ok I'll try using vector :)
something like this right?
#include <vector>
std::vector<int> a;

6
General / How can I make a Dynamic array?
« on: August 29, 2015, 09:14:21 am »
Whenever I try to do something like:
int something[];
it results in the error:
error: storage size of 'something' is unknown
So I'm forced to do something like
int something[100];
But I want that variable to be a dynamic array, like:(some pseudo-code)
int something;
something[2] = 1
something[101] = 5
something[3] = 4
I hope someone can help me with this :S

7
General / Re: Error when I try to execute my game
« on: August 28, 2015, 05:26:16 pm »
I tried to build SFML with cmake-gui, the build was successful but when I tried to make a simple test game to know if it works I get this error:
||=== Build: Debug in test (compiler: GNU GCC Compiler) ===|
C:\SFML\lib\libsfml-graphics-s-d.a(ImageLoader.cpp.obj)||In function `ZN2sf4priv11ImageLoader8writeJpgERKSsRKSt6vectorIhSaIhEEjj':|
C:\SFMLBUILD\src\SFML\Graphics\ImageLoader.cpp|277|undefined reference to `jpeg_std_error'|
C:\SFMLBUILD\src\SFML\Graphics\ImageLoader.cpp|280|undefined reference to `jpeg_CreateCompress'|
C:\SFMLBUILD\src\SFML\Graphics\ImageLoader.cpp|285|undefined reference to `jpeg_stdio_dest'|
C:\SFMLBUILD\src\SFML\Graphics\ImageLoader.cpp|286|undefined reference to `jpeg_set_defaults'|
C:\SFMLBUILD\src\SFML\Graphics\ImageLoader.cpp|287|undefined reference to `jpeg_set_quality'|
C:\SFMLBUILD\src\SFML\Graphics\ImageLoader.cpp|300|undefined reference to `jpeg_start_compress'|
C:\SFMLBUILD\src\SFML\Graphics\ImageLoader.cpp|306|undefined reference to `jpeg_write_scanlines'|
C:\SFMLBUILD\src\SFML\Graphics\ImageLoader.cpp|310|undefined reference to `jpeg_finish_compress'|
C:\SFMLBUILD\src\SFML\Graphics\ImageLoader.cpp|311|undefined reference to `jpeg_destroy_compress'|
||=== Build failed: 9 error(s), 0 warning(s) (0 minute(s), 1 second(s)) ===|
 
Here is my linker settings:

I don't know what I did wrong for those errors to come up :(
>>>>>>>>>>>>>>>EDIT<<<<<<<<<<<<<<<<<<<<<<<
@Mario OMG it worked! I copied the libstd thing from the mingw bin to my System32 folder(it replaced the one that was there) and now it works :))))))

8
General / Re: Error when I try to execute my game
« on: August 27, 2015, 12:28:09 pm »
Okay, take all the current ones you have in Test, out and put them in Debug, then put -s-d after all the SFML ones.
Ok, so I removed everything in Test then did that, no linker errors. But the same problem remains :(

@jamesL I'm gonna try that, maybe it'll work...

9
General / Re: Error when I try to execute my game
« on: August 27, 2015, 08:49:30 am »
Ok, so this is what I did now:

Then in the Release part:

Also, I was unsure of my MinGW GCC compiler version so I went to the command line and typed g++ --version, apparently my version now is 4.9.2 o.O

10
General / Re: Error when I try to execute my game
« on: August 27, 2015, 05:11:21 am »
The ones you're linking. You have to make sure SFML was compiled with the same standard library and the same compiler flags as your application.

If you don't know this term, you should probably spend a bit more time with C++ and compiler/linker basics before starting with SFML :)
Maybe this:(?)

I think I did that part correctly as I don't get any linker errors...

11
General / Re: Error when I try to execute my game
« on: August 26, 2015, 08:29:22 pm »
Compiler: MinGW GCC 4.8.1 (I think)
What do you mean by libraries ?

12
General / Error when I try to execute my game
« on: August 26, 2015, 05:32:15 pm »
So whenever I try to run the .exe of my game this happens:

How can I fix that? do I need to reinstall that libstdc++-6.dll or something?

13
General / Re: How to compile and run a game made with SFML?
« on: August 25, 2015, 11:01:19 am »
Ok, so I followed this in youtube and I almost done it, but there is 1 error left that is annoying me.
||=== Build: Debug in Test (compiler: GNU GCC Compiler) ===|
C:\Program Files\SFML-2.3.1\lib\libsfml-system-s-d.a(String.cpp.obj)||In function `ZNKSbIjSt11char_traitsIjESaIjEE8_M_checkEjPKc':|
C:\Dev\MinGW32-PosixDwarf492r2\i686-w64-mingw32\include\c++\bits\basic_string.h|324|undefined reference to `std::__throw_out_of_range_fmt(char const*, ...)'|
||=== Build failed: 1 error(s), 0 warning(s) (0 minute(s), 1 second(s)) ===|
 
How can I fix that?
Edit: Uh, bump. I still can't fix that problem. Help please.

14
General / Re: How to compile and run a game made with SFML?
« on: August 25, 2015, 07:06:14 am »
Nope, I have the 32-bit version of SFML.

15
General / Re: How to compile and run a game made with SFML?
« on: August 25, 2015, 06:41:37 am »
Ok I re-read the tutorial, added the dependencies in the project, but I got a new error:
||=== Build: Debug in Test (compiler: GNU GCC Compiler) ===|
obj\Debug\main.o||In function `main':|
C:\Games\SFML Games\Test\main.cpp|5|undefined reference to `sf::String::String(char const*, std::locale const&)'|
C:\Games\SFML Games\Test\main.cpp|5|undefined reference to `sf::VideoMode::VideoMode(unsigned int, unsigned int, unsigned int)'|
C:\Games\SFML Games\Test\main.cpp|5|undefined reference to `sf::RenderWindow::RenderWindow(sf::VideoMode, sf::String const&, unsigned int, sf::ContextSettings const&)'|
C:\Games\SFML Games\Test\main.cpp|6|undefined reference to `sf::CircleShape::CircleShape(float, unsigned int)'|
C:\Games\SFML Games\Test\main.cpp|7|undefined reference to `sf::Color::Green'|
C:\Games\SFML Games\Test\main.cpp|7|undefined reference to `sf::Shape::setFillColor(sf::Color const&)'|
C:\Games\SFML Games\Test\main.cpp|15|undefined reference to `sf::Window::close()'|
C:\Games\SFML Games\Test\main.cpp|12|undefined reference to `sf::Window::pollEvent(sf::Event&)'|
C:\Games\SFML Games\Test\main.cpp|18|undefined reference to `sf::Color::Color(unsigned char, unsigned char, unsigned char, unsigned char)'|
C:\Games\SFML Games\Test\main.cpp|18|undefined reference to `sf::RenderTarget::clear(sf::Color const&)'|
C:\Games\SFML Games\Test\main.cpp|19|undefined reference to `sf::RenderStates::Default'|
C:\Games\SFML Games\Test\main.cpp|19|undefined reference to `sf::RenderTarget::draw(sf::Drawable const&, sf::RenderStates const&)'|
C:\Games\SFML Games\Test\main.cpp|20|undefined reference to `sf::Window::display()'|
C:\Games\SFML Games\Test\main.cpp|9|undefined reference to `sf::Window::isOpen() const'|
C:\Games\SFML Games\Test\main.cpp|23|undefined reference to `sf::RenderWindow::~RenderWindow()'|
C:\Games\SFML Games\Test\main.cpp|23|undefined reference to `sf::RenderWindow::~RenderWindow()'|
C:\Games\SFML Games\Test\main.cpp|23|undefined reference to `sf::RenderWindow::~RenderWindow()'|
obj\Debug\main.o||In function `ZN2sf11CircleShapeD1Ev':|
C:\Program Files\SFML-2.3.1\include\SFML\Graphics\CircleShape.hpp|41|undefined reference to `vtable for sf::CircleShape'|
C:\Program Files\SFML-2.3.1\include\SFML\Graphics\CircleShape.hpp|41|undefined reference to `vtable for sf::CircleShape'|
C:\Program Files\SFML-2.3.1\include\SFML\Graphics\CircleShape.hpp|41|undefined reference to `sf::Shape::~Shape()'|
||=== Build failed: 20 error(s), 0 warning(s) (0 minute(s), 0 second(s)) ===|
 
I don't how to fix that D:

Pages: [1] 2