mingw-cross-env-list
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Mingw-cross-env-list] OpenCSG again


From: Brad Pitcher
Subject: Re: [Mingw-cross-env-list] OpenCSG again
Date: Mon, 19 Sep 2011 22:20:38 -0700

Unfortunately I am no expert regarding OpenCSG. For me, it is just a requirement of OpenSCAD (www.openscad.org). Once I am able to build that I will know for sure if everything is working. It has a few other requirements that I am working on. I have them all building, but I wonder if they have actually built statically because I get a slew of errors when linking, just like I did when linking the opencsg example. This time the errors talk about a different library (CGAL) not being able to find some boost stuff, so I guess that just means I need to add something like DEFINES += BOOST_STATIC when compiling CGAL? It's a cmake built project though, I don't know how to configure that.

Regarding OpenCSG, is it good for inclusion? Here is my latest cleaned up make file (apologies if the white space gets filled with garbage again):
# This file is part of mingw-cross-env.
# See doc/index.html for further information.

# libopencsg
PKG             := libopencsg
$(PKG)_IGNORE   :=
$(PKG)_VERSION  := 1.3.1
$(PKG)_CHECKSUM := d94c22d4e824c6b5e69a97a726b514ecaf9e4596
$(PKG)_SUBDIR   := OpenCSG-$($(PKG)_VERSION)
$(PKG)_FILE     := OpenCSG-$($(PKG)_VERSION).tar.gz
$(PKG)_WEBSITE  := http://www.opencsg.org/
$(PKG)_URL      := http://www.opencsg.org/$($(PKG)_FILE)
$(PKG)_DEPS     := gcc freeglut glew qt

define $(PKG)_UPDATE
    wget -q -O- 'http://www.opencsg.org/#download' | \
    grep 'OpenCSG-' | \
    $(SED) -n 's,.*OpenCSG-\([0-9][^>]*\)\.tar.*,\1,p' | \
    head -1
endef

define $(PKG)_BUILD
    cd '$(1)/src' && $(SED) -i 's/release/release staticlib\nDEFINES += FREEGLUT_STATIC GLEW_STATIC/g' src.pro
    cd '$(1)/example' && $(SED) -i 's,\(lGLEW\),\1 -lglut -lglu32 -lopengl32 -lwinmm -lgdi32\nDEFINES += FREEGLUT_STATIC GLEW_STATIC,g' example.pro
    cd '$(1)/example' && $(SED) -i 's,opencsgexample,test-libopencsg\nRelease:DESTDIR = $(PREFIX)/$(TARGET)/bin/,g' example.pro
    cd '$(1)/src' && '$(TARGET)-qmake' src.pro && $(MAKE) -C '$(1)/src' -j '$(JOBS)'
    cd '$(1)/example' && '$(TARGET)-qmake' example.pro && $(MAKE) -C '$(1)/example' -j '$(JOBS)'
    $(INSTALL) -m644 '$(1)/lib/libopencsg.a' '$(PREFIX)/$(TARGET)/lib/'
    $(INSTALL) -m644 '$(1)/include/opencsg.h' '$(PREFIX)/$(TARGET)/include/'
endef

On Mon, Sep 19, 2011 at 5:39 PM, René Berber <address@hidden> wrote:
On 9/19 Sep 2011 23:39:27, Tony Theodore wrote:

> It seems freeglut is the culprit here, it wasn't being built
> statically in the first place. I've added a test program for both this
> and glew:

Maybe so, but the real problem was really a user error, Brad has the
wrong order of libraries to link (Windows is different in this than
Linux, order is important), in example.pro:

LIBS        += -lglut -L../lib -lopencsg

is wrong, I changed it to:

LIBS        += -L../lib -lopencsg -lGLEW -lglut

still no go, Qt adds the dependencies before...

> http://hg.savannah.gnu.org/hgweb/mingw-cross-env/rev/df85f59a791d
> http://hg.savannah.gnu.org/hgweb/mingw-cross-env/rev/cad00a9e1f6d
>
> Fortunately, glew has a pkg-config entry, but something like this:
>
> -lglut -lglu32 -lopengl32 -lwinmm -lgdi32 -mwindows -DFREEGLUT_STATIC
>
> from the test program works for freeglut.

So now with:

LIBS        += -L../lib -lopencsg -lGLEW -lglut -lglu32 -lopengl32
-lwinmm -lgdi32

it works!  A nice rotating solid on Windows (several, chosen with
right-mouse menu.)

Actually if it really works is left for an expert, Brad?  Concave shape
with CSG algorithms looks different (not solid) than Goldfeather.
--
René Berber




reply via email to

[Prev in Thread] Current Thread [Next in Thread]