Missing MSVCP120D.dll
« on: 16 February 2014, 04:07:40 »
Hello,
Trying to follow the tutorial but I keep getting the following error message:


The program can't start because MSVCP120D.dll is missing from your computer. Try reinstalling the program to fix this problem.


here is my code
Code: [Select]
#include <SFML\Graphics.hpp>
#include <TGUI\TGUI.hpp>
#include <iostream>


int main()
{
sf::Vector2f screenDimensions(800, 600);
sf::RenderWindow Window;
Window.create(sf::VideoMode(screenDimensions.x, screenDimensions.y), "TGUI Tutorial 1");
tgui::Gui gui;

  gui.setGlobalFont("TGUI-0.6.1/fonts/DejaVuSans.ttf");

while(Window.isOpen())
{
sf::Event Event;
while(Window.pollEvent(Event))
{
switch(Event.type)
{
case sf::Event::Closed:
Window.close();
break;

case sf::Event::KeyPressed:
if(Event.key.code == sf::Keyboard::Escape)
Window.close();
break;

}

gui.handleEvent(Event);

}

Window.clear();
gui.draw();
Window.display();

}


 
return 0;
}



When I remove the gui object, the window opens up perfectly.
(Comment out gui object)
Code: [Select]

//tgui::Gui gui;
.
.
// gui.setGlobalFont("TGUI-0.6.1/fonts/DejaVuSans.ttf");
.
.
//gui.handleEvent(Event);
.
.
//gui.draw();



I am using Visual Studio 2012 with Windows 8. Its a 64 bit system.

*

texus

  • *****
  • 1163
    • View Profile
    • Texus's Blog
Re: Missing MSVCP120D.dll
« Reply #1 on: 16 February 2014, 12:10:46 »
Quote
I am using Visual Studio 2012
Quote
The program can't start because MSVCP120D.dll is missing
This looks strange to me, because MSVCP120D.dll is from Visual Studio 2013.

So are you perhaps using the tgui libraries for VS2013 instead of these for VS2012?

Re: Missing MSVCP120D.dll
« Reply #2 on: 16 February 2014, 21:34:59 »
Thanks for the response, texus, much appreciated.

I changed it this morning. Originally when I  downloaded TGUI I used the Visual C++ 12 (2013) version instead of the Visual C++ 11 (2012). I think that was the problem but I have another problem.

In my console prompt it reads:

TGUI error: Failed to parse TGUI/widgets/Black.png


I placed a copy of the TGUI-0.6.1 folder in my projects folder for easier access(Renamed it to TGUI).
The tutorial from the site says the path is:

TGUI/widgets/Button/Black


When I follow that path, the Button folder doesn't have a Black image. I found one but its located in the widgets folder.

Here is my current source code:
Code: [Select]
#include <SFML\Graphics.hpp>
#include <TGUI\TGUI.hpp>
#include <iostream>

using std::cout;
using std::endl;

void LoadWidgets(tgui::Gui & gui);


int main()
{
sf::Vector2f screenDimensions(800, 600);
sf::RenderWindow Window;
Window.create(sf::VideoMode(screenDimensions.x, screenDimensions.y), "TGUI Tutorial");
sf::Font font;
sf::Text text;

if(!font.loadFromFile("DejaVuSans.ttf"))
cout << "Couldn't load font." << endl;


    tgui::Gui gui(Window);
    gui.setGlobalFont(font);


while(Window.isOpen())
{
Window.clear();
sf::Event Event;
while(Window.pollEvent(Event))
   {
   switch(Event.type)
  {
   case sf::Event::Closed:
   Window.close();
   break;

   case sf::Event::KeyPressed:
   if(Event.key.code == sf::Keyboard::Escape)
   Window.close();
   break;
   
  }

gui.handleEvent(Event);

   }
       

LoadWidgets(gui);
gui.draw();


Window.display();
}


 return 0;
}


void LoadWidgets(tgui::Gui & gui)
{
tgui::Picture::Ptr picture(gui, "Background Image");
picture->load("Galaxy.png");
picture->setSize(800, 600);

tgui::Label::Ptr labelUsername(gui);
labelUsername->setText("Username: ");
labelUsername->setPosition(200, 100);

tgui::Label::Ptr labelPassword(gui);
labelPassword->setText("Password: ");
labelPassword->setPosition(200, 250);

// The Edit Box for the username
tgui::EditBox::Ptr editBoxUsername(gui, "Username");
editBoxUsername->load("TGUI/widgets/Black.conf");
editBoxUsername->setSize(400, 40);
editBoxUsername->setPosition(200, 140);

// The Edit Box for the password
tgui::EditBox::Ptr editBoxPassword = gui.copy(editBoxUsername, "Password");
editBoxPassword->setPosition(200, 290);
editBoxPassword->setPasswordCharacter('*');

tgui::Button::Ptr button(gui);
button->load("TGUI/widgets/Black.png");
button->setSize(260, 60);
button->setPosition(270, 440);
button->setText("Login");
}




Code: [Select]
tgui::Button::Ptr button(gui);
button->load("TGUI/widgets/Black.png");
button->setSize(260, 60);
button->setPosition(270, 440);
button->setText("Login");

 I followed the tutorials on starting and working with TGUI.
« Last Edit: 17 February 2014, 07:32:58 by Czar05 »

*

texus

  • *****
  • 1163
    • View Profile
    • Texus's Blog
Re: Missing MSVCP120D.dll
« Reply #3 on: 17 February 2014, 09:44:53 »
Quote
The tutorial from the site says the path is:
TGUI/widgets/Button/Black
Which page on my site says that?
Is it possible that you are looking at a tutorial for TGUI v0.5 instead of v0.6? A lot has changed between these versions.

Quote
In my console prompt it reads:
TGUI error: Failed to parse TGUI/widgets/Black.png
It took my a moment to realize what is wrong with this. You need to load a config file, not an image. The config file will tell tgui which images to load and which parts of the images should be shown. So you have to load "TGUI/widgets/Black.conf" instead.

Make sure to follow these introduction tutorials: https://tgui.eu/tutorials/v06/.
« Last Edit: 09 March 2014, 00:18:49 by texus »

Re: Missing MSVCP120D.dll
« Reply #4 on: 17 February 2014, 21:27:42 »
@texus,

Thanks for the response, it was really helpful.