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

Pages: [1]
1
General / Re: Problem with MSVCP140d.dll
« on: June 05, 2019, 10:02:27 pm »
If you statically link the core/standard C++ libraries then SFML needs to be built with that in mind so you will need to build SFML yourself.
Ok. I'll try it.
But let me know something: everybody needs to do it, or it is specific for my computer?

2
General / Re: Problem with MSVCP140d.dll
« on: June 05, 2019, 04:46:02 pm »
Firstly, thank you two for help.

I'll also note that msvc140d.dll is the debug version (there's a d on the end). You can't redistribute these, you need to rebuild in release mode before putting it on your other computer. Then installing vc_redist.exe from the Microsoft website on your other computer should fix your problem.

I need to install vc_reddist.exe in every computer I send my program? :/
I chose to static link SFML to make my program simple...
There is no other way to fix it?


I believe that to be the Visual Studio C++ runtime. It's the core C++ code and is needed to run any Visual Studio program.
To be clear, I presume you are statically linking SFML. You can, also, however, statically link the C++ core runtime. This is separate from statically linking SFML although you should also build SFML with the correct flag for doing so.

I tried to statically link C++ as you told me, but now, for some reason, the building doesn't work! A lot of linking errors appears...
This is the tutorial I followed to static link C++: https://linustechtips.com/main/topic/622425-how-to-configure-static-linking-in-visual-studio/
What could I do next?

3
General / Problem with MSVCP140d.dll
« on: June 02, 2019, 06:53:32 pm »
Hello everybody.

Well. I installed SFML in Visual Studio with Static Link.
When I compile and run SFML programs on my computer, everything works.
The problem happens when I send my program to other computers and try to execute it: a missing "MSVCP140D.dll" warning appears...

Someone could help me?

I use Visual Studio 2017 and SFML 2.5.1

4
General / Re: Problems with Executable
« on: February 18, 2019, 12:31:23 pm »
Code Blocks probably sets the working directory to the project root ($(PROJECT_ROOT)), where the dll's are currently placed. When launching the program manually the working directory is $(PROJECT_ROOT)\bin\Debug. Try copying the executable to the $(PROJECT_ROOT) and see if that fixes it (so copy the .exe to the folder with the dll's in it).

Hi. It's been a long time since you answered me...
I'm sorry...

Well, are you telling me to do this? (image)
Because it doesn't work. The same problem happens... :/

Thank you to be trying to help me!

5
General / Problems with Executable
« on: December 17, 2018, 04:00:28 pm »
Hello everyone!

Well, here is my problem:
When I run an SFML code within Code Blocks, everything works, but when I click on the executable (project > bin > debug >> sfml_code.exe). An error message appears saying that some DLLs couldn't be found. So I copy and paste the requested DLLs in the same directory where the executable is. Then I tried to execute the program again and a new error message appeared. I couldn't understand what the message means...
There are some images: https://drive.google.com/open?id=1hPkEREKYqu2iOFgeTYABX5-pVDR8Nay9
(look at the titles)

Thanks in advance o/

6
General / Re: Executable Tutorial
« on: December 16, 2018, 12:07:31 am »
Well that's more or less the whole point of Code::Blocks. Once you build your code, it will spit out an executable. If you don't understand that concept yet, then I suggest to first learn about it before touching anything SFML. ;)

You can find a tutorial on how to setup Code::Blocks to link SFML here: https://www.sfml-dev.org/tutorials/2.5/start-cb.php

So... I already know where to find an executable created by Code Blocks.
Console Programs work perfectly... But I'm having problems specifically with SFML executables...

When I run an SFML code within Code Blocks, everything works. The problem happens when I click on the executable (project > bin > debug >> sfml_code.exe). An error message appears saying that some DLLs couldn't be found. So I copy and paste the requested DLLs in the same directory where the executable is. After, I tried to execute the program again and a new error message appeared. I couldn't understand it...
There are some images: https://drive.google.com/open?id=1hPkEREKYqu2iOFgeTYABX5-pVDR8Nay9
(look at the titles)

7
General / Executable Tutorial
« on: December 15, 2018, 08:20:52 pm »
Hi everybody.

