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

Author Topic: Run time error sfml-network-d-2.dll is missing  (Read 8668 times)

0 Members and 1 Guest are viewing this topic.

eduquint

  • Newbie
  • *
  • Posts: 4
    • View Profile
    • Email
Run time error sfml-network-d-2.dll is missing
« on: July 29, 2014, 05:28:47 am »
Hi,

I just wrote my first SFML based C++ program.
It simply open a socket and try some operations.

It compiles and links with no problem. I have added the sfml-network-d.lib and sfml-system-d.lib additional dependencies and additional include directory as instructed in your site.

But, when I try to run the program, it show the run time error sfml-nework-d-2.dll is missing and do not run (see attached image).

What I am missing here?

I am using VS 2013 Professional Edition, with Windows 8.1 update 1 64 bits. My program is 32-bit and the sfml libraries are the latest nigthly build (2014-06-30), because I only have VS 2013 to work with.

Thanks for any hints.

Eduardo Quintana
« Last Edit: July 29, 2014, 05:30:32 am by eduquint »

Sub

  • Full Member
  • ***
  • Posts: 157
    • View Profile
Re: Run time error sfml-network-d-2.dll is missing
« Reply #1 on: July 29, 2014, 05:39:44 am »
It sounds like you're dynamically linking, which means that you need to put the SFML .dll files in the directory you're running the application. 

Taken from Stack Overflow:
When you statically link a file into an executable, the contents of that file are included at link time. In other words, the contents of the file are physically inserted into the executable that you will run.

When you link dynamically, a pointer to the file being linked in (the file name of the file, for example) is included in the executable and the contents of said file are not included at link time. It's only when you later run the executable that these dynamically linked files are bought in and they're only bought into the in-memory copy of the executable, not the one on disk.

http://stackoverflow.com/questions/311882/what-do-statically-linked-and-dynamically-linked-mean

Also, does SFML work with VS 2013? 
« Last Edit: July 29, 2014, 05:47:07 am by Sub »

eduquint

  • Newbie
  • *
  • Posts: 4
    • View Profile
    • Email
Re: Run time error sfml-network-d-2.dll is missing
« Reply #2 on: July 29, 2014, 06:21:53 am »
Thanks for your prompt reply.

Indeed I am using dynamic linking, but even when I add both files to the debug dir, it does not run and the error is the same. See attached directory list.

Eduardo Quintana

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32504
    • View Profile
    • SFML's website
    • Email
Re: Run time error sfml-network-d-2.dll is missing
« Reply #3 on: July 29, 2014, 07:36:42 am »
Do you run your executable from the IDE, or from the explorer?
Laurent Gomila - SFML developer

eduquint

  • Newbie
  • *
  • Posts: 4
    • View Profile
    • Email
Re: Run time error sfml-network-d-2.dll is missing
« Reply #4 on: July 29, 2014, 02:13:51 pm »
The problem is exactly the same in both cases.

Peteck

  • Jr. Member
  • **
  • Posts: 55
    • View Profile
Re: Run time error sfml-network-d-2.dll is missing
« Reply #5 on: July 29, 2014, 02:21:06 pm »
Please read the error.  "sfml-network-d-2.dll" is missing.


You have added the "sfml-network-2.dll" to the directory.

eduquint

  • Newbie
  • *
  • Posts: 4
    • View Profile
    • Email
Re: Run time error sfml-network-d-2.dll is missing
« Reply #6 on: July 29, 2014, 03:04:00 pm »
Hi Laurent,

I even tried to statically link both dlls, adding the static preprocessor definition and changing the lib files to the xxx-s-d.lib ones. The compiler detected a lot of errors, more than 50. So I went back to dynamically linking.

Of course, I am doing something wrong, something very basic, but I cannot identify what.

Thanks for your support.

Eduardo Quintana

Strelok

  • Full Member
  • ***
  • Posts: 139
    • View Profile
    • GitHub
Re: Re: Run time error sfml-network-d-2.dll is missing
« Reply #7 on: July 29, 2014, 03:14:32 pm »
Hi Laurent,

I even tried to statically link both dlls, adding the static preprocessor definition and changing the lib files to the xxx-s-d.lib ones. The compiler detected a lot of errors, more than 50. So I went back to dynamically linking.

Of course, I am doing something wrong, something very basic, but I cannot identify what.

Thanks for your support.

Eduardo Quintana
Read @Peteck's reply

G.

  • Hero Member
  • *****
  • Posts: 1590
    • View Profile
Re: Run time error sfml-network-d-2.dll is missing
« Reply #8 on: July 29, 2014, 06:10:39 pm »
I even tried to statically link both dlls, adding the static preprocessor definition and changing the lib files to the xxx-s-d.lib ones. The compiler detected a lot of errors, more than 50. So I went back to dynamically linking.
https://github.com/SFML/SFML/wiki/FAQ#build-link-static
When statically linking SFML, you need to link additional things. It's not in the 2.1 tutorial because the change was made after 2.1.