vterrain and openFrameworks

hi to all, i’m trying to develop and addon based on vTerrain software http://vterrain.org/ , with which you can import maps terrain from DEM or other sources (and even custom made maps…) i can explain or better i can do a little tutorial for this. Bu t the reason of this thread is another. I receive an error while i compile the code because i think there is some C files that need to be excluded from source. I’m working on linux 64bit Ubuntu 12.04 , but i tested also in windows with VS2010 compiler. It was easier to solve in VS2010 because you can exclude the files from properties windows, but it’s a bit harder for me with makefiles. I tried with EXCLUDE_FROM_SOURCE but i get the same error. What’s wrong here?
this is the error that i receive:

  
------------- Build: Debug in libopenFrameworks ---------------  
  
Target is up to date.  
  
-------------- Build: Debug in vterrain ---------------  
  
Using makefile: Makefile  
compiling x86_64 object for:  src/xmlhelper/exception.cpp  
compiling x86_64 object for:  src/xmlhelper/xmltok.c  
src/xmlhelper/xmltok.c: In function ‘initScan’:  
src/xmlhelper/xmltok.c:1534:2: warning: array subscript has type ‘char’ [-Wchar-subscripts]  
src/xmlhelper/easyxml.cpp:3:0: warning: ignoring #pragma warning  [-Wunknown-pragmas]  
compiling x86_64 object for:  src/xmlhelper/easyxml.cpp  
compiling x86_64 object for:  src/xmlhelper/widestring.cpp  
compiling x86_64 object for:  src/xmlhelper/xmlparse.c  
src/xmlhelper/xmlparse.c:2342:16: warning: ‘errorProcessor’ defined but not used [-Wunused-function]  
compiling x86_64 object for:  src/xmlhelper/include/xmltok_ns.c  
src/xmlhelper/include/xmltok_ns.c:1:1: error: unknown type name ‘ENCODING’  
src/xmlhelper/include/xmltok_ns.c:1:17: error: ‘NS’ declared as function returning a function  
src/xmlhelper/include/xmltok_ns.c: In function ‘NS’:  
src/xmlhelper/include/xmltok_ns.c:3:3: warning: implicit declaration of function ‘ns’ [-Wimplicit-function-declaration]  
src/xmlhelper/include/xmltok_ns.c:3:14: error: ‘internal_utf8_encoding’ undeclared (first use in this function)  
src/xmlhelper/include/xmltok_ns.c:3:14: note: each undeclared identifier is reported only once for each function it appears in  
src/xmlhelper/include/xmltok_ns.c: At top level:  
src/xmlhelper/include/xmltok_ns.c:6:1: error: unknown type name ‘ENCODING’  
src/xmlhelper/include/xmltok_ns.c:6:17: error: ‘NS’ declared as function returning a function  
src/xmlhelper/include/xmltok_ns.c:6:17: error: redefinition of ‘NS’  
src/xmlhelper/include/xmltok_ns.c:1:17: note: previous definition of ‘NS’ was here  
src/xmlhelper/include/xmltok_ns.c: In function ‘NS’:  
src/xmlhelper/include/xmltok_ns.c:14:34: error: ‘internal_little2_encoding’ undeclared (first use in this function)  
src/xmlhelper/include/xmltok_ns.c:14:71: error: ‘internal_big2_encoding’ undeclared (first use in this function)  
src/xmlhelper/include/xmltok_ns.c: At top level:  
src/xmlhelper/include/xmltok_ns.c:19:1: error: unknown type name ‘ENCODING’  
src/xmlhelper/include/xmltok_ns.c:19:17: error: ‘NS’ declared as function returning an array  
src/xmlhelper/include/xmltok_ns.c:19:1: warning: parameter names (without types) in function declaration [enabled by default]  
src/xmlhelper/include/xmltok_ns.c:19:1: error: function ‘NS’ is initialized like a variable  
src/xmlhelper/include/xmltok_ns.c:19:17: error: static declaration of ‘NS’ follows non-static declaration  
src/xmlhelper/include/xmltok_ns.c:6:17: note: previous definition of ‘NS’ was here  
src/xmlhelper/include/xmltok_ns.c:20:7: error: ‘latin1_encoding’ undeclared here (not in a function)  
src/xmlhelper/include/xmltok_ns.c:21:7: error: ‘ascii_encoding’ undeclared here (not in a function)  
src/xmlhelper/include/xmltok_ns.c:21:3: warning: excess elements in scalar initializer [enabled by default]  
src/xmlhelper/include/xmltok_ns.c:21:3: warning: (near initialization for ‘NS’) [enabled by default]  
src/xmlhelper/include/xmltok_ns.c:22:7: error: ‘utf8_encoding’ undeclared here (not in a function)  
src/xmlhelper/include/xmltok_ns.c:22:3: warning: excess elements in scalar initializer [enabled by default]  
src/xmlhelper/include/xmltok_ns.c:22:3: warning: (near initialization for ‘NS’) [enabled by default]  
src/xmlhelper/include/xmltok_ns.c:23:7: error: ‘big2_encoding’ undeclared here (not in a function)  
src/xmlhelper/include/xmltok_ns.c:23:3: warning: excess elements in scalar initializer [enabled by default]  
src/xmlhelper/include/xmltok_ns.c:23:3: warning: (near initialization for ‘NS’) [enabled by default]  
src/xmlhelper/include/xmltok_ns.c:24:3: warning: excess elements in scalar initializer [enabled by default]  
src/xmlhelper/include/xmltok_ns.c:24:3: warning: (near initialization for ‘NS’) [enabled by default]  
src/xmlhelper/include/xmltok_ns.c:25:7: error: ‘little2_encoding’ undeclared here (not in a function)  
src/xmlhelper/include/xmltok_ns.c:25:3: warning: excess elements in scalar initializer [enabled by default]  
src/xmlhelper/include/xmltok_ns.c:25:3: warning: (near initialization for ‘NS’) [enabled by default]  
src/xmlhelper/include/xmltok_ns.c:27:1: warning: excess elements in scalar initializer [enabled by default]  
src/xmlhelper/include/xmltok_ns.c:27:1: warning: (near initialization for ‘NS’) [enabled by default]  
src/xmlhelper/include/xmltok_ns.c:30:1: error: unknown type name ‘ENCODING’  
src/xmlhelper/include/xmltok_ns.c:30:5: error: ‘NS’ declared as function returning a function  
src/xmlhelper/include/xmltok_ns.c: In function ‘NS’:  
src/xmlhelper/include/xmltok_ns.c:33:3: warning: implicit declaration of function ‘initScan’ [-Wimplicit-function-declaration]  
src/xmlhelper/include/xmltok_ns.c:33:22: error: ‘encodings’ undeclared (first use in this function)  
src/xmlhelper/include/xmltok_ns.c:33:3: error: unknown type name ‘INIT_ENCODING’  
src/xmlhelper/include/xmltok_ns.c:33:57: error: ‘enc’ undeclared (first use in this function)  
src/xmlhelper/include/xmltok_ns.c:33:62: error: ‘XML_PROLOG_STATE’ undeclared (first use in this function)  
src/xmlhelper/include/xmltok_ns.c:33:80: error: ‘ptr’ undeclared (first use in this function)  
src/xmlhelper/include/xmltok_ns.c:33:85: error: ‘end’ undeclared (first use in this function)  
src/xmlhelper/include/xmltok_ns.c:33:90: error: ‘nextTokPtr’ undeclared (first use in this function)  
src/xmlhelper/include/xmltok_ns.c: At top level:  
src/xmlhelper/include/xmltok_ns.c:37:1: error: unknown type name ‘ENCODING’  
src/xmlhelper/include/xmltok_ns.c:37:5: error: ‘NS’ declared as function returning a function  
src/xmlhelper/include/xmltok_ns.c:37:5: error: redefinition of ‘NS’  
src/xmlhelper/include/xmltok_ns.c:30:5: note: previous definition of ‘NS’ was here  
src/xmlhelper/include/xmltok_ns.c: In function ‘NS’:  
src/xmlhelper/include/xmltok_ns.c:40:22: error: ‘encodings’ undeclared (first use in this function)  
src/xmlhelper/include/xmltok_ns.c:40:3: error: unknown type name ‘INIT_ENCODING’  
src/xmlhelper/include/xmltok_ns.c:40:57: error: ‘enc’ undeclared (first use in this function)  
src/xmlhelper/include/xmltok_ns.c:40:62: error: ‘XML_CONTENT_STATE’ undeclared (first use in this function)  
src/xmlhelper/include/xmltok_ns.c:40:81: error: ‘ptr’ undeclared (first use in this function)  
src/xmlhelper/include/xmltok_ns.c:40:86: error: ‘end’ undeclared (first use in this function)  
src/xmlhelper/include/xmltok_ns.c:40:91: error: ‘nextTokPtr’ undeclared (first use in this function)  
src/xmlhelper/include/xmltok_ns.c: At top level:  
src/xmlhelper/include/xmltok_ns.c:43:25: error: unknown type name ‘INIT_ENCODING’  
src/xmlhelper/include/xmltok_ns.c:43:25: error: unknown type name ‘ENCODING’  
src/xmlhelper/include/xmltok_ns.c:58:1: error: unknown type name ‘ENCODING’  
src/xmlhelper/include/xmltok_ns.c:58:1: error: unknown type name ‘ENCODING’  
src/xmlhelper/include/xmltok_ns.c:58:17: error: ‘NS’ declared as function returning a function  
src/xmlhelper/include/xmltok_ns.c:58:17: error: redefinition of ‘NS’  
src/xmlhelper/include/xmltok_ns.c:37:5: note: previous definition of ‘NS’ was here  
src/xmlhelper/include/xmltok_ns.c: In function ‘NS’:  
src/xmlhelper/include/xmltok_ns.c:64:3: warning: implicit declaration of function ‘XmlUtf8Convert’ [-Wimplicit-function-declaration]  
src/xmlhelper/include/xmltok_ns.c:64:18: error: ‘enc’ undeclared (first use in this function)  
src/xmlhelper/include/xmltok_ns.c:64:24: error: ‘ptr’ undeclared (first use in this function)  
src/xmlhelper/include/xmltok_ns.c:64:29: error: ‘end’ undeclared (first use in this function)  
Process terminated with status 2 (0 minutes, 5 seconds)  
50 errors, 19 warnings  
   
  