I've searched for some tutorial which shows how to make an executable from an SFML code in Code Blocks, but I can't find something like this...

Do you know a tutorial which could help me?

8
General / Re: How do I make a text box which only accepts numbers?
« on: December 08, 2018, 12:30:57 am »
I may be misunderstanding your code, but why this
else if (regex_match(iNbr, isI))
 
instead of something like this?
else if (regex_match(e.text.unicode, isI))
 

What a gross mistake!
You were right! It was the main problem! xP
Well, even then I had other problems: when I replaced "iNbr" by "e.text.unicode", occurred an incompatibility problem. So I tried to use isdigit again. I'd tried to use isdigit before, but the same problem (text box froze) had happened. That was happening because I was committing the same mistake writing isdigit(iNbr). Then, I did this:

[...]

                  } else {

                        string check = "";
                        check += e.text.unicode; //key pressed is armazenated in check.

                        //if check is a digit, its value is added to iNbr:
                        if (isdigit(check)){

                            iNbr += check;
                            n.setString(iNbr);

                        }

                    }

[...]


 

But another problem occurred: isdigit only accepts char. Nevertheless, it was easy to fix:

[...]

                    } else {

                        char check = '\0';
                        check += e.text.unicode; //key pressed is armazenated in check.

                        //if check is a digit, its value is added to iNbr:
                        if (isdigit(check)){

                            iNbr += check;
                            n.setString(iNbr);

                        }

                    }

[...]


 

Now it's working! ><'

Well, thank you very much. You all helped me a lot :) o/

9
General / Re: How do I make a text box which only accepts numbers?
« on: December 07, 2018, 09:21:11 pm »
I believe you can use std::regex_match (c++11) to check if the caracters entered are digits. The actual pattern would be something as simple as this: "^\d$". You can then check for every key that is typed if it is a digit and not write it if it is not.

Hi.
I tried to implement regex in my code, but it still doesn't work...
The problem is that the text box stops to accept any input when I try to apply the regex feature...
If it's not too much to ask, I wish you could take a look at my code...


[...]

                case Event::TextEntered: {

                    regex isI ("[[digit]]+"); //regex deffinition

                    if (e.text.unicode == '\b'){ //backsapace

                            if (iNbr.size() > 0)
                            {
                            iNbr.erase(iNbr.size() -1);
                            n.setString(iNbr);
                            }

                    } else if (regex_match(iNbr, isI)) { //regex_match

                        iNbr += e.text.unicode;
                        n.setString(iNbr);

                    }

                break;}

[...]

 

If necessary, here is the entire code:
(click to show/hide)

10
General / Re: How do I make a text box which only accepts numbers?
« on: December 06, 2018, 08:42:31 pm »
I believe you can use std::regex_match (c++11) to check if the caracters entered are digits. The actual pattern would be something as simple as this: "^\d$". You can then check for every key that is typed if it is a digit and not write it if it is not.

Thank you! I wasn't familiarized with regex! I don't know how to use this yet, but you put me on the right path. All I need to do now is read about regex...

Thank you again! :)
o/

11
General / Re: How do I make a text box which only accepts numbers?
« on: December 06, 2018, 12:17:41 am »
It isn't clear in your question whether or not your struggling to make a text box, or if you've solved that part but are now struggling to limit it to only accepting numbers. Can you provide more details on exactly what you're having trouble with and what you've tried?

To create a basic text box you'll probably want to draw a sf::RectangleShape to represent the box, sf::Text to show the text inside of the text box, and use events to know when the textbox has been clicked on (for focus) and to know when the user is typing something. You can specifically listen for the the sf::Event::TextEntered event and only process ones that contain a number.

Alternatively you could use an existing GUI library like Imgui, TGUI, or SFGUI.

I'm sorry for not expressing myself clearly ><
It was my bad english...
I'm struggling to limit the text box to only accept numbers... I had no problem coding the text box itself.

12
General / How do I make a text box which only accepts numbers?
« on: December 05, 2018, 10:35:35 pm »
Hi, everybody! o/

My question is quite simple:

How do I code a text box which only accepts numbers?

I'm trying to make a dice roller, and I'm having trouble with it...

Thanks in advance.

Pages: [1]