This forum has been archived. All content is frozen. Please use KDE Discuss instead.

Can't compile on Ubuntu 10.10,

Tags: None
(comma "," separated)
nkint
Registered Member
Posts
2
Karma
0

Can't compile on Ubuntu 10.10,

Thu Jan 26, 2012 9:47 pm
hello, i'm using openframeworks that is a framework for graphics and iteractive media, and i want to integrate Eigen in it.

I get the error:
"error: #error The preprocessor symbol 'Success' is defined, possibly by the X11 header file X.h"


and, if i put in the setup method this code:
Code: Select all
cout << Sucess << endl; 

it print out a 0.

I've downloaded Eigen 3 and put it in /usr/local/include/eigen3 and put this path in -I option of compiler in makefile.

my g++ call is this one:

compiling object for: src/testApp.cpp
mkdir -p obj/i686Release/./src
g++ -c -pthread -I/usr/include/gtk-2.0 -I/usr/lib/gtk-2.0/include -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/pango-1.0 -I/usr/include/gio-unix-2.0/ -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/libpng12 -DOF_USING_GTK -DOF_USING_MPG123 -Wall -fexceptions -I. -I../../../libs/FreeImage/include -I../../../libs/assimp/include -I../../../libs/assimp/include/Compiler -I../../../libs/cairo/include -I../../../libs/cairo/include/libpng15 -I../../../libs/cairo/include/cairo -I../../../libs/cairo/include/pixman-1 -I../../../libs/fmodex/include -I../../../libs/freetype/include -I../../../libs/freetype/include/freetype2 -I../../../libs/freetype/include/freetype2/freetype -I../../../libs/freetype/include/freetype2/freetype/internal -I../../../libs/freetype/include/freetype2/freetype/internal/services -I../../../libs/freetype/include/freetype2/freetype/config -I../../../libs/glew/include -I../../../libs/glew/include/GL -I../../../libs/kiss/include -I../../../libs/portaudio/include -I../../../libs/rtAudio/include -I../../../libs/tess2/include -I../../../libs/videoInput/include -I../../../libs/poco/include -I../../../libs/glu/include -pthread -I/usr/include/gstreamer-0.10 -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/libxml2 -I../../../libs/openFrameworks/ -I../../../libs/openFrameworks/gl -I../../../libs/openFrameworks/communication -I../../../libs/openFrameworks/types -I../../../libs/openFrameworks/app -I../../../libs/openFrameworks/graphics -I../../../libs/openFrameworks/math -I../../../libs/openFrameworks/sound -I../../../libs/openFrameworks/utils -I../../../libs/openFrameworks/events -I../../../libs/openFrameworks/video -I../../../libs/openFrameworks/3d -I /usr/local/include/eigen3 -MMD -MP -MFobj/i686Release/./src/testApp.d -MTobj/i686Release/./src/testApp.d -oobj/i686Release/./src/testApp.o -c src/testApp.cpp


as you can see the frameworks uses a lot of libs, opengl, poco, rtAudio, cairo, freetypes, and many others.

of course if i use the base tutorial here:

Code: Select all
#include <iostream>
#include <Eigen/Dense>

using namespace Eigen;

int main()
{
  MatrixXd m(2,2);
  m(0,0) = 3;
  m(1,0) = 2.5;
  m(0,1) = -1;
  m(1,1) = m(1,0) + m(0,1);
  std::cout << m << std::endl;
}


compiling it with
g++ -I/usr/local/include/eigen3/ e.cpp


everything is ok!
User avatar
ggael
Moderator
Posts
3447
Karma
19
OS

Re: Can't compile on Ubuntu 10.10,

Fri Jan 27, 2012 7:22 am
you should try to include Eigen headers first.

see also: http://eigen.tuxfamily.org/bz/show_bug.cgi?id=253
nkint
Registered Member
Posts
2
Karma
0

Re: Can't compile on Ubuntu 10.10,

Fri Jan 27, 2012 11:31 am
mhmm it is a bit compilicated and i am not a cpp guru and can't resolve this (linking?) problem:

i have main.cpp that load opengl and glu context and then launch testApp.cpp
the application is written in testApp.cpp, main is only a launcher.

now, if i include Eigen in main there are no compilation problem but it is useless, because i have to include again Eigen in testApp (due to was not declared in this scope error) and.. it fails again.

so i resolved with a dirty:
Code: Select all
#undef Success

that, in my code, i don't use. (i even didn't know of its existence)

now.. it works.
if someone has more elegant solution, please tell me.


Bookmarks



Who is online

Registered users: Bing [Bot], Google [Bot], Yahoo [Bot]