Menu

Making libnoise on MinGW

Help
GrrBrr
2005-07-19
2013-04-30
  • GrrBrr

    GrrBrr - 2005-07-19

    I was trying for several weeks now to compile libnoise on the free Windows gcc MinGW, but i failed. Does anywone know how to do that?

     
    • Jason Bevins

      Jason Bevins - 2005-08-04

      Hi GrrBrr,

      cpinson created a new, improved makefile that hopefully will fix your problems.  It's not packaged yet, but you can use CVS to grab the latest version of libnoise.

      In Linux, you'd enter the following to compile libnoise:

      ./bootstrap
      configure
      make
      make install

      I'm not sure how this translates to MinGW since I'm a VC++ guy.

      Let me know if this helps.

      -- jas

       
    • sproaticus-2

      sproaticus-2 - 2006-01-10

      I'm using the latest "Current" MinGW, set up as described at http://www.mingw.org/MinGWiki/index.php/RealDumbQuickstart

      I've grabbed the latest source from CVS (Jan 9 2005) and built it, and it compiles without error.  (Note:  "./configure --prefix=/mingw --exec-prefix=/mingw", and you'll need doxygen installed and in your path in order to build and install.)

      My problem is, my programs won't link against libnoise.a.

      e.g.:

      ~/libnoise-tutorial $g++ -lnoise tutorial2.cpp
      C:/Temp/ccobbaaa.o(.text+0x131):tutorial2.cpp: undefined reference to `noise::module::Perlin::Perlin()'
      C:/Temp/ccobbaaa.o(.text$_ZN5noise6module6PerlinD1Ev[noise::module::Perlin::~Perlin()]+0xb):tutorial2.cpp: undefined reference to `vtable for noise::module::Perlin'
      C:/Temp/ccobbaaa.o(.text$_ZN5noise6module6PerlinD1Ev[noise::module::Perlin::~Perlin()]+0x16):tutorial2.cpp: undefined reference to `noise::module::Module::~Module()'
      collect2: ld returned 1 exit status

      ...It looks like ld is finding libnoise.a, but it can't find the symbols within it.

      source so far:

      #include <iostream>
      #include <noise/noise.h>
      using namespace noise;
      int main (int argc, char** argv)
      {
        module::Perlin myModule;
        return 0;
      }

      ...Help!

      - Sproaticus

       
    • Jeremy H. Sproat

      Okay, responding to my own post here, I seem to have a warning halfway through building libnoise.a:

      /bin/sh ../libtool --mode=link g++  -g -O2   -o libnoise.la -rpath /mingw/lib -version-info 0:0:0 latlon.lo noisegen.lo cylinder.lo line.lo plane.lo sphere.lo abs.lo add.lo billow.lo blend.lo cache.lo checkerboard.lo clamp.lo const.lo curve.lo cylinders.lo displace.lo exponent.lo invert.lo max.lo min.lo modulebase.lo multiply.lo perlin.lo power.lo ridgedmulti.lo rotatepoint.lo scalebias.lo scalepoint.lo select.lo spheres.lo terrace.lo translatepoint.lo turbulence.lo voronoi.lo 

      libtool: link: warning: undefined symbols not allowed in i686-pc-mingw32 shared libraries

      ...then the makefile continues running ar and ranlib, etc. without errors.

      - Sproaticus

       
    • David Taylor

      David Taylor - 2006-08-10

      I use the following makefile to compile 0.9 on mingw. It's a bit stupid but I'm no make expert. Luckily libnoise (at least 0.9) doesn't have any weird code in it so compiling it is pretty easy.

      Regards,
      David.

      CXXFLAGS = -ansi -O3 -fno-nonansi-builtins -fno-rtti -Wall
      VPATH = src;src/model;src/module

      OBJS = latlon.o noisegen.o cylinder.o line.o plane.o sphere.o abs.o add.o billow.o blend.o cache.o checkerboard.o clamp.o const.o curve.o cylinders.o displace.o exponent.o invert.o max.o min.o modulebase.o multiply.o perlin.o power.o ridgedmulti.o rotatepoint.o scalebias.o scalepoint.o select.o spheres.o terrace.o translatepoint.o turbulence.o voronoi.o noiseutils.o ptg.o
      DLL_OBJS = latlon.o noisegen.o cylinder.o line.o plane.o sphere.o abs.o add.o billow.o blend.o cache.o checkerboard.o clamp.o const.o curve.o cylinders.o displace.o exponent.o invert.o max.o min.o modulebase.o multiply.o perlin.o power.o ridgedmulti.o rotatepoint.o scalebias.o scalepoint.o select.o spheres.o terrace.o translatepoint.o turbulence.o voronoi.o noiseutils.o

      # This target makes a static library
      libnoise.a: $(OBJS)
          ar cru $@ $(OBJS)
          ranlib $@
          rm *.o

      # This target makes a DLL and a libnoise.a suitable for using that DLL. This is a very different
      # libnoise.a to the one generated in the above target.
      noise.dll: $(DLL_OBJS)
          gcc -shared -o noise.dll -Wl,--out-implib,libnoise.a $(DLL_OBJS) --strip-debug -lstdc++

       
      • Jason Bevins

        Jason Bevins - 2006-08-11

        Hi David,

        I don't know much about makefiles (I develop using Visual Studio project files), so do you think this would work under all UNIXes?  I know that there are several developers that are having problems with the existing makefiles.

        -- jas, libnoise project admin

         
    • David Taylor

      David Taylor - 2006-08-16

      This should work for *NIX people:

      CXXFLAGS = -ansi -O3 -fno-nonansi-builtins -fno-rtti -Wall
      VPATH = src src/model src/module

      OBJS = latlon.o noisegen.o cylinder.o line.o plane.o sphere.o abs.o add.o billow.o blend.o cache.o checkerboard.o clamp.o const.o curve.o cylinders.o displace.o exponent.o invert.o max.o min.o modulebase.o multiply.o perlin.o power.o ridgedmulti.o rotatepoint.o scalebias.o scalepoint.o select.o spheres.o terrace.o translatepoint.o turbulence.o voronoi.o

      # This target makes a static library
      libnoise.a: $(OBJS)
      ar cru $@ $(OBJS)
      ranlib $@

       

Log in to post a comment.