[Nice] Header name conflict

Tom Kaminski ttkaminski at gmail.com
Thu Feb 11 14:02:11 PST 2010

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:

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>

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!).

More information about the Nice mailing list