[Fixed] Compilation error "undefined reference to 'kprintf'
  • Caterpillar
    Caterpillar
    AmiDARK
    Posts: 38 from 2011/10/29
    From: South France
    Hi All,

    I have fixed errors of compilations due to differencies between AmigaOS4 and MorphOS and now, the only error report I get is from "libglut.a(glut_misc.o)" and point to "undefined reference to 'kprintf'".

    Does someone know which include I haven't done (or which library I haven't included in the compilation process ?

    Thank you.

    Kindest Regards,
    AmiDARK

    [ Edité par AmiDARK 30.10.2011 - 23:16 ]
  • »29.10.11 - 22:41
    Profile Visit Website
  • Fab
  • MorphOS Developer
    Fab
    Posts: 1331 from 2003/6/16
    -ldebug
  • »29.10.11 - 22:58
    Profile Visit Website
  • Caterpillar
    Caterpillar
    AmiDARK
    Posts: 38 from 2011/10/29
    From: South France
    Hi Fab,

    TingyGL need debug lib to work ?

    With what you said, I get the same error + "linker input file unused since linking not done"

    Kindest Regards,
    AmiDARK
  • »30.10.11 - 09:17
    Profile Visit Website
  • MorphOS Developer
    Henes
    Posts: 507 from 2003/6/14
    That means you gave the -ldebug argument to the compiler instead of giving it to the linker.
    So the compiler informs you it is ignoring it. And the linker is still missing the kprintf symbol.
  • »30.10.11 - 11:43
    Profile Visit Website
  • Caterpillar
    Caterpillar
    AmiDARK
    Posts: 38 from 2011/10/29
    From: South France
    @Henes :
    Ok but, as I'm not a pro at makefile building, I tried 3 ways :
    1. giving -ldebug at linker & compiler
    2. giving -ldebug at linker only
    3. giving -ldebug at compiler only
    and I always get undefined reference to 'kprintf'.

    Here is a copy of my makefile :
    # Project: Projet1
    # Compiler: ppc-MorphOS
    # Compiler Type: MingW 3
    # Makefile created by wxDev-C++ 6.10.2 on 22/10/11 19:12

    CPP = ppc-morphos-g++.exe
    CC = ppc-morphos-gcc.exe
    WINDRES = windres.exe
    OBJ = FlyingFeather.o
    LINKOBJ = FlyingFeather.o
    LIBS = -L"C:/AmiDevCpp/usr/local/amiga/ppc-morphos/lib"
    INCS = -I"C:/AmiDevCpp/usr/local/amiga/ppc-morphos/sys-include"
    CXXINCS = -I"C:/AmiDevCpp/usr/local/amiga/ppc-morphos/sys-include"
    RCINCS = --include-dir "C:/AMIDEV~1/include"
    BIN = FlyingFeather.exe
    DEFINES =
    CXXFLAGS = $(CXXINCS)
    OPTIMIZE = -O2
    CFLAGS = $(INCS) $(DEFINES) $(OPTIMIZE) -noixemul -lTinyGL -Wall
    GPROF = gprof.exe
    RM = rm -f
    LINK = ppc-morphos-g++.exe
    CP = copy
    STRIP = strip

    .PHONY: all all-before all-after clean clean-custom
    all: all-before $(BIN) all-after

    clean: clean-custom
    $(RM) $(OBJ) $(BIN)

    $(BIN): $(OBJ)
    $(LINK) $(LINKOBJ) -o "FlyingFeather.exe" -noixemul -ldebug -lm -lGL -lGLU -lGLUT $(LIBS)

    FlyingFeather.o: $(GLOBALDEPS) FlyingFeather.c
    $(CC) -c FlyingFeather.c -o FlyingFeather.o $(CFLAGS)



    [ Edité par AmiDARK 30.10.2011 - 16:38 ]
  • »30.10.11 - 16:37
    Profile Visit Website
  • Fab
  • MorphOS Developer
    Fab
    Posts: 1331 from 2003/6/16
    I see somewhere: $(LINK) $(LINKOBJ) -o "FlyingFeather.exe" -noixemul -ldebug -lm -lGL -lGLU -lGLUT $(LIBS)

    -ldebug should be at the end (the order matters with this linker).
  • »30.10.11 - 16:44
    Profile Visit Website
  • Caterpillar
    Caterpillar
    AmiDARK
    Posts: 38 from 2011/10/29
    From: South France
    @Fab :
    Yes, you're right. I've heard that the order is important.
    Now Fixed.

    I'm now actually upgrading the Efika from MorphOS 2.1 to MorphOS 2.7 :p
    to test.

    Thank you to everyone.

    Kindest Regards,
    AmiDARK
  • »30.10.11 - 18:19
    Profile Visit Website