[pygccxml-development] Re : Re : Re : Compilation problem
Brought to you by:
mbaas,
roman_yakovenko
From: Vincent F. <vin...@gm...> - 2008-06-05 15:07:19
|
I successfully runned the example pyeasybmp on my platform. I can run the examples from start to end without any problem. I generate my .so libs with the same environment variables, and the same scontruct file. I tried to make a lib of a very simple file with no dependency. I still encounter the same problem... The only difference I see is that there are just .h files in the pyeasybmp example and that I have a .h and a .cpp file. Does it influence the results? How can I do it then? Here is the err.h I'm trying to wrap, the error message is still the same (it follows) // // Copyright 2005-2008 Renaud Sizaire // // This file is part of FeResPost. // // FeResPost is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; either version 2 of the License, or // (at your option) any later version. // // FeResPost is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with FeResPost; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // #ifndef ERR_H #define ERR_H #include <iostream> #include <stdexcept> #include <string> namespace postLib { class err { private : std::string functionName ; std::string fileName ; int lineNumber ; std::string message ; static bool Ok ; public : err(void) ; err(std::string fuName,std::string fiName,int liNumber,std::string msg) ; err(std::string fiName,int liNumber,std::string msg) ; err(const err &in) ; ~err(void) ; void write(std::ostream &out) const ; void exec(std::ostream &out) ; void exec(void) ; static void setOk(bool) ; static bool getOk(void) ; static void flushStdStreams(void) ; } ; } #define errThrow(a,b) { \ err::flushStdStreams(); \ err brol(a,__FILE__,__LINE__,b); \ brol.write(std::cerr); \ throw(brol); \ } #define errWrite(a,b) { \ err::flushStdStreams(); \ err (a,__FILE__,__LINE__,b).exec(); \ err::setOk(false); \ } #define catchAll(a,b) catch(err) { \ err::flushStdStreams(); \ std::cerr << "Error caught in : " << __FILE__ << ":" << __LINE__ << endl ; \ std::cerr << " in function : " << a << endl ; \ std::cerr << " with message : " << b << endl ; \ err brol(a,__FILE__,__LINE__,b) ; \ throw(brol) ; \ } \ catch(std::out_of_range) { \ err::flushStdStreams(); \ std::cerr << "Error caught in : " << __FILE__ << ":" << __LINE__ << endl ; \ std::cerr << " in function : " << a << endl ; \ std::cerr << " with message : " << b << endl ; \ std::cerr << " error type : std::out_of_range" << endl ; \ err brol(a,__FILE__,__LINE__,b) ; \ throw(brol) ; \ } \ catch(std::bad_alloc) { \ err::flushStdStreams(); \ std::cerr << "Error caught in : " << __FILE__ << ":" << __LINE__ << endl ; \ std::cerr << " in function : " << a << endl ; \ std::cerr << " with message : " << b << endl ; \ std::cerr << " error type : std::bad_alloc" << endl ; \ err brol(a,__FILE__,__LINE__,b) ; \ throw(brol) ; \ } \ catch(...) { \ err::flushStdStreams(); \ std::cerr << "Error caught in : " << __FILE__ << ":" << __LINE__ << endl ; \ std::cerr << " in function : " << a << endl ; \ std::cerr << " with message : " << b << endl ; \ std::cerr << " error type : unknown" << endl ; \ err brol(a,__FILE__,__LINE__,b) ; \ throw(brol) ; \ } #endif Traceback (most recent call last): File "test.py", line 4, in ? import ferespost ImportError: /people/ferries/ferespost/unittests/ferespost.so: undefined symbol: _ZN7postLib7errC1ERKS0_ Thanks again... 2008/6/5, Vincent Ferries <vin...@gm...>: > The most curious thing is that the error deals with the only class I'm > actually trying to make accessible... > I'd have understood if it came from an inclusion class... > > 2008/6/5, Vincent Ferries <vin...@gm...>: >> The library I try to wrap is an open source library called ferespost >> used in aerospace calculation. >> >> I'm currently trying to wrap one of the main classes >> postLib::nastran::dataBase which implements >> postLib::generic::dataBase. >> I generated the wrapping class, addind all the missing include .h and >> defining all the missing call_policies so that I haven't any error >> generating the .cpp file. >> >> I compiled it using the sconstruct file I found in the pyEasyBmp >> example, modifying it according to my configuration. >> >> I also tried to comment all the virtual function definitions to see if >> it was causing my problem. >> >> Do I really have to wrap all of the files/classes from the library I'd >> like to use to be able to compile, or can I simply use a part of it >> like I'm trying to do actually? >> >> 2008/6/4, Roman Yakovenko <rom...@gm...>: >>> On Wed, Jun 4, 2008 at 6:51 PM, Vincent Ferries >>> <vin...@gm...> wrote: >>>> I tried to comment all the virutal method definitions in my generated >>>> .cpp >>>> file. >>>> If I understand what was said on your link, the linker makes dynamic >>>> links for virtual functions which are not redefined in the same file >>>> while compiling which causes errors on runtime if it doesn't find >>>> them, just like in my case. >>>> >>>> But without any virtual function left, it should work. >>>> >>>> I compiled again and still have the same error when importing the >>>> module... >>> >>> If I should guess, than >>> or you forgot to add to the link line some of your libraries >>> or your new module depends on some other so and cannot find it >>> or there is something else :-) >>> >>> -- >>> Roman Yakovenko >>> C++ Python language binding >>> http://www.language-binding.net/ >>> >> > |