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

Pages: [1]
1
General / own dll using SFML results in linker error
« on: April 25, 2015, 05:03:32 pm »
Hello,

I have used SFML in several projects before. But in my current project I want to create a new dll which also includes SFML. Before I did that I tried everything without SFML(creating own dll and using it in another projekt) and that worked fine. I can also compile my dll itself without any errors. But when I try to compile the project, which uses both, SFML and my own dll(reminder: dll also uses SFML) I get this error:

"Fehler   7   error C1083: Datei (Include) kann nicht geöffnet werden: "SFML\Graphics.hpp": No such file or directory"
(Translates into something like: "Error  7   error C1083: File (Include) can not be opened: "SFML\Graphics.hpp": No such file or directory")

And this intellisense error:
"IntelliSense: Die Datei "Quelle" kann nicht geöffnet werden: "SFML\Graphics.hpp"."
(Translates into something like: "IntelliSense: The file "source" can not be openend: "SFML\Graphics.hpp".")


It also sais, that these errors occur in files of my own dll. But like I said I can compile the dll itself without problems.

I assume that I link SFML correctly because I can compile the dll and I have linked it correctly in the last couple of years.


Some data:
using Windows 8.1, VC++ (Visual Studio 2013 Professional Update 4), linking SFML dynamicly into both my dll and my project using the dll, both projects are in one solution

I want to thank anybody who tries to help me :) And please just ask if you need any more information.

ERROR

2
Graphics / Re: VertexArray change Vertices
« on: August 28, 2014, 10:19:43 am »
Well, the problem occurs in the first line which is "Vertices.clear();".

3
Graphics / VertexArray change Vertices
« on: August 26, 2014, 08:02:02 pm »
Hey Guys,

I wrote my own Text class which draws a string that came from a png file as a VertexArray. Font is also my own class.

This is the class:

class Text : public sf::Drawable, public sf::Transformable
{
public:
        bool load(std::string text, Font font);
        bool load(std::string text, Font font, sf::IntRect bounds);
        bool ChangeText(std::string text, Font font, sf::IntRect bounds);
private:
        virtual void draw(sf::RenderTarget& target, sf::RenderStates states) const
        {
                //apply the transformation
                states.transform *= getTransform();

                //apply the Font Texture
                states.texture = &FontTexture;

                //draw the vertex array
                target.draw(Vertices, states);
        }

        sf::Texture FontTexture;
        sf::VertexArray Vertices;
};

This is how I fill the VertexArray:

//define the 4 corners of the quad
                        sf::Vector2f topleft = sf::Vector2f(curRec.left, curRec.top);
                        sf::Vector2f  topright = sf::Vector2f(curRec.left + curRec.width, curRec.top);
                        sf::Vector2f  bottomright = sf::Vector2f(curRec.left + curRec.width, curRec.top + curRec.height);
                        sf::Vector2f  bottomleft = sf::Vector2f(curRec.left, curRec.top + curRec.height);



                        //define the 4 texture coordinates
                        sf::Vector2f tex_topleft = sf::Vector2f(rect.left, rect.top);
                        sf::Vector2f  tex_topright = sf::Vector2f(rect.left + rect.width, rect.top);
                        sf::Vector2f  tex_bottomright = sf::Vector2f(rect.left + rect.width, rect.top + rect.height);
                        sf::Vector2f  tex_bottomleft = sf::Vector2f(rect.left, rect.top + rect.height);

                        Vertices.append(sf::Vertex(topleft, tex_topleft));
                        Vertices.append(sf::Vertex(topright, tex_topright));
                        Vertices.append(sf::Vertex(bottomright, tex_bottomright));
                        Vertices.append(sf::Vertex(bottomleft, tex_bottomleft));

It works fine, but when I try to change the displayed text, my program crashes. To change the text I obviously call the "Text::ChangeText" method. At the beginning oft he method I call "Vertices.clear();" and when the programm trys to execute this line it crahs.
When I don't call the clear() method the displayed text doesn't change at all. For example I want to display "Gold:100" and change it to "Gold:90" but it stays at "Gold100".

What am i doing wrong?

4
General / Re: SFML 2.0 in QT Creator
« on: June 17, 2013, 11:51:35 pm »
I am sorry, but I have to push this thread.

It just won't work. I tried it for days now with all kinds of other setups in the pro file, but still the same. I also tried other SFML bindings but nothing helped. I have also rewritten my first post and I hope it is now good enough ;)

5
General / SFML 2.0 in QT Creator
« on: June 13, 2013, 09:59:53 pm »
Hey Guys,
I am using SFML 2.0 in QT Creator 2.7.0. Well, actually I would like to ;).

I dowloaded this : http://sfml-dev.org/download/sfml/2.0/SFML-2.0-windows-gcc-4.7-mingw-32bits.zip
I am using MinGW 4.7 in QT Creator.

And this is the code in my .pro file:

TEMPLATE = app
CONFIG += console
CONFIG -= app_bundle
CONFIG -= qt

SOURCES += main.cpp


# SFML
CONFIG(release, debug|release): LIBS += -lsfml-audio -lsfml-graphics -lsfml-network -lsfml-window -lsfml-system
CONFIG(debug, debug|release): LIBS += -lsfml-audio-d -lsfml-graphics-d -lsfml-network-d -lsfml-window-d -lsfml-system-d

# Windows
LIBS += -LE:/Coden/SFML/SFML_2_MinGW/lib
INCLUDEPATH += E:/Coden/SFML/SFML_2_MinGW/include
DEPENDPATH += E:/Coden/SFML/SFML_2_MinGW/include
 

And this is the code in the main.cpp
#include <iostream>
#include <SFML/Graphics.hpp>
using namespace std;

int main()
{
    sf::VideoMode VMode(500,800);
    sf::RenderWindow Window(VMode,"Stoppuhr"); //Creating window
    while(Window.isOpen())
    {
        Window.clear();
        Window.display();
    }
    cout << "Hello World!" << endl;
    return 0;
}

It builds properly, but when I start the program the window doesn't even show up. There is just the cmd which says "Press enter to close the window". If I start in Debug I get this error message:"During start up program exited with code 0x0000135"

Could anyone please help me out with that?

Additional infomation:
I tried this on my PC and on my Laptop.
Both are state of the art ;)
SFML runs in VS (with another SFML folder I did not mix them or anything)
I tried it for days now.Please somebody help me

6
Graphics / Re: small part of an image
« on: April 21, 2013, 02:12:18 pm »
Thanks ;).

I knew it would be really easy, but I just didn't know which function I had to use.


Thanks again.

7
Graphics / small part of an image
« on: April 21, 2013, 01:40:20 pm »
Hey,

I am trying to make a button and the letters should be taken from a big image. I already have the image with the whole alphabet in it. My problem is that I don't know how to make a small sprite out of the big one.

Hope somebody can help me with that problem.

Pages: [1]
anything