Gcc throws error when I try to compile the test folder in libburn

Marcose Gigu

Libburn

So after I installed libburn I went to the test folder which comes with the libburn's code.Then there is the libburner.c file.I try to compile it with gcc(gcc libburn.c -o outputfile) but it gives me these error even though the header file exists.

libburner.c:(.text+0xb17): undefined reference to `burn_disc_create'
/usr/bin/ld: libburner.c:(.text+0xb20): undefined reference to `burn_session_create'
/usr/bin/ld: libburner.c:(.text+0xb3c): undefined reference to `burn_disc_add_session'
/usr/bin/ld: libburner.c:(.text+0xb4d): undefined reference to `burn_track_create'
/usr/bin/ld: libburner.c:(.text+0xb84): undefined reference to `burn_track_define_data'
/usr/bin/ld: libburner.c:(.text+0xc4d): undefined reference to `burn_fd_source_new'
/usr/bin/ld: libburner.c:(.text+0xcd1): undefined reference to `burn_fifo_source_new'
/usr/bin/ld: libburner.c:(.text+0xd39): undefined reference to `burn_track_set_source'
/usr/bin/ld: libburner.c:(.text+0xd81): undefined reference to `burn_session_add_track'
/usr/bin/ld: libburner.c:(.text+0xdad): undefined reference to `burn_source_free'
/usr/bin/ld: libburner.c:(.text+0xdd7): undefined reference to `burn_disc_get_status'
/usr/bin/ld: libburner.c:(.text+0xe23): undefined reference to `burn_disc_erasable'
/usr/bin/ld: libburner.c:(.text+0xeac): undefined reference to `burn_write_opts_new'
/usr/bin/ld: libburner.c:(.text+0xec1): undefined reference to `burn_write_opts_set_perform_opc'
/usr/bin/ld: libburner.c:(.text+0xedc): undefined reference to `burn_write_opts_set_multi'
/usr/bin/ld: libburner.c:(.text+0xf05): undefined reference to `burn_write_opts_set_simulate'
/usr/bin/ld: libburner.c:(.text+0xf1e): undefined reference to `burn_drive_set_speed'
/usr/bin/ld: libburner.c:(.text+0xf2f): undefined reference to `burn_write_opts_set_underrun_proof'
/usr/bin/ld: libburner.c:(.text+0xf4b): undefined reference to `burn_write_opts_auto_write_type'
/usr/bin/ld: libburner.c:(.text+0xfb4): undefined reference to `burn_set_signal_handling'
/usr/bin/ld: libburner.c:(.text+0xfe1): undefined reference to `burn_disc_write'
/usr/bin/ld: libburner.c:(.text+0x1001): undefined reference to `burn_drive_get_status'
/usr/bin/ld: libburner.c:(.text+0x1114): undefined reference to `burn_fifo_inquire_status'
/usr/bin/ld: libburner.c:(.text+0x119d): undefined reference to `burn_drive_get_status'
/usr/bin/ld: libburner.c:(.text+0x11b9): undefined reference to `burn_is_aborting'
/usr/bin/ld: libburner.c:(.text+0x1236): undefined reference to `burn_write_opts_free'
/usr/bin/ld: libburner.c:(.text+0x1266): undefined reference to `burn_source_free'
/usr/bin/ld: libburner.c:(.text+0x128d): undefined reference to `burn_track_free'
/usr/bin/ld: libburner.c:(.text+0x12af): undefined reference to `burn_source_free'
/usr/bin/ld: libburner.c:(.text+0x12c2): undefined reference to `burn_session_free'
/usr/bin/ld: libburner.c:(.text+0x12d5): undefined reference to `burn_disc_free'
/usr/bin/ld: /tmp/cchZ1bZA.o: in function `main':
libburner.c:(.text+0x1a52): undefined reference to `burn_initialize'
/usr/bin/ld: libburner.c:(.text+0x1a7c): undefined reference to `burn_msgs_set_severities'
/usr/bin/ld: libburner.c:(.text+0x1a92): undefined reference to `burn_set_signal_handling'
/usr/bin/ld: libburner.c:(.text+0x1c6e): undefined reference to `burn_drive_release'
/usr/bin/ld: libburner.c:(.text+0x1c7b): undefined reference to `burn_is_aborting'
/usr/bin/ld: libburner.c:(.text+0x1c8d): undefined reference to `burn_abort_pacifier'
/usr/bin/ld: libburner.c:(.text+0x1c9a): undefined reference to `burn_abort'
/usr/bin/ld: libburner.c:(.text+0x1cc9): undefined reference to `burn_finish'
collect2: error: ld returned 1 exit status

Please help me.

the busybee

Commonly and in short terms there are three tools involved when you create software in C:

  1. An editor to write the source code.
  2. A compiler to translate the source code into object code, which consists mainly of machine code, whose references are not yet resolved.
  3. A linker to link (to bind) separated parts of object code into an executable, which has all references resolved.

You can use any application as an editor that can create source code in the right format. I even heard about a guy using Microsoft Word for this, because the Notepad of that time could not handle files larger than 64 KB.

You use GCC apparently as compiler and linker.

You didn't mention any compilation problem, it apparently reported no errors. Anyway, the source code of the test application contains the line #include "libburn.h" or similar. This way the compiler knows that there are functions the application can call, and it can check that the application calls none or more of these functions in the right way.

You wrote that your command line to build is gcc libburn.c -o outputfile, which I think is wrong. It should be gcc libburner.c -o outputfile.

This command line is missing the argument to link against the library libburn. Consequently the linker reports a lot of "undefined references".

Add -lburn to the command line, or what else is appropriate. You didn't mention the host and target system of your build, too, and it depends.

Note: The command line contains both steps in one: compiling and linking. Please take some minutes to research and to learn how to use GCC from the command line.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

Error on jest when I try to run the test

I get stray '#' in program error when I try to compile this program

Why do I get an error for "__CrtGetFileInformationByHandleEx " when I try to compile

Windows make throws an error when I try to use "if EXIST"

Google Speech Recognition module throws error when I try it out

When I try to declare a global variable it throws the error Statement expected

I got error when i try to acces an image folder?

New to c++ getting an error when I try to compile

Error occurred when I try to compile my code

Error about operator overloading when I try to compile this code

value.isEmpty is throwing error in when i try to compile the code

I have a view that runs fine when executed, but when I try to open it in design mode, it throws a parsing error

Make file error when I try to do with linking the test file

Compile error with GCC when using variable arguments

When I try to compile OpenCv with inference engine enabled, I am getting an error

App folder is not loading in Ext.appliation when i try to test using jasmine

Jackson throws error mapping exception when I try to deserialize a list of objects

Settings.py throws error when I try to import my custom backend

Why my Swift app throws a fatal error when I try to unwrap the optional?

My program throws an error when I try to run it on Linux (works fine on windows)

Python throws a keyword error when I try to retrieve a json metadata from a website

gcc prints no such header file when compile it from upper level folder

I am getting permission error to a folder when I try opening it with io.open

c++ compile error when I try to learn opencv_train_features

Error package org.apache.spark.sql is not a value when I try to compile a SBT in Spark- Scala

Fails to compile, when I try to use include with EJS files. (Error: Child compilation failed.)

when i try to run this cmd "npm run compile:sass" is show me this error

Jest Test logs an error when I try to use toThrow() on an Async Function (but still passes test)

Error when i try to opendir