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

Author Topic: Unresolved external thor-d.dll  (Read 5045 times)

0 Members and 1 Guest are viewing this topic.

magneonx

  • Full Member
  • ***
  • Posts: 141
    • MSN Messenger - magnumneon04@hotmail.com
    • View Profile
Unresolved external thor-d.dll
« on: September 14, 2014, 06:01:48 am »
Hey I need help, I am building Thor-master.  I used the SFML-master to build the 'latest' version of Thor. I remember I have to link Thor to Master version SFML when Thor using CMake looks for it. Generating project from CMake works fine but when I compiled it using Visual Studio 2013 this is what I get:

Error   2   error LNK1120: 1 unresolved externals   C:\libraries\Thor\build\branches\Thor-master-build\src\Debug\thor-d.dll   1   1   thor
Error   1   error LNK2019: unresolved external symbol "__declspec(dllimport) float __cdecl sf::operator/(class sf::Time,class sf::Time)" (__imp_??Ksf@@YAMVTime@0@0@Z) referenced in function "float __cdecl thor::getElapsedRatio(class thor::Particle const &)" (?getElapsedRatio@thor@@YAMABVParticle@1@@Z)   C:\libraries\Thor\build\branches\Thor-master-build\src\Particle.obj   thor

I badly needed thor right now. How can I resolve this?

Thanks.

magneonx

  • Full Member
  • ***
  • Posts: 141
    • MSN Messenger - magnumneon04@hotmail.com
    • View Profile
Re: Unresolved external thor-d.dll
« Reply #1 on: September 14, 2014, 06:15:45 am »
I checked my CMake config and it seems I forgot to remove the check on the THOR_SHARED_LIBS and it works now. Thanks!

magneonx

  • Full Member
  • ***
  • Posts: 141
    • MSN Messenger - magnumneon04@hotmail.com
    • View Profile
Re: Unresolved external thor-d.dll
« Reply #2 on: September 14, 2014, 07:40:59 am »
Hmmm I don't know if I got this to work. I've already created a new project. I've set up thor and sfml. Is there a sample HELLO WORLD code for Thor to check if this works??? I look on the tutorials and seems none of the syntax being recognize. I just wanna know how you set up Thor with SFML master version and VS 2013 Express. This is really eating up a lot of my time :(.

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 11029
    • View Profile
    • development blog
    • Email
AW: Unresolved external thor-d.dll
« Reply #3 on: September 14, 2014, 08:52:26 am »
Thor comes with some examples, you could just copy&paste that into VS. ;)
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

magneonx

  • Full Member
  • ***
  • Posts: 141
    • MSN Messenger - magnumneon04@hotmail.com
    • View Profile
Re: Unresolved external thor-d.dll
« Reply #4 on: September 14, 2014, 09:25:35 am »
Yeah I realized that one too. Hmm I really can't get it to work. I just got a bunch of dll errors.

So heres what I done.

I exactly followed the tutorial on the web. So here is the steps to reproduce:

1. I go download the latest SFML version here https://github.com/SFML/SFML.
2. I downloaded the latest Thor version here https://github.com/Bromeon/Thor.
3. I build SFML with CMake. It builds fine.
4. I build Thor using CMake:

I exactly followed the picture on the Thor website. I didn't tick any checkbox as indicated specially on THOR_SHARED_LIBS. Building docs and examples causes massive headaches for me. I don't need them for now. I just wanted to build this library!

When I clicked configure, it looks for FreeType, Glew, JPEG, OpenAL, SNDFile libraries. I know where to find them. Its on extlibs/msvc/x64 folder in SFML source directory.

5. I added SFML/extlibs/msvc/x64 into the SFML root since it looks for those libraries.
6. I replaced CMAKE_INSTAL_PREFIX with the one I preferred.
7. I redirected SFML_INCLUDE_DIR to the include directory of the master file.

I configured it successfully and generated the project files needed to compile Thor using MSVS 2012 as the generator. I am using Visual Studio 2013.

So I ran the project. I didn't get any errors yey! But when I look at the lib folder. There is no dll on it. Only Object File Library. I don't know if this is the actual result. I am new to VS, though I am expecting .dlls similar to my recently rebuilt SFML.

I also setup my Visual studio to accomodate Thor.
Project Properties > C/C++ > Additional Include Directories > I added
SFML-master\include and Thor-master\include.

On Linker settings > Additional Library Directories > I added the SFML and Thor's lib folder. This is for both Release and Debug.

I compiled a very simple project. It says it cannot find Aurora. So I knew from here there is something wrong. I believe Aurora came along with SFML. Anyway, I downloaded Aurora from the website as well. Added the Aurora path to include path.

I compiled it again, it no longer looks for Aurora. But it gives me an error.

Error   3       error LNK1120: 2 unresolved externals Thor1.exe 1       1       Sample Thor1
Error   2       error LNK2019: unresolved external symbol "__declspec(dllimport) public: __thiscall sf::Texture::~Texture(void)" (__imp_??1Texture@sf@@QAE@XZ) referenced in function _main    
Error   1       error LNK2019: unresolved external symbol "__declspec(dllimport) public: __thiscall C:\Users\Neon Warge\Documents\Visual Studio 2013\Projects\Sample Thor1\main.obj     Sample Thor1

