bug-xorriso
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Bug-xorriso] Link errors against libisoburn


From: Gabe Johnson
Subject: Re: [Bug-xorriso] Link errors against libisoburn
Date: Tue, 15 Mar 2016 11:15:13 -0500

Thank you for the email Thomas. 

I just found out the way to fix the issue is wrap the libburn, libisofs, and libisoburn within extern "C" for example.

extern "C"
{
#include <libburn/libburn.h>
#include <libisofs/libisofs.h>
#include <libisoburn/libisoburn.h>
}

int main()
{
    ...
}

Thanks again for the reply.

Gabe
On Mar 15, 2016 12:05 PM, "Thomas Schmitt" <address@hidden> wrote:
>
> Hi,
>
> i tried something similar (and learned that i have to include
> more type defining headers in libisoburn.h)
>
> -----------------------------------------------------------------
> #include <ctype.h>
> #include <sys/types.h>
> #include <unistd.h>
> #include <stdlib.h>
> #include <stdint.h>
>
>
> #include <libburn/libburn.h>
> #include <libisofs/libisofs.h>
> #include <libisoburn/libisoburn.h>
>
> int main(int argc, char **argv)
> {
>  char msg[1024];
>
>  return isoburn_initialize(msg, 0);
> }
> -----------------------------------------------------------------
>
> The problem seems to get introduced by
>
>   g++ -c main.c
>
> because this works:
>
>   gcc -c main.c
>   g++ -o isoburntest main.o -lisofs -lburn -lisoburn
>
> whereas this does not
>
>   g++ -c main.c
>   cc -o isoburntest main.o -lisofs -lburn -lisoburn
>
> but rather reports
>
>   main.c:(.text+0x28): undefined reference to `isoburn_initialize(char*, int)'
>
> It happens alike with
>
>   g++ -o isoburntest main.c -lisofs -lburn -lisoburn
>
> Currently i am clueless what g++ might want as extra info so that
> it produces linkable main.o.
>
> It works with a sub.o which contains a isoburn_initialize() dummy:
>
>   g++ -c main.c
>   g++ -c sub.c
>   g++ -o isoburntest  main.o sub.o
>
> So it must have to do something with the way how g++ -c produces
> the symbolic link address which ld under g++ or gcc shall resolve.
>
> Google does not help me here.
> I will continue to poner but probably you need advise from C++ experts.
>
>
> Have a nice day :)
>
> Thomas
>


reply via email to

[Prev in Thread] Current Thread [Next in Thread]