c++ - include file conflict resolution -


i have c++ project building on linux using g++. have 2 "include directories" have add arguments using -i. problem in each of these directories, have overlapping , common files. when have

g++ -o program program.cpp -i/foo/include -i/bar/include  

i compiler warnings so:

stdint.h:174:0: warning: "__uint64_c" redefined [enabled default] #define __uint64_c(c)     c ## ull 

what best way can include files selectively not face issues this?

your problems seems more due overlapping definitions files happen have same name. either way, i'd suggest following fix:

don't use files both of these libraries in same file in application. have files use first library , use second. files use first library compiled include path. files use second library compiled include path.

if need integrate calls both libraries in same code, wrap 1 or both libraries sanitized interface file , identifier names don't conflict project's names.


Comments

Popular posts from this blog

sublimetext3 - what keyboard shortcut is to comment/uncomment for this script tag in sublime -

java - No use of nillable="0" in SOAP Webservice -

ubuntu - Laravel 5.2 quickstart guide gives Not Found Error -