Sign in to follow this  

libnoise linker problems, haven't a clue why

This topic is 3856 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi I am experiencing some linker problems with libnoise 1.0 and I have done what I usually do, but maybe there is something I have missed. It is only the stuff in the utils namespace that seem to cause problems. I am using VS2005 and here is what I have done. 1) In Project->Project Properties->C/C++->General, I have added the folder in where noiseutils.h is placed 2) In Project->Project Properties->Linker->Additional Library Directories, I have added the folder in where the libnoise.lib is placed 3) In Project->Project Properties->Linker->Input->Additional Dependencies, I have added libnoise.lib 4) The code that gets called is straight from Tutorial 3 on the libnoise site except for the bounds values changed
// includes
#include <iostream>

#include "noise/noise.h"
#include "noiseutils.h"

using namespace noise;

int main()
{
	module::Perlin myModule;
	
	utils::NoiseMap myNoisemap;
	utils::NoiseMapBuilderPlane heightMapBuilder;

	heightMapBuilder.SetSourceModule( myModule );
	heightMapBuilder.SetDestNoiseMap( myNoisemap );
	heightMapBuilder.SetDestSize( 256, 256 );
	heightMapBuilder.SetBounds( 2.0, 6.0, 1.0, 5.0 );
	heightMapBuilder.Build();

	utils::RendererImage renderer;
	utils::Image image;
	renderer.SetSourceNoiseMap( myNoisemap );
	renderer.SetDestImage( image );
	renderer.Render();

	utils::WriterBMP writer;
	writer.SetSourceImage( image );
	writer.SetDestFilename( "tutorial.bmp" );
	writer.WriteDestFile();

	system( "pause" );

	return 0;
}

This still causes error LNK2019: unresolved external symbol errors. What can be the problem?

Share this post


Link to post
Share on other sites
Sure.
main.obj : error LNK2019: unresolved external symbol "public: __thiscall noise::utils::NoiseMap::~NoiseMap(void)" (??1NoiseMap@utils@noise@@QAE@XZ) referenced in function _main
main.obj : error LNK2019: unresolved external symbol "public: __thiscall noise::utils::Image::~Image(void)" (??1Image@utils@noise@@QAE@XZ) referenced in function _main
main.obj : error LNK2019: unresolved external symbol "public: void __thiscall noise::utils::WriterBMP::WriteDestFile(void)" (?WriteDestFile@WriterBMP@utils@noise@@QAEXXZ) referenced in function _main
main.obj : error LNK2019: unresolved external symbol "public: void __thiscall noise::utils::RendererImage::Render(void)" (?Render@RendererImage@utils@noise@@QAEXXZ) referenced in function _main
main.obj : error LNK2019: unresolved external symbol "public: __thiscall noise::utils::Image::Image(void)" (??0Image@utils@noise@@QAE@XZ) referenced in function _main
main.obj : error LNK2019: unresolved external symbol "public: __thiscall noise::utils::RendererImage::RendererImage(void)" (??0RendererImage@utils@noise@@QAE@XZ) referenced in function _main
main.obj : error LNK2019: unresolved external symbol "public: virtual void __thiscall noise::utils::NoiseMapBuilderPlane::Build(void)" (?Build@NoiseMapBuilderPlane@utils@noise@@UAEXXZ) referenced in function _main
main.obj : error LNK2019: unresolved external symbol "public: __thiscall noise::utils::NoiseMapBuilderPlane::NoiseMapBuilderPlane(void)" (??0NoiseMapBuilderPlane@utils@noise@@QAE@XZ) referenced in function _main
main.obj : error LNK2019: unresolved external symbol "public: __thiscall noise::utils::NoiseMap::NoiseMap(void)" (??0NoiseMap@utils@noise@@QAE@XZ) referenced in function _main
main.obj : error LNK2019: unresolved external symbol "public: __thiscall noise::utils::GradientColor::~GradientColor(void)" (??1GradientColor@utils@noise@@QAE@XZ) referenced in function "public: __thiscall noise::utils::RendererImage::~RendererImage(void)" (??1RendererImage@utils@noise@@QAE@XZ)
C:\Documents and Settings\Søren\Desktop\Thesis\noisefun\libnoisetest\Debug\libnoisetest.exe : fatal error LNK1120: 10 unresolved externals

Share this post


Link to post
Share on other sites
Did you read this line of the tutorial?

Quote:
Once you download the noiseutils library, you'll need to add noiseutils.cpp to your project file


You do this by copying the noiseutils.cpp file to your project directory (where your main .cpp file is) and then right clicking on "Source Files" in the Solution Explorer and selecting "add->existing item" and then selecting noiseutils.cpp to be added.

Hope that helps.

Share this post


Link to post
Share on other sites

This topic is 3856 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this