So I went to checkout if I missed something. I am frustrated and started experimenting. I checked back THOR_SHARED_LIBS and it seems to work ok. I compiled it and I never encountered those error again. But I have a new errors. Division error, a change in SFML or Thor causes this and this can be fixed by downloading the master version right? I have already post a thread regarding that one and told me to compile SFML and Thor master file using CMake.

I just realized up to now I still encountered the error. I need the latest SFML and Thor to be working together. I have a deadline to meet and this eats a lot of my time.

Please let me know if I missed something. I will gladly appreciate any help.

Thank you so much guys. Sorry for the long post.

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 11029
    • View Profile
    • development blog
    • Email
AW: Unresolved external thor-d.dll
« Reply #5 on: September 14, 2014, 12:56:33 pm »
If you don't tick THOR_BUILD_SHARED you'll be creating static libraries. DLLs are dynamic libraries and not static ones.
Personally I advise people to either build everything static or everything dynamic, unless they really know what they're doing.

If you want to go the static way, you need to build SFML static as well and you won't end up with DLLs. You also need to define SFML_STATIC and THOR_STATIC. Additionally you need to link all of SFML's dependencies.

If all doesn't work, you could use my Nightly Builds.
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

magneonx

  • Full Member
  • ***
  • Posts: 141
    • MSN Messenger - magnumneon04@hotmail.com
    • View Profile
Re: Unresolved external thor-d.dll
« Reply #6 on: September 14, 2014, 07:09:02 pm »
If you don't tick THOR_BUILD_SHARED you'll be creating static libraries. DLLs are dynamic libraries and not static ones.
Personally I advise people to either build everything static or everything dynamic, unless they really know what they're doing.

If you want to go the static way, you need to build SFML static as well and you won't end up with DLLs. You also need to define SFML_STATIC and THOR_STATIC. Additionally you need to link all of SFML's dependencies.

If all doesn't work, you could use my Nightly Builds.

Hi,

Make sense. So by your explanation, what I really wanted is shared_library. That's what  I did now, I get this error:

Error   1       error LNK2019: unresolved external symbol "__declspec(dllimport) float __cdecl sf::operator/(class sf::Time,class sf::Time)" (__imp_??Ksf@@YAMVTime@0@0@Z) referenced in function "float __cdecl thor::getElapsedRatio(class thor::Particle const &)" (?getElapsedRatio@thor@@YAMABVParticle@1@@Z)      C:\libraries\Thor\build\branches\Thor-master-build\src\Particle.obj     thor
 

I already build a fresh copy of SFML master and Thor master. Anything I've missed so far? It cannot link to division operator from sf::Time. I've checked the file and it has definition for two sf::Time division. I wonder what I did wrong.

Give me links to your nightly builds.
« Last Edit: September 14, 2014, 07:11:24 pm by magneonx »

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 11029
    • View Profile
    • development blog
    • Email
AW: Unresolved external thor-d.dll
« Reply #7 on: September 14, 2014, 07:20:27 pm »
Are you sure you're giving Thor the uptodate SFML header files? The division operator came after SFML 2.1 IIRC, thus if you by accident use SFML 2.1 headers instead of the master ones, it might be missing.

The link to my Nightly Builds is in my signature: http://www.nightlybuilds.ch/
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

magneonx

  • Full Member
  • ***
  • Posts: 141
    • MSN Messenger - magnumneon04@hotmail.com
    • View Profile
Re: Unresolved external thor-d.dll
« Reply #8 on: September 14, 2014, 09:25:25 pm »
Are you sure you're giving Thor the uptodate SFML header files? The division operator came after SFML 2.1 IIRC, thus if you by accident use SFML 2.1 headers instead of the master ones, it might be missing.

The link to my Nightly Builds is in my signature: http://www.nightlybuilds.ch/

Ohhh, alright. How can I make sure I am using the right headers? The right headers from SFML master? I am pretty sure it is of SFML master. Please advise.

magneonx

  • Full Member
  • ***
  • Posts: 141
    • MSN Messenger - magnumneon04@hotmail.com
    • View Profile
Re: Unresolved external thor-d.dll
« Reply #9 on: September 14, 2014, 09:28:33 pm »
Thanks, yeah I got the links from your signature. If this failed to work I am just going to download your nb and be gone with this. I am just finishing off my project.

magneonx

  • Full Member
  • ***
  • Posts: 141
    • MSN Messenger - magnumneon04@hotmail.com
    • View Profile
Re: Unresolved external thor-d.dll
« Reply #10 on: September 15, 2014, 06:05:17 am »
@eXpl0it3r I've sent you PM. I got virus from your SFML Visual Studio 2013 32 bit build. The latest one. Is this normal? I turned off my shield as of the moment and currently downloading. The link has been banned by my Avast webshield. Please advise.

EDIT:

I just figured out the sound.exe is being identified as a threat by avast. I just excluded example from being extracted. You might want to check on this one. Other examples are quite fine though.
« Last Edit: September 15, 2014, 06:11:14 am by magneonx »

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 11029
    • View Profile
    • development blog
    • Email
AW: Re: Unresolved external thor-d.dll
« Reply #11 on: September 15, 2014, 06:40:43 am »
I just figured out the sound.exe is being identified as a threat by avast. I just excluded example from being extracted. You might want to check on this one. Other examples are quite fine though.
Yeah some AV go crazy about some self compiled applications. Not much I can do though, I just build from source...
If you can, it might help to report the deyection as false-positive.
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/