this is my config.make

  
# add custom variables to this file  
  
# OF_ROOT allows to move projects outside apps/* just set this variable to the  
# absoulte path to the OF root folder  
  
OF_ROOT = ../../..  
  
  
# USER_CFLAGS allows to pass custom flags to the compiler  
# for example search paths like:  
# USER_CFLAGS = -I src/objects  
  
USER_CFLAGS = -O2 -g -I/usr/local/include -I/usr/include/gdal -DVTUNIX=1 -DSUPPORT_BZIP2 -DSUPPORT_CURL   
  
# USER_LDFLAGS allows to pass custom flags to the linker  
# for example libraries like:  
# USER_LDFLAGS = libs/libawesomelib.a  
  
USER_LDFLAGS = -lGLU -lGL -lSM -lICE -lX11 -lXext -lcurl -lpng -ljpeg -lbz2  
  
  
EXCLUDE_FROM_SOURCE="bin,.xcodeproj,obj,$(OF_ROOT)/examples/vTerrain/vterrain/src/xmlhelper/include"   
# change this to add different compiler optimizations to your project  
  
USER_COMPILER_OPTIMIZATION = -march=native -mtune=native -Os  
  
  
# android specific, in case you want to use different optimizations  
USER_LIBS_ARM =  
USER_LIBS_ARM7 =  
USER_LIBS_NEON =  
  
