Results 1 to 5 of 5

Thread: Simple app won't compile when linked with clanlib

  1. #1

    Default Simple app won't compile when linked with clanlib

    I made a simple
    Code:
    int main(int argc, char *argv[])
    {
    	return 0;
    }
    app and tried to compile it and link it to ClanLib just to test my makefile. However, I get some weird errors:

    Code:
    g++ -c -I/usr/include/ClanLib-0.8   main.cpp -o main.o
    g++ -lclanApp -lclanCore -lclanSignals   main.o -o unnamed
    /usr/lib/gcc/i686-pc-linux-gnu/4.2.0/../../../libclanCore.so: undefined reference to `dlsym'
    /usr/lib/gcc/i686-pc-linux-gnu/4.2.0/../../../libclanCore.so: undefined reference to `dlerror'
    /usr/lib/gcc/i686-pc-linux-gnu/4.2.0/../../../libclanCore.so: undefined reference to `dlopen'
    /usr/lib/gcc/i686-pc-linux-gnu/4.2.0/../../../libclanCore.so: undefined reference to `dlclose'
    collect2: ld returned 1 exit status
    make: *** [unnamed] Error 1
    You can see the commands it's running in that output, but here's the makefile if it helps:
    Code:
    BINARY=unnamed
    SOURCES=$(wildcard *.cpp)
    OUTPUT=$(SOURCES:.cpp=.o)
    COMPILER=g++
    CFLAGS=-c $(shell pkg-config --cflags clanApp-0.8 clanCore-0.8)
    LFLAGS=$(shell pkg-config --libs clanApp-0.8 clanCore-0.8)
    
    all: $(BINARY)
    
    %.o: %.cpp
    	$(COMPILER) $(CFLAGS) $< -o $@
    
    $(BINARY): $(OUTPUT)
    	$(COMPILER) $(LFLAGS) $(OUTPUT) -o $(BINARY)
    
    clean:
    	find . -name *.o |xargs rm -f
    	rm -f $(BINARY)

  2. #2

    Default

    I just tried the example app out of the INSTALL.linux in the ClanLib 0.8 tarball.

    Code:
    g++ -c -I/usr/include/ClanLib-0.8   main.cpp -o main.o
    main.cpp:61:7: warning: no newline at end of file
    In file included from /usr/include/ClanLib-0.8/ClanLib/gl.h:64,
                     from main.cpp:1:
    /usr/include/ClanLib-0.8/ClanLib/GL/opengl_wrap.h:2533: error: '<anonymous>' has incomplete type
    /usr/include/ClanLib-0.8/ClanLib/GL/opengl_wrap.h:2533: error: invalid use of 'CLvoid'
    make: *** [main.o] Error 1

  3. #3
    Administrator Seth's Avatar
    Join Date
    Jul 2002
    Location
    Japan
    Posts
    5,343

    Default

    I think the latest GCC is throwing errors where it used to throw warnings. I'd recommend working from the development version in SVN for now, I think those problems have been fixed. (or at least they will be soon if not!)
    Seth A. Robinson
    Robinson Technologies

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

    Default

    Also see: http://www.rtsoft.com/forums/showthread.php?t=1737

    Make sure that your graphic card opengl drivers are up to date.

    **** EDIT: I am now getting the same error, since updating gcc to V4.2.1 ***
    (Still investigating)
    Last edited by rombust; 07-17-2007 at 02:17 PM.

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

    Default

    Fixed in ClanLib 0.9 SVN.
    Also fixed (previously) in ClanLib 0.8 SVN

Similar Threads

  1. ClanLib 0.8.0 fails to compile on Ubuntu
    By lixopmstp in forum Official ClanLib SDK Forums
    Replies: 7
    Last Post: 09-04-2007, 05:50 AM
  2. ClanLib Compile bug with Nvidia GLX Legacy drivers.
    By Xander.C in forum Official ClanLib SDK Forums
    Replies: 1
    Last Post: 05-11-2007, 04:05 AM
  3. how to compile static
    By andreaszdw in forum Official ClanLib SDK Forums
    Replies: 1
    Last Post: 05-07-2007, 05:03 AM
  4. 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
  5. Tile Cutting Bug linked to Zooming
    By loken in forum Novashell Game Creation System
    Replies: 1
    Last Post: 11-30-2006, 04:50 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
  •