0

I am pretty new to C++ and am using gcc 7.5.0 compiler. I want to use the following Parallel Max Clique (PMC) library in my code. So I downloaded the whole and repo and added the folder to my current working directory (where my main.cpp i.e. the program in which I want to include the pmc library, is). After building the file I got the following error :

"undefined reference to `pmc::pmc_graph::pmc_graph(std::__cxx11::basic_string<char, std::char_traits, std::allocator > const&)'|"

Now, I know why this is happening, this is happening because the PMC Library was written in an old compiler, and hence I am probably trying to link together object files that were compiled with different values for the _GLIBCXX_USE_CXX11_ABI macro. check link. The solution is to ensure that my underlying libraries (i.e. PMC library) and my current cpp code(i.e. main.cpp) are compiled with either ABI off. Google search says that I have to build the whole code with -D_GLIBCXX_USE_CXX11_ABI=0. How shall I do it?? I am very confused. Is there any tutorial as to how shall I do it. I am currently using VScode/CodeBlocks.

Thanks a lot in Advance.

CR7
  • 21
  • 5
  • Why not just rebuild the PMC library with the new compiler? – n. m. could be an AI Oct 11 '20 at 06:35
  • How to do that?? – CR7 Oct 11 '20 at 06:40
  • Download the source, run `make`... – n. m. could be an AI Oct 11 '20 at 06:43
  • I did that too. I get the following error "g++ -O3 -fPIC -o pmc pmc_driver.o pmc_utils.cpp pmc_graph.cpp pmc_clique_utils.cpp pmc_heu.cpp pmc_maxclique.cpp pmcx_maxclique.cpp pmcx_maxclique_basic.cpp pmc_cores.cpp -fopenmp pmc_utils.cpp: In function ‘bool fexists(const char*)’: pmc_utils.cpp:26:12: error: cannot convert ‘std::ifstream {aka std::basic_ifstream}’ to ‘bool’ in return return ifile; ^~~~~ Makefile:42: recipe for target 'pmc' failed make: *** [pmc] Error 1 " – CR7 Oct 11 '20 at 06:44
  • change `return ifile` to `return ifile.good()`, there should be no other problems. – n. m. could be an AI Oct 11 '20 at 06:47
  • OK, So i was able to make it successfully, but now how do I include the pmc library and use the pmc_graph(filename) constructor. – CR7 Oct 11 '20 at 07:03
  • I'm terribly sorry but this is not a free interactive tutorial on using C++. Comments are here to clarify the question. If you have a question, please hit the "Ask a question" button. – n. m. could be an AI Oct 11 '20 at 07:07

0 Answers0