On 11/7/19 2:28 PM, yuan wrote: > Hi, All, > > I suffered one problem of multiple definition when compiling, what I did > is adding some new functions I need in a file name my_func.hh under > src/mem/, and in the file cache.cc where I need these functions I use > #include “mem/my_func.hh”, but when I re-compile the gem5, it always > shows the error of multiple definition of “the name of my func”. Does > anyone have some hints on this? >
Are you putting your function definitions in the headers? If so, you have to put declarations in the headers and definitions in a my_func.cc file. > Best, > > Yuan > > Sent from Mail <https://go.microsoft.com/fwlink/?LinkId=550986> for > Windows 10 > > > _______________________________________________ > gem5-users mailing list > gem5-users@gem5.org > http://m5sim.org/cgi-bin/mailman/listinfo/gem5-users > _______________________________________________ gem5-users mailing list gem5-users@gem5.org http://m5sim.org/cgi-bin/mailman/listinfo/gem5-users