Results 1 to 6 of 6

Thread: error when i compile examples

  1. #1

    Exclamation error when i compile examples

    i install ClanLib 3.0
    Code:
    ./configure --prefix=/usr
    make
    sudo make install
    then i want to compile examples, i go to Examples/Display/Basics2d, do make and have an error
    Code:
    Original
    g++ `pkg-config --cflags clanApp-3.0 clanDisplay-3.0 clanCore-3.0 clanGL-3.0 clanSWRender-3.0` -pthread Sources/basic2d.o Sources/precomp.o Sources/program.o -o basic2d `pkg-config --libs clanApp-3.0 clanDisplay-3.0 clanCore-3.0 clanGL-3.0 clanSWRender-3.0` 
    /usr/lib/gcc/x86_64-linux-gnu/4.7/../../../../lib/libclan30GL.so: error: undefined reference to 'dlsym'
    /usr/lib/gcc/x86_64-linux-gnu/4.7/../../../../lib/libclan30Display.so: error: undefined reference to 'dlopen'
    /usr/lib/gcc/x86_64-linux-gnu/4.7/../../../../lib/libclan30Display.so: error: undefined reference to 'dlclose'
    collect2: ошибка: выполнение ld завершилось с кодом возврата 1
    make: *** [basic2d] Ошибка 1
    Translated by google translate
    g++ `pkg-config --cflags clanApp-3.0 clanDisplay-3.0 clanCore-3.0 clanGL-3.0 clanSWRender-3.0` -pthread Sources/basic2d.o Sources/precomp.o Sources/program.o -o basic2d `pkg-config --libs clanApp-3.0 clanDisplay-3.0 clanCore-3.0 clanGL-3.0 clanSWRender-3.0` 
    /usr/lib/gcc/x86_64-linux-gnu/4.7/../../../../lib/libclan30GL.so: error: undefined reference to 'dlsym'
    /usr/lib/gcc/x86_64-linux-gnu/4.7/../../../../lib/libclan30Display.so: error: undefined reference to 'dlopen'
    /usr/lib/gcc/x86_64-linux-gnu/4.7/../../../../lib/libclan30Display.so: error: undefined reference to 'dlclose'
    collect2: ERROR: Execution completed with code ld Return 1
    make: *** [basic2d] Error 1
    Linux, Xubuntu 13.10
    how to fix this problem?
    Sorry for my english, im from Ukraine and 17 years old

  2. #2
    ClanLib Developer
    Join Date
    May 2007
    Posts
    1,824

    Default

    I am not sure why it's not working on just your machine. It shouldn't work on all machines !

    The linker is missing: "-ldl" (see http://linux.die.net/man/3/dlopen)

    Two easy ways of fixing it.

    1) Change in configure.ac
    extra_LIBS_clanDisplay=" -lX11 $extra_LIBS_clanDisplay "
    to
    extra_LIBS_clanDisplay=" -lX11 -ldl $extra_LIBS_clanDisplay "

    Run "./autogen.sh"
    ./configure --prefix=/usr
    touch Sources/Display/display.cpp # Not sure if this is required to update the pkgconfig's
    make -j9
    sudo install

    2) Edit "../../Makefile.conf" , adding -ldl for the linker (This fix will be lost when ./configure is reran or ./autogen.sh is run, if I remember correctly)

  3. #3

    Default o, it`s works fine

    i choose first way, compile some exapmles and it works perfectly. Thanks for lib and thanks for help.
    Last edited by kachan; 09-29-2013 at 09:08 AM.

  4. #4

    Default Assimp

    when i compile Examples/3D/Object3D i have an error
    Code:
    kachan@kachans:~$ cd ClanLib-3.0.0/Examples/3D/Object3D/
    kachan@kachans:~/ClanLib-3.0.0/Examples/3D/Object3D$ make
    g++ -I./ -I Sources `pkg-config --cflags clanApp-3.0 clanDisplay-3.0 clanCore-3.0 clanGL-3.0` -pthread ./Sources/example.o ./Sources/program.o ./Sources/shader.o ./Sources/precomp.o -o object3d `pkg-config --libs clanApp-3.0 clanDisplay-3.0 clanCore-3.0 clanGL-3.0` -lassimp
    /usr/bin/ld: error: cannot find -lassimp
    ./Sources/example.o:example.cpp:function App::start(std::vector<std::string, std::allocator<std::string> > const&): error: undefined reference to 'GraphicStore::GraphicStore(clan::GraphicContext&)'
    ./Sources/example.o:example.cpp:function App::start(std::vector<std::string, std::allocator<std::string> > const&): error: undefined reference to 'GraphicStore::~GraphicStore()'
    ./Sources/example.o:example.cpp:function App::start(std::vector<std::string, std::allocator<std::string> > const&): error: undefined reference to 'GraphicStore::~GraphicStore()'
    ./Sources/example.o:example.cpp:function App::render(clan::GraphicContext&): error: undefined reference to 'Scene::Draw(clan::Mat4<float>&, clan::GraphicContext&)'
    ./Sources/example.o:example.cpp:function App::create_scene(clan::GraphicContext&): error: undefined reference to 'Model::Model(clan::GraphicContext&, GraphicStore*, char const*, bool)'
    ./Sources/example.o:example.cpp:function App::create_scene(clan::GraphicContext&): error: undefined reference to 'Model::Model(clan::GraphicContext&, GraphicStore*, char const*, bool)'
    ./Sources/example.o:example.cpp:function App::create_scene(clan::GraphicContext&): error: undefined reference to 'Model::Model(clan::GraphicContext&, GraphicStore*, char const*, bool)'
    ./Sources/example.o:example.cpp:function App::create_scene(clan::GraphicContext&): error: undefined reference to 'SceneObject::SceneObject(Scene&, SceneObject*)'
    ./Sources/example.o:example.cpp:function App::create_scene(clan::GraphicContext&): error: undefined reference to 'SceneObject::SceneObject(Scene&, SceneObject*)'
    ./Sources/example.o:example.cpp:function App::create_scene(clan::GraphicContext&): error: undefined reference to 'SceneObject::SceneObject(Scene&, SceneObject*)'
    ./Sources/example.o:example.cpp:function App::create_scene(clan::GraphicContext&): error: undefined reference to 'SceneObject::SceneObject(Scene&, SceneObject*)'
    ./Sources/example.o:example.cpp:function App::create_scene(clan::GraphicContext&): error: undefined reference to 'Model::SetMaterial(float, clan::Vec4<float> const&, clan::Vec4<float> const&, clan::Vec4<float> const&)'
    ./Sources/example.o:example.cpp:function App::create_scene(clan::GraphicContext&): error: undefined reference to 'Model::SetMaterial(float, clan::Vec4<float> const&, clan::Vec4<float> const&, clan::Vec4<float> const&)'
    ./Sources/example.o:example.cpp:function App::create_scene(clan::GraphicContext&): error: undefined reference to 'GraphicStore::LoadImages(clan::GraphicContext&)'
    ./Sources/example.o:example.cpp:function App::update_light(clan::GraphicContext&): error: undefined reference to 'SceneObject::GetWorldMatrix(clan::Mat4<float>&)'
    ./Sources/example.o:example.cpp:function App::update_light(clan::GraphicContext&): error: undefined reference to 'ShaderTexture::SetLight(clan::Vec3<float>&, clan::Vec4<float>&, clan::Vec4<float>&, clan::Vec4<float>&)'
    ./Sources/example.o:example.cpp:function App::calculate_matricies(clan::GraphicContext&): error: undefined reference to 'SceneObject::GetWorldMatrix(clan::Mat4<float>&)'
    ./Sources/example.o:example.cpp:function App::calculate_matricies(clan::GraphicContext&): error: undefined reference to 'SceneObject::GetWorldMatrix(clan::Mat4<float>&)'
    ./Sources/program.o:program.cpp:function App::App(): error: undefined reference to 'Scene::Scene()'
    ./Sources/program.o:program.cpp:function App::App(): error: undefined reference to 'Model::Model()'
    ./Sources/program.o:program.cpp:function App::App(): error: undefined reference to 'Model::Model()'
    ./Sources/program.o:program.cpp:function App::App(): error: undefined reference to 'Model::Model()'
    ./Sources/program.o:program.cpp:function App::App(): error: undefined reference to 'Scene::~Scene()'
    ./Sources/program.o:program.cpp:function App::~App(): error: undefined reference to 'Scene::~Scene()'
    collect2: ошибка: выполнение ld завершилось с кодом возврата 1
    make: *** [object3d] Ошибка 1
    how to fix than?
    And what meshes can load ClanLib? Collada?
    Last edited by kachan; 09-29-2013 at 10:47 AM.

  5. #5

    Default Examples

    when i compile Examples/3D/Object3D i have an error
    Code:
    kachan@kachans:~$ cd ClanLib-3.0.0/Examples/3D/Object3D/
    kachan@kachans:~/ClanLib-3.0.0/Examples/3D/Object3D$ make
    g++ -I./ -I Sources `pkg-config --cflags clanApp-3.0 clanDisplay-3.0 clanCore-3.0 clanGL-3.0` -pthread ./Sources/example.o ./Sources/program.o ./Sources/shader.o ./Sources/precomp.o -o object3d `pkg-config --libs clanApp-3.0 clanDisplay-3.0 clanCore-3.0 clanGL-3.0` -lassimp
    /usr/bin/ld: error: cannot find -lassimp
    ./Sources/example.o:example.cpp:function App::start(std::vector<std::string, std::allocator<std::string> > const&): error: undefined reference to 'GraphicStore::GraphicStore(clan::GraphicContext&)'
    ./Sources/example.o:example.cpp:function App::start(std::vector<std::string, std::allocator<std::string> > const&): error: undefined reference to 'GraphicStore::~GraphicStore()'
    ./Sources/example.o:example.cpp:function App::start(std::vector<std::string, std::allocator<std::string> > const&): error: undefined reference to 'GraphicStore::~GraphicStore()'
    ./Sources/example.o:example.cpp:function App::render(clan::GraphicContext&): error: undefined reference to 'Scene::Draw(clan::Mat4<float>&, clan::GraphicContext&)'
    ./Sources/example.o:example.cpp:function App::create_scene(clan::GraphicContext&): error: undefined reference to 'Model::Model(clan::GraphicContext&, GraphicStore*, char const*, bool)'
    ./Sources/example.o:example.cpp:function App::create_scene(clan::GraphicContext&): error: undefined reference to 'Model::Model(clan::GraphicContext&, GraphicStore*, char const*, bool)'
    ./Sources/example.o:example.cpp:function App::create_scene(clan::GraphicContext&): error: undefined reference to 'Model::Model(clan::GraphicContext&, GraphicStore*, char const*, bool)'
    ./Sources/example.o:example.cpp:function App::create_scene(clan::GraphicContext&): error: undefined reference to 'SceneObject::SceneObject(Scene&, SceneObject*)'
    ./Sources/example.o:example.cpp:function App::create_scene(clan::GraphicContext&): error: undefined reference to 'SceneObject::SceneObject(Scene&, SceneObject*)'
    ./Sources/example.o:example.cpp:function App::create_scene(clan::GraphicContext&): error: undefined reference to 'SceneObject::SceneObject(Scene&, SceneObject*)'
    ./Sources/example.o:example.cpp:function App::create_scene(clan::GraphicContext&): error: undefined reference to 'SceneObject::SceneObject(Scene&, SceneObject*)'
    ./Sources/example.o:example.cpp:function App::create_scene(clan::GraphicContext&): error: undefined reference to 'Model::SetMaterial(float, clan::Vec4<float> const&, clan::Vec4<float> const&, clan::Vec4<float> const&)'
    ./Sources/example.o:example.cpp:function App::create_scene(clan::GraphicContext&): error: undefined reference to 'Model::SetMaterial(float, clan::Vec4<float> const&, clan::Vec4<float> const&, clan::Vec4<float> const&)'
    ./Sources/example.o:example.cpp:function App::create_scene(clan::GraphicContext&): error: undefined reference to 'GraphicStore::LoadImages(clan::GraphicContext&)'
    ./Sources/example.o:example.cpp:function App::update_light(clan::GraphicContext&): error: undefined reference to 'SceneObject::GetWorldMatrix(clan::Mat4<float>&)'
    ./Sources/example.o:example.cpp:function App::update_light(clan::GraphicContext&): error: undefined reference to 'ShaderTexture::SetLight(clan::Vec3<float>&, clan::Vec4<float>&, clan::Vec4<float>&, clan::Vec4<float>&)'
    ./Sources/example.o:example.cpp:function App::calculate_matricies(clan::GraphicContext&): error: undefined reference to 'SceneObject::GetWorldMatrix(clan::Mat4<float>&)'
    ./Sources/example.o:example.cpp:function App::calculate_matricies(clan::GraphicContext&): error: undefined reference to 'SceneObject::GetWorldMatrix(clan::Mat4<float>&)'
    ./Sources/program.o:program.cpp:function App::App(): error: undefined reference to 'Scene::Scene()'
    ./Sources/program.o:program.cpp:function App::App(): error: undefined reference to 'Model::Model()'
    ./Sources/program.o:program.cpp:function App::App(): error: undefined reference to 'Model::Model()'
    ./Sources/program.o:program.cpp:function App::App(): error: undefined reference to 'Model::Model()'
    ./Sources/program.o:program.cpp:function App::App(): error: undefined reference to 'Scene::~Scene()'
    ./Sources/program.o:program.cpp:function App::~App(): error: undefined reference to 'Scene::~Scene()'
    collect2: ошибка: выполнение ld завершилось с кодом возврата 1
    make: *** [object3d] Ошибка 1
    Assimp 3
    how to fix?

  6. #6

Similar Threads

  1. Replies: 4
    Last Post: 05-15-2011, 02:54 PM
  2. Compile Error
    By bmgproducts in forum Official ClanLib SDK Forums
    Replies: 2
    Last Post: 12-30-2010, 07:25 PM
  3. Compile error with D3D9 in V2.2.5
    By MicroGrape in forum Official ClanLib SDK Forums
    Replies: 1
    Last Post: 12-16-2010, 07:24 AM
  4. Error in compiling Examples
    By Nikitto46 in forum Official ClanLib SDK Forums
    Replies: 5
    Last Post: 10-16-2007, 02:07 PM
  5. encountered compile error 0.9 svn 146
    By voudras in forum Official ClanLib SDK Forums
    Replies: 0
    Last Post: 01-11-2007, 06:57 AM

Bookmarks

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •