Menu

libnoise library help

2009-03-04
2012-09-26
  • Logan vonBabylon

    I'm starting a very large project that relies heavily on coherent noise for simple terrain generation. I found this library that seemed like it would work perfect:

    libnoise.sourceforge.net

    I downloaded it, and put the headers/lib/dll files in their correct locations. Of course, I'm using Dev-C++ 4.9.9.2. There are tutorials on the libnoise website. I copied the simplest one I could find, tutorial 2 (http://libnoise.sourceforge.net/tutorials/tutorial2.html) into Dev-C++. I hit compile, and I get this error:

    [Linker error] undefined reference to noise::module::Perlin::Perlin()' [Linker error] undefined reference tonoise::module::Perlin::GetValue(double, double, double) const'
    [Linker error] undefined reference to vtable for noise::module::Perlin' [Linker error] undefined reference tonoise::module::Module::~Module()'
    ld returned 1 exit status

    I tweaked the code a lot, nothing helped. I know I linked the correct directories. Can somebody download this library and tell me if they got the same result? Is there a way I can fix this? If not, is there any other library out there like this?

    Thanks, guys. I appreciate the help very much.

     
    • cpns

      cpns - 2009-03-05

      May I suggest a simpler path. Just installing MinGW/Msys is not to be taken lightly, it conly concievably mess up your Dev-C++ installation, and if you kind of have to know what you are doing with it to make it useful.

      I took a look at teh project it is not that complex, and I am sure that you could build it as a Dev-C++ DLL project as I described. I no longer bother do not install Dev-C++, but I did download the source and build it with Microsoft's free VC++ 2008 Express. To do that simply open the libnoise.dsw workspace file. VC++ 2008 will offer to convert it to a VC++ 'Solution', this works without any problems. Next you have to remove the noise.rc file from the project; it is unused guff that MS Appstudio would have generated in the older version, but it is not needed. It then builds without error. Whether it works is another matter, I have not tested it.

      I suggest that if you want to use Dev-C++ that you create a DLL project File->New->Project->Windows DLL. Set the language to C++, and give the project the name libnoise and click OK. Close and discard the autogenerated template code that Dev-C++ provides and all all teh sources except noise.rc to your project. Attempt to build that, and post teh Compile Log here if you get errors.

      When successful, you will need to link the libnoise.a export library, and have the DLL in the project folder or in a system path, and of course include any necessary library headers.

      Clifford

       
    • cpns

      cpns - 2009-03-04

      Its a linker error; tweaking the code will have no effect.

      ALWAYS post the complete "Compile Log" as requested in the "PLEASE READ BEFORE POSTING A QUESTION" thread. That is the text from the "Compile Log" tab, not the "Compiler" tab.

      The libraries home page says that it has been tested on "Microsoft Visual C++ 5.0", which suggests that any export library provided will have been built for that compiler. It will not work with MinGW without converting it with reimp.exe, but that won't work since it looks like the DLL contains C++ interfaces.

      Your best best is to rebuild the library from source. VC++ 5.0 is pretty ancient in any case, so a rebuild would be a good idea any how.

       
      • Logan vonBabylon

        Oh. Sorry about that.

        I've downloaded the sources, but how would I rebuild it? Google isn't really helping.

        Thank you.

         
        • Wayne Keen

          Wayne Keen - 2009-03-04

          I tend to use my stand-alone installation of MinGW/MSYS for such tasks and do the "standard" command line magic of:

          ./configure
          make
          make install

          to build libraries from source under GCC on windows.

          Wayne

           
          • Logan vonBabylon

            I downloaded MinGW from www.mingw.org. When cpns said I need to rebuild the library from source, does that mean the Sources file in noise/src? I entered "make Sources" in the command line, but it tells that a whole list of .d files are missing.

             
    • cpns

      cpns - 2009-03-04

      Without downloading the source I could not tell. If it is a simple build you may be able to use either the standard DLL or static library project template and add the source code to it.

       
    • Wayne Keen

      Wayne Keen - 2009-03-05

      Most libraries have a readme file that tells you what to do.

      Many, libraries, you, at the top level directory, enter

      ./configure

      which creates a makefile, so you can do a

      make
      make install

      Note that I said MinGW/MSYS - you really need to install MSYS to support doing this sort of operation.

      Wayne

       

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.