title: Getting undefined symbols when porting linux compiled program to macOS
body: <p>I'm trying to compile a program on MAC OSX, originally written on the Linux OS. It is a big program with several makefiles. I have been working on it for weeks and now cannot seem to figure out why is causing undefined symbols errors. There is one overarching Makefile that calls upon the other makefiles so that the order of compilation is correct.</p>
  
  <p>When you compile, it creates static libraries as well as multiple applications. Because this guys is so huge, the program creates these static libraries (.a files) first. Then when it compiles the source code specifically for the application, it links the static libraries. (hopefully that wasn't too confusing) .</p>
  
  <p>I can get past the building of the static libraries just fine, but once i reach the point when the application is getting built, i receive tons, of undefined symbol errors telling me, for example</p>
  
  <p>Undefined symbols:
    "_bagUpdateOptSurface", referenced from:
        _dbv_bag in libdbdbv6.a(dbv_bag.o)</p>
  
  <p>When i check dbv_bag.o with nm, i get a lot of functions that are undefined with the header U .</p>
  
  <p>i can trace back this function with nm and find that ... </p>
  
  <p>bagUpdateOptSurface.c -->bagUpdateOptSurface.o -->libbag.a --->dbv_bag.c --->dbv_bag.o --->libdbdv6.a --->application</p>
  
  <p>the function is defined through the static library libbag.a with the header T, but the object file dbb_bag.o has it as undefined with U. Somewhere in there the information is lost and i cannot seem to understand why.</p>
  
  <p>if someone out there with more experience porting programs to mac can help shed some light on what is going on, i would very much grateful. Any ideas right or wrong, is welcome.</p>
  
  <p>thanks in advance</p>