Find the answer to your Linux question:
Results 1 to 2 of 2
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1

    Undefined Reference to "Function' error


    I have been trying to build a file called main.cpp through my make file which is in Linux. There are functions like
    init_end() etc.,

    which are being called. I have included all the necessary headers and also have included the necessary lib.a files in the make file as below:

    LIBS = ../../Core/Lib/lib_core.a ../../EOS/Lib/libeosext.a ../../KWP/Lib/kis1976.a ../../PLS/Lib/LIBP.a

    I am still getting the below error. I use make -j makefile.mak clean all command to make the build. I have been trying to solve this since a week. Can somebody pls help. Thanks.

    .a ../../EOS/Lib/libeosext.a ../../KWP/Lib/kwp_tc1796.a ../../PLS/Lib/LIBPXMJTAG.a -Wl,--end-group -mcpu=tc1796 -nostart
    es -Wl,-Map,../Output/ -relax -Wl,--pcpmap -lpxmonrt -lpxdbg -lm
    main.o: In function `_main()':
    main.o(.main+0x1ce): undefined reference to `CoreBegin()'
    main.o(.main+0x1d2): undefined reference to `Begin()'
    main.o(.main+0x1d6): undefined reference to `CoreEnd()'
    main.o(.main+0x1da): undefined reference to `Init_s32()'
    main.o(.main+0x1de): undefined reference to `init_end()'
    main.o(.main+0x21e): undefined reference to
    make: *** [../Output/training.elf] Error 1

  2. #2
    Linux Guru Rubberman's Avatar
    Join Date
    Apr 2009
    I can be found either 40 miles west of Chicago, in Chicago, or in a galaxy far, far away.
    	gcc -o myprog main.cpp -L ../../EOS/Lib -L ../../KWP/Lib -L \
    	../../PLS/Lib -l _core -l eosext -l kis1976 -l LIBP
    FYI, we aren't supposed to help you with school projects, and since you are obviously very unfamiliar with makefiles and Linux compiler rules, I have to assume that you are doing this for a class?
    Sometimes, real fast is almost as good as real time.
    Just remember, Semper Gumbi - always be flexible!

Posting Permissions

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