[Nice] Header name conflict

Tom Kaminski ttkaminski at gmail.com
Thu Feb 18 19:07:58 PST 2010


Hi Youness,

Maybe try downloading openssl src and check out how they took care of
this issue.  That project has an <src_root>/include/openssl/*
directory where each header file is symbolically linked to the header
file in the appropriate directory.  Also, there is a
script/makefile/configure that copies each of the header files to a
target directory (as windows systems do not support symbolic links).
You will see that header files are included using #include
<openssl/aes.h> style.  As long as the compiler includes
<src_root>/include, everything should work fine.

Tom


On Thu, Feb 18, 2010 at 8:10 PM, Youness Alaoui
<youness.alaoui at collabora.co.uk> wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Hi Tom,
>
> I checked this.. indeed, you could have some conflicts unfortunately..
> but I can't include <nice/agent.h> and <nice/*.h> because otherwise,
> during development (or when compiling libnice yourself for the first
> time, or when upgrading), it won't be able to find all those headers, or
> it will take the one installed on the system instead of the ones in the
> source directory.
> Although the source directory has priority on /usr/include, the problem
> is that those files are in agent/*.h or socket/*.h, but you need to
> include nice/*.h so it won't find them in the nice/ subdir and it will
> take them from /usr/include.
>
> The next version (or current reliable branch in git) will not include
> socket.h anyways, so that's fine.. I hope I will find a solution to the
> conflicting header names problem without having to break the API or
> duplicate my files into the nice directory...
>
> Thank you for reporting,
> Youness.
>
> Tom Kaminski wrote:
>> Just want to report a some issues with the libnice source that I came
>> across when trying to link to the dll from my application.  When
>> including the libnice headers, some of the filenames conflicted with
>> existing source files in my application (eg. socket.h).   What I ended
>> up doing is identifying the minimum set of libnice header files that I
>> need to include, and moving them to an "include" directory.
>>
>> Here is my include directory:
>> <libnice_src_root>/include/nice.h
>> <libnice_src_root>/include/nice/address.h
>> <libnice_src_root>/include/nice/agent.h
>> <libnice_src_root>/include/nice/candidate.h
>> <libnice_src_root>/include/nice/debug.h
>> <libnice_src_root>/include/nice/interfaces.h
>>
>> I then modified the libnice source files to include the header files
>> using the angle bracket form:
>>
>> #include "agent.h"  =>  #include <nice/agent.h>
>> #include "candidate.h"  =>  #include <nice/candidate.h>
>> etc.
>>
>> Where <libnice_src_root>/include is now included in the default search
>> path for the compiler.
>>
>> I also modified candidate.h to not include socket.h, as it isn't
>> required when linking to the dll (reduces the number of header files
>> to include in the app).
>> #include <nice/socket.h>  replace with => typedef struct _NiceSocket NiceSocket;
>>
>> I was still able to successfully compile libnice with all these
>> changes, and now I can easily include libnice in my project (without
>> header conflicts!).
>> _______________________________________________
>> Nice mailing list
>> Nice at lists.freedesktop.org
>> http://lists.freedesktop.org/mailman/listinfo/nice
>
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.10 (GNU/Linux)
> Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
>
> iEYEARECAAYFAkt98x0ACgkQqvxLNLvrsxx9xwCeJySL4TwxAeI5IrsG1tQhjwSH
> Vk0AnRFVysqp9oYUbXEriXcutX3yuLtd
> =7VVt
> -----END PGP SIGNATURE-----
>


More information about the Nice mailing list