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

Pages: [1]
1
General / Re: BSOD destroying linker. Unsure where to go from here.
« on: May 27, 2018, 05:24:20 am »
Yes you are, I left quite a bit out so that's my fault. It was an issue with an old AMD graphics card I had specially configured with catalyst control. I accidentally let Windows 10 update and I knew it would happen at some point because older AMD isn't supported by Windows 10. lol  I already had an extra GPU if by chance I slip up.

The download labeled "Visual C++ 14 (2015) - 32-bit" won't work on my version? I have other versions of VS, if I should just move to VS 2017 I can do that.

Okay then. Thanks for the quick response (and sorry mine was slow).

2
General / BSOD destroying linker. Unsure where to go from here.
« on: May 26, 2018, 11:11:23 pm »
This is similar to the topic found here: https://en.sfml-dev.org/forums/index.php?topic=20675.0  where I can push back an sf::text and get a bad_alloc...in my classes, that is. But it's even worse in main, where I get an error i can't even properly describe off the top of my head (it's in the attachment) and I've been running this project for nearly a year now, so unfortunately the error isn't caused by something as simple as mixing libraries.


What I BELIEVE is the issue is that some kind of file is corrupted. But I do not like operating off of believes, not with software at least. I'm trying not to move anything until I know for sure what's really going on here.

FYI, after the BSOD I had Windows 10 "reset", which removed all apps but kept the files. I reinstalled Visual Studio and when I opened the project all of my linking information was still intact, as was the folder where everything was kept.

And yes, there were external backups. Seven to be specific, I tried three others(2 off USB the other an exHDD) and they are undergoing the same issue.

Is my only choice to reinstall again and get a new set of SFML modules here?

3
General / .cpp syntax for reference initialization
« on: April 13, 2018, 10:20:08 pm »
I am following a guide on SFML and have met a pitfall. From what I understand, the writer was using psuedocode since his original code was:

class World : private sf::NonCopyable
{
public:
explicit World(sf::RenderWindow& window);


private:
sf::RenderWindow& mWindow;

};

I believe this is psuedocode because you have to initialize a reference first.

So I consulted my Stroustrup book and found that I can do it like this.

    #pragma once
    #include <SFML/Graphics/RenderWindow.hpp>


        class Renderer : private sf::NonCopyable
        {

        public:

                Renderer();  

                Renderer(sf::RenderWindow &newWindow) :renderWindow(newWindow) {}

                ~Renderer();


        private:


                sf::RenderWindow& renderWindow;

        };


But I am missing the syntax for the cpp file, I get errors for these.

        Renderer::Renderer() {}


        Renderer::~Renderer()
        {
        }
 
Quote
'Renderer::renderWindow;' references must be initialized

I've searched for a few hours for the answer, but either I am god awful at using keywords or it's just not an easy topic to find. Any help, suggestions or criticisms are greatly appreciated.

4
This isn't the first sf::Text I've used in my program though, so I'm a little confused. I will go check on things just to be sure though.

5
Yes other vectors are working I have texture and sprite vectors in the main code that are working fine and the string vector itself does have the element I passed to it. I checked using cout. This string and text vector are the only vectors I am passing as a reference to a function though.

Here is the full call stack.



#0 0x401353   __gnu_cxx::__exchange_and_add(__mem=0xfffffffc, __val=-1) (C:/Program Files (x86)/CodeBlocks/MinGW/lib/gcc/mingw32/4.9.2/include/c++/ext/atomicity.h:49)

#1 0x4013a3   __gnu_cxx::__exchange_and_add_dispatch(__mem=0xfffffffc, __val=-1) (C:/Program Files (x86)/CodeBlocks/MinGW/lib/gcc/mingw32/4.9.2/include/c++/ext/atomicity.h:82)

#2 0x46189f   std::basic_string<unsigned int, std::char_traits<unsigned int>, std::allocator<unsigned int> >::_Rep::_M_dispose(this=0xfffffff4, __a=...) (C:/Program Files (x86)/CodeBlocks/MinGW/lib/gcc/mingw32/4.9.2/include/c++/bits/basic_string.h:246)

#3 0x4618f5   std::basic_string<unsigned int, std::char_traits<unsigned int>, std::allocator<unsigned int> >::~basic_string(this=0x79fad4, __in_chrg=<optimized out>) (C:/Program Files (x86)/CodeBlocks/MinGW/lib/gcc/mingw32/4.9.2/include/c++/bits/basic_string.h:547)

#4 0x4395cf   sf::String::~String(this=0x79fad4, __in_chrg=<optimized out>) (C:/Users/User/Documents/SFML/SFML-2.4.2-windows-gcc-4.9.2-tdm-32-bit/SFML-2.4.2/include/SFML/System/String.hpp:45)


#5 0x4391af   sf::Text::~Text(this=0x79fa28, __in_chrg=<optimized out>) (C:/Users/User/Documents/SFML/SFML-2.4.2-windows-gcc-4.9.2-tdm-32-bit/SFML-2.4.2/include/SFML/Graphics/Text.hpp:48)


#6 0x409c1b   main(argc=1, argv=0xe2f88) (C:\Users\User\Documents\SFML\main.cpp:2785)



6
That I have done. I've even removed the while loop and made each vector one element only just to see what would happen. Still the same thing.


It always points to this line in 'Atomicity.h '

{ return __atomic_fetch_add(__mem, __val, __ATOMIC_ACQ_REL); }


7
Wow I am literally hallucinating. Checked several times before submitting the post and afterwards but it's not there.

Edited.

8
Hello all. I have a segmentation fault that I've been trying to narrow down for a while now. Now that I have the culprit, I am in dismay because I was sure that this was valid code. I have used vectors of sprites/vectors of textures to set and display objects before, but I did not think that this was needed with sf::Text, not in this context at least.

Here is a smaller version of the code I was using which reproduces the fault.


Assume that every line had a breakpoint, I have a marked in a comment where the segfault happens.


Quote
#include <iostream>
#include <vector>
#include <fstream>
#include <numeric>
#include <SFML/Graphics.hpp>
#include <SFML/Audio.hpp>
#include <ostream>
#include <fstream>
#include <SFML/Window.hpp>



void hope(std::vector<std::string>& stringVector, std::vector<sf::Text> &theTextVector){

            int tempCounter=0;
    int textVectorCounter=theTextVector.size();
    textVectorCounter--;

    while(tempCounter<=textVectorCounter){

 theTextVector[tempCounter].setString(stringVector[tempCounter]);
 tempCounter++;}
        }  //Segmentation fault happens here.




}




Quote

int main()
{

 



sf::Text theText;

    std::vector<std::string> stringVector;

    stringVector.push_back("Hello.");
stringVector.push_back("How are you?");
stringVector.push_back("You're fine, thank you.");




std::vector<sf::Text> theTextVector(3);



hope(stringVector, theTextVector);



    std::cout<< stringVector[1];


    return 0;

}



While both vectors do end up within a new scope, they both come from outside of it and are both passed by reference. I thought that this was reason enough to make the code valid.

Thanks in advance for any replies.

Pages: [1]