# android optimizations  
  
ANDROID_COMPILER_OPTIMIZATION = -Os  
  
NDK_PLATFORM = android-8  
  
# uncomment this for custom application name (if the folder name is different than the application name)  
#APPNAME = folderName  
  
# uncomment this for custom package name, must be the same as the java package that contains OFActivity  
#PKGNAME = cc.openframeworks.$(APPNAME)  
  
  
  
  
  
# linux arm flags  
  
LINUX_ARM7_COMPILER_OPTIMIZATIONS = -march=armv7-a -mtune=cortex-a8 -finline-functions -funroll-all-loops  -O3 -funsafe-math-optimizations -mfpu=neon -ftree-vectorize -mfloat-abi=hard -mfpu=vfp  
  
  
  
  

attached you can find the file build.make from cmake vterrain project to have an idea on hw should be

build.make.txt

may i exclude from source files with EXCLUDE_FROM_SOURCE in OF 0074 master branch?

At least i did a succesful build in VS2010. I can explore the Simple.xml terrain of the example. but for now without the vterrain mouse and key support. if you want to try it, you need also the ofxOpenSceneGraph addon otherwise you will fail to load a scene( because vterrain lib is based on OpenSceneGraph ,libMini and GDAL). I had to modify ofxOpenSceneGraph due some changes in the ofEvents class of OpenFrameworks. I will upload the new changes on my repo. I think i will develop on Windows for now ( i will prefer on linux…). Next step is to develop a ofxAppVTerrainWindow to have keyboard an mouse support directly from vTerrain.

updated the ofxOpenSceneGraph addon to the new changes in ofEvent. You can find here: https://github.com/kalwalt/ofxOpenSceneGraph/tree/develop

it seems that EXCLUDE_FROM_SOURCE dosen’t works. Today i tried again to exclude some files from the build process but without success. i create a folder named “exclude” and added in config.make

EXCLUDE_FROM_SOURCE = “bin,bin,.xcodeproj,obj,src/xmlhelper/exclude”

but also this dosen’t exclude them from build. ( basically i renamed the folder from “include” to “exclude”)

this is the log:

Using makefile: Makefile
compiling x86_64 object for: src/xmlhelper/exception.cpp
compiling x86_64 object for: src/xmlhelper/xmltok.c
src/xmlhelper/xmltok.c: In function ‘initScan’:
src/xmlhelper/xmltok.c:1534:2: warning: array subscript has type ‘char’ [-Wchar-subscripts]
compiling x86_64 object for: src/xmlhelper/easyxml.cpp
src/xmlhelper/easyxml.cpp:3:0: warning: ignoring #pragma warning [-Wunknown-pragmas]
compiling x86_64 object for: src/xmlhelper/widestring.cpp
compiling x86_64 object for: src/xmlhelper/xmlparse.c
src/xmlhelper/xmlparse.c:2344:16: warning: ‘errorProcessor’ defined but not used [-Wunused-function]
compiling x86_64 object for: src/xmlhelper/exclude/xmltok_ns.c
src/xmlhelper/exclude/xmltok_ns.c:1:1: error: unknown type name ‘ENCODING’
src/xmlhelper/exclude/xmltok_ns.c:1:17: error: ‘NS’ declared as function returning a function
src/xmlhelper/exclude/xmltok_ns.c: In function ‘NS’:
src/xmlhelper/exclude/xmltok_ns.c:3:3: warning: implicit declaration of function ‘ns’ [-Wimplicit-function-declaration]
src/xmlhelper/exclude/xmltok_ns.c:3:14: error: ‘internal_utf8_encoding’ undeclared (first use in this function)
src/xmlhelper/exclude/xmltok_ns.c:3:14: note: each undeclared identifier is reported only once for each function it appears in
src/xmlhelper/exclude/xmltok_ns.c: At top level:
src/xmlhelper/exclude/xmltok_ns.c:6:1: error: unknown type name ‘ENCODING’
src/xmlhelper/exclude/xmltok_ns.c:6:17: error: ‘NS’ declared as function returning a function
src/xmlhelper/exclude/xmltok_ns.c:6:17: error: redefinition of ‘NS’
src/xmlhelper/exclude/xmltok_ns.c:1:17: note: previous definition of ‘NS’ was here
src/xmlhelper/exclude/xmltok_ns.c: In function ‘NS’:
src/xmlhelper/exclude/xmltok_ns.c:14:34: error: ‘internal_little2_encoding’ undeclared (first use in this function)
src/xmlhelper/exclude/xmltok_ns.c:14:71: error: ‘internal_big2_encoding’ undeclared (first use in this function)
src/xmlhelper/exclude/xmltok_ns.c: At top level:
src/xmlhelper/exclude/xmltok_ns.c:19:1: error: unknown type name ‘ENCODING’
src/xmlhelper/exclude/xmltok_ns.c:19:17: error: ‘NS’ declared as function returning an array
src/xmlhelper/exclude/xmltok_ns.c:19:1: warning: parameter names (without types) in function declaration [enabled by default]
src/xmlhelper/exclude/xmltok_ns.c:19:1: error: function ‘NS’ is initialized like a variable
src/xmlhelper/exclude/xmltok_ns.c:19:17: error: static declaration of ‘NS’ follows non-static declaration
src/xmlhelper/exclude/xmltok_ns.c:6:17: note: previous definition of ‘NS’ was here
src/xmlhelper/exclude/xmltok_ns.c:20:7: error: ‘latin1_encoding’ undeclared here (not in a function)
src/xmlhelper/exclude/xmltok_ns.c:21:7: error: ‘ascii_encoding’ undeclared here (not in a function)
src/xmlhelper/exclude/xmltok_ns.c:21:3: warning: excess elements in scalar initializer [enabled by default]
src/xmlhelper/exclude/xmltok_ns.c:21:3: warning: (near initialization for ‘NS’) [enabled by default]
src/xmlhelper/exclude/xmltok_ns.c:22:7: error: ‘utf8_encoding’ undeclared here (not in a function)
src/xmlhelper/exclude/xmltok_ns.c:22:3: warning: excess elements in scalar initializer [enabled by default]
src/xmlhelper/exclude/xmltok_ns.c:22:3: warning: (near initialization for ‘NS’) [enabled by default]
src/xmlhelper/exclude/xmltok_ns.c:23:7: error: ‘big2_encoding’ undeclared here (not in a function)
src/xmlhelper/exclude/xmltok_ns.c:23:3: warning: excess elements in scalar initializer [enabled by default]
src/xmlhelper/exclude/xmltok_ns.c:23:3: warning: (near initialization for ‘NS’) [enabled by default]
src/xmlhelper/exclude/xmltok_ns.c:24:3: warning: excess elements in scalar initializer [enabled by default]
src/xmlhelper/exclude/xmltok_ns.c:24:3: warning: (near initialization for ‘NS’) [enabled by default]
src/xmlhelper/exclude/xmltok_ns.c:25:7: error: ‘little2_encoding’ undeclared here (not in a function)
src/xmlhelper/exclude/xmltok_ns.c:25:3: warning: excess elements in scalar initializer [enabled by default]
src/xmlhelper/exclude/xmltok_ns.c:25:3: warning: (near initialization for ‘NS’) [enabled by default]
src/xmlhelper/exclude/xmltok_ns.c:27:1: warning: excess elements in scalar initializer [enabled by default]
src/xmlhelper/exclude/xmltok_ns.c:27:1: warning: (near initialization for ‘NS’) [enabled by default]
src/xmlhelper/exclude/xmltok_ns.c:30:1: error: unknown type name ‘ENCODING’
src/xmlhelper/exclude/xmltok_ns.c:30:5: error: ‘NS’ declared as function returning a function
src/xmlhelper/exclude/xmltok_ns.c: In function ‘NS’:
src/xmlhelper/exclude/xmltok_ns.c:33:3: warning: implicit declaration of function ‘initScan’ [-Wimplicit-function-declaration]
src/xmlhelper/exclude/xmltok_ns.c:33:22: error: ‘encodings’ undeclared (first use in this function)
src/xmlhelper/exclude/xmltok_ns.c:33:3: error: unknown type name ‘INIT_ENCODING’
src/xmlhelper/exclude/xmltok_ns.c:33:57: error: ‘enc’ undeclared (first use in this function)
src/xmlhelper/exclude/xmltok_ns.c:33:62: error: ‘XML_PROLOG_STATE’ undeclared (first use in this function)
src/xmlhelper/exclude/xmltok_ns.c:33:80: error: ‘ptr’ undeclared (first use in this function)
src/xmlhelper/exclude/xmltok_ns.c:33:85: error: ‘end’ undeclared (first use in this function)
src/xmlhelper/exclude/xmltok_ns.c:33:90: error: ‘nextTokPtr’ undeclared (first use in this function)
src/xmlhelper/exclude/xmltok_ns.c: At top level:
src/xmlhelper/exclude/xmltok_ns.c:37:1: error: unknown type name ‘ENCODING’
src/xmlhelper/exclude/xmltok_ns.c:37:5: error: ‘NS’ declared as function returning a function
src/xmlhelper/exclude/xmltok_ns.c:37:5: error: redefinition of ‘NS’
src/xmlhelper/exclude/xmltok_ns.c:30:5: note: previous definition of ‘NS’ was here
src/xmlhelper/exclude/xmltok_ns.c: In function ‘NS’:
src/xmlhelper/exclude/xmltok_ns.c:40:22: error: ‘encodings’ undeclared (first use in this function)
src/xmlhelper/exclude/xmltok_ns.c:40:3: error: unknown type name ‘INIT_ENCODING’
src/xmlhelper/exclude/xmltok_ns.c:40:57: error: ‘enc’ undeclared (first use in this function)
src/xmlhelper/exclude/xmltok_ns.c:40:62: error: ‘XML_CONTENT_STATE’ undeclared (first use in this function)
src/xmlhelper/exclude/xmltok_ns.c:40:81: error: ‘ptr’ undeclared (first use in this function)
src/xmlhelper/exclude/xmltok_ns.c:40:86: error: ‘end’ undeclared (first use in this function)
src/xmlhelper/exclude/xmltok_ns.c:40:91: error: ‘nextTokPtr’ undeclared (first use in this function)
src/xmlhelper/exclude/xmltok_ns.c: At top level:
src/xmlhelper/exclude/xmltok_ns.c:43:25: error: unknown type name ‘INIT_ENCODING’
src/xmlhelper/exclude/xmltok_ns.c:43:25: error: unknown type name ‘ENCODING’
src/xmlhelper/exclude/xmltok_ns.c:58:1: error: unknown type name ‘ENCODING’
src/xmlhelper/exclude/xmltok_ns.c:58:1: error: unknown type name ‘ENCODING’
src/xmlhelper/exclude/xmltok_ns.c:58:17: error: ‘NS’ declared as function returning a function
src/xmlhelper/exclude/xmltok_ns.c:58:17: error: redefinition of ‘NS’
src/xmlhelper/exclude/xmltok_ns.c:37:5: note: previous definition of ‘NS’ was here
src/xmlhelper/exclude/xmltok_ns.c: In function ‘NS’:
src/xmlhelper/exclude/xmltok_ns.c:64:3: warning: implicit declaration of function ‘XmlUtf8Convert’ [-Wimplicit-function-declaration]
src/xmlhelper/exclude/xmltok_ns.c:64:18: error: ‘enc’ undeclared (first use in this function)
src/xmlhelper/exclude/xmltok_ns.c:64:24: error: ‘ptr’ undeclared (first use in this function)
src/xmlhelper/exclude/xmltok_ns.c:64:29: error: ‘end’ undeclared (first use in this function)
Process terminated with status 2 (0 minutes, 4 seconds)
50 errors, 19 warnings

so this doesn’t make any difference.

I’m wondering if i’m wrong with the path(id est: src/xmlhelper/exclude/) ( src is in my folder project) or there is something else. Please give me some advice for this!

The other option is to build the project without makefile. I tried today. I solved that above error , but i got others because OF has a lot of dependencies, In this sense could be very useful if someone has a ready project for codeblocks linux64 .

Many thanks to all.

Now it’s possible also in Linus Os . But for the issue explained above i have to build a codeblocks project without the makefile. This makes it more difficult to interchange the addon. I updated and i added some info and instructions in the readme. Hope that i will manage to solve that issue.

Some screenshots running Simple.xml from vTerrain data.

![](http://forum.openframeworks.cc/uploads/default/2858/Schermata del 2013-04-07 23:50:07.jpg)

![](http://forum.openframeworks.cc/uploads/default/2860/Schermata del 2013-04-07 23:49:15.jpg)