[Nice] Header name conflict
Youness Alaoui
youness.alaoui at collabora.co.uk
Thu Feb 18 19:18:26 PST 2010
Hi again,
Thanks for the hint, I thought about symlinks, but because of Windows, I
didn't think it's a good idea.
Your idea is good, I won't do symlinks, but simply have a Makefile rule
for the <src_root>/include/nice/*.h file that depend on their respective
header files in nice/ agent/ socket/, and have the makefile copy those
files before proceeding with anything else.
That should work.
Thanks,
Youness.
Tom Kaminski wrote:
> 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:
> 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
>>
> _______________________________________________
> Nice mailing list
> Nice at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/nice
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 262 bytes
Desc: OpenPGP digital signature
Url : http://lists.freedesktop.org/archives/nice/attachments/20100218/ccfd4200/attachment.pgp
More information about the Nice
mailing list