[Nice] Header name conflict

Youness Alaoui youness.alaoui at collabora.co.uk
Thu Feb 18 18:10:37 PST 2010


-----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