Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: Assertion when passing string across a .dll boundary  (Read 2776 times)

0 Members and 1 Guest are viewing this topic.

Kanefa

  • Jr. Member
  • **
  • Posts: 51
    • View Profile
Assertion when passing string across a .dll boundary
« on: October 14, 2014, 11:58:14 am »
I am having an assertion when using sf::Text::getString().  I have attached an image of the message.

mText.setString("Hello");
std::string text = mTextLine.getString();  // Assertion!

Besides calling sf::Text::getString() everything is working fine when I use sf::Text. 

Searching around I found a similar issues on stackoverflow. http://stackoverflow.com/questions/18882760/debug-assertion-failed-expression-pfirstblock-phead I am having the same problem, "it blows up at the precise point where I pass a string back across a .dll boundary."

I have verified I have Multi-threaded Debug DLL (/MDd) set.  I have rebuilt SFML-2.1 with Visual Studio 2013.  Still the problem persists.

I am out of ideas.  Anyone have experience with this?

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Re: Assertion when passing string across a .dll boundary
« Reply #1 on: October 14, 2014, 12:02:30 pm »
What was the value of the SFML_USE_STATIC_STD_LIBS CMake option when you rebuilt SFML?
Are you sure that you use the debug libraries in debug mode?
Laurent Gomila - SFML developer

Kanefa

  • Jr. Member
  • **
  • Posts: 51
    • View Profile
Re: Assertion when passing string across a .dll boundary
« Reply #2 on: October 14, 2014, 12:23:26 pm »
Quote
What was the value of the SFML_USE_STATIC_STD_LIBS CMake option when you rebuilt SFML?
I left it unchecked.

Quote
Are you sure that you use the debug libraries in debug mode?
Yes, they are set to sfml-audio-d.lib, sfml-graphics-d.lib, sfml-system-d.lib, and sfml-window-d.lib.

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 11030
    • View Profile
    • development blog
    • Email
AW: Assertion when passing string across a .dll boundary
« Reply #3 on: October 14, 2014, 12:30:24 pm »
You don't have by chance any other SFML DLLs in PATH?
Where do you place the freshly built DLLs?
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

Kanefa

  • Jr. Member
  • **
  • Posts: 51
    • View Profile
Re: Assertion when passing string across a .dll boundary
« Reply #4 on: October 14, 2014, 12:55:52 pm »
Quote
You don't have by chance any other SFML DLLs in PATH?
That was the problem.

Thanks for the responses.