Libnoise - please help

Started by
9 comments, last by jpetrie 15 years ago
Hello. I downloaded a library called Libnoise that generates coherent noise. It can be used for landscapes, which is why I downloaded it. You can download it here: libnoise.sourceforge.net Anyways, I'm using Microsoft Visual Studio 2008. When I tried to compile the following code, #include "stdafx.h" #include <iostream> #include <noise.h> using namespace noise; int main (int argc, char** argv) { module::Perlin myModule; double value = myModule.GetValue (1.25, 0.75, 0.50); std::cout << value << std::endl; return 0; } I get the following errors: test2.obj : error LNK2019: unresolved external symbol "public: virtual double __thiscall noise::module::Perlin::GetValue(double,double,double)const " (?GetValue@Perlin@module@noise@@UBENNNN@Z) referenced in function _main test2.obj : error LNK2019: unresolved external symbol "public: __thiscall noise::module::Perlin::Perlin(void)" (??0Perlin@module@noise@@QAE@XZ) referenced in function _main test2.obj : error LNK2019: unresolved external symbol "public: virtual __thiscall noise::module::Module::~Module(void)" (??1Module@module@noise@@UAE@XZ) referenced in function "public: virtual __thiscall noise::module::Perlin::~Perlin(void)" (??1Perlin@module@noise@@UAE@XZ) I know I correctly linked all the directories. I've looked on other sites, and found no answer. I also made threads on all the other sides and nobody replied. Can somebody please help me with this? Thank you, it's very much appreciated.
Advertisement
Apparently, your compiler can't find the libnoise.dll - make sure you copied it into the correct directory, and added it to the linker.

Tristam MacDonald. Ex-BigTech Software Engineer. Future farmer. [https://trist.am]

It's in the correct directory. Everything is. I made sure to link everything. Just in case, the I would link the DLL under Library files, right?
Edit:

add the libnoise.lib to your Linker\Input\Additional Dependencies, with full path if needed.
What can I say? It worked. Thanks a lot guys, it was a huge help.
I didn't know whether to start another thread, so I'll revive this one. I've run into another problem when I added two more files to the Compiler's include directory: noiseutils.h and noiseutils.cpp. I'm getting the same type of error as above, but there isn't any library to include.

libnoise.obj : error LNK2019: unresolved external symbol "public: __thiscall noise::utils::NoiseMap::~NoiseMap(void)" (??1NoiseMap@utils@noise@@QAE@XZ) referenced in function _main

libnoise.obj : error LNK2019: unresolved external symbol "public: virtual void __thiscall noise::utils::NoiseMapBuilderPlane::Build(void)" (?Build@NoiseMapBuilderPlane@utils@noise@@UAEXXZ) referenced in function _main

libnoise.obj : error LNK2019: unresolved external symbol "public: __thiscall noise::utils::NoiseMapBuilderPlane::NoiseMapBuilderPlane(void)" (??0NoiseMapBuilderPlane@utils@noise@@QAE@XZ) referenced in function _main

libnoise.obj : error LNK2019: unresolved external symbol "public: __thiscall noise::utils::NoiseMap::NoiseMap(void)" (??0NoiseMap@utils@noise@@QAE@XZ) referenced in function _main

Any suggestions?

Quote:Original post by Panzer3133
...I added two more files to the Compiler's include directory: noiseutils.h and noiseutils.cpp.

Um, i don't think you should have a cpp in the include directory. The LibNoise documentation (assuming there is some) should tell you what .lib files to include and what header files to include.
[Window Detective] - Windows UI spy utility for programmers
Quote:Original post by XTAL256
Quote:Original post by Panzer3133
...I added two more files to the Compiler's include directory: noiseutils.h and noiseutils.cpp.

Um, i don't think you should have a cpp in the include directory. The LibNoise documentation (assuming there is some) should tell you what .lib files to include and what header files to include.


Whoops, my mistake. I meant to say that I've linked everything correctly. And there is barely any documentation.

You said that you moved the cpp file in the include directory, but do you actually compile it as well? Because that is what those linker errors along with your description tell me.
Quote:Original post by Panzer3133
there is barely any documentation.

Wow. I found libNoise to be uncommonly well documented, personally.

IIRC noiseutils isn't built into the dll, so you'll have to build it yourself. The simplest way to do this is to add the files to your project in msvc.

[size="1"]

This topic is closed to new replies.

Advertisement