0

This is the error I'm getting, and I don't quite understand what's going on here:

Undefined symbols for architecture x86_64:
   "set::set(unsigned long)", referenced from:
      _main in test_set.o
      set_union(set const&, set const&) in set.o
      set_intersection(set const&, set const&) in set.o
      set_difference(set const&, set const&) in set.o
   ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

I'm not sure if you can tell me what's going on without seeing the full code, so if you need it just let me know. It's just a lot of code.

  • @Biffen I've read through that and I must be missing something still. Sets are included in the header file. Also, test_set.cpp and set.h were provided files for the assignment, so the error shouldn't be in the code. – user2803662 Feb 20 '17 at 09:15
  • Header files (usually) only *declare* things, so including them won't (shouldn't) solve *linking* errors. You need to make sure that all *definitions* get compiled *and linked*. But this is where it gets impossible to help without seeing some code. And if it's a lot of code you need to cut it down to a [mcve]. – Biffen Feb 20 '17 at 09:17
  • @Biffen You're right. I glanced at the header file and thought it was defined. It was not. I can't believe I got hung up on that for so long. Thanks for your help! – user2803662 Feb 20 '17 at 09:25

0 Answers0