Don't you just love it when your computer is working fine, you work with some good examples, everything is wonderful and your relationship with your computer is the best? I do. But what happens when your computer gets upgraded or maybe something changes along the way and then you come back to some old programs that you need? Two things can happen, either they work or they don't.
It has happened again. I'm not sure what I did in my macbook to mess up some path or to delete something that Mathematica needs but now my MathLink program isn't working.
Consider the solution I offered a while ago:
https://mathematica.stackexchange.com/a/5730/877
In this answer I explained step by step how to get the MathLink program to work. I have the source code and I repeatedly compiled it and it was working fine.
Today as I was writing a new MathLink program I started to get errors which I just couldn't figure out. So I went back to a program which I knew worked in the past and to my surprise, now that program doesn't work.
I had made a MakeFile for my mathlink program, here is the trash I get now when I run it:
dhcp09:mma jmlopez$ make
/Applications/Mathematica.app/SystemFiles/Links/MathLink/DeveloperKit/CompilerAdditions/mprep mlprog.tm -o mlprogtm.cpp
g++ -c -I/Applications/Mathematica.app/SystemFiles/Links/MathLink/DeveloperKit/CompilerAdditions mlprogtm.cpp
g++ -c -I/Applications/Mathematica.app/SystemFiles/Links/MathLink/DeveloperKit/CompilerAdditions mlprog.cpp
g++ -I/Applications/Mathematica.app/SystemFiles/Links/MathLink/DeveloperKit/CompilerAdditions mlprogtm.o mlprog.o ../fortran/myprog.o ../fortran/libminuit.a -L/Applications/Mathematica.app/SystemFiles/Links/MathLink/DeveloperKit/CompilerAdditions -lMLi3 -lstdc++ -lgfortran -framework Foundation -o mlprog
Undefined symbols for architecture x86_64:
"__Unwind_Resume", referenced from:
_mlipinterfacecontainer_new in libMLi3.a(mlipinterface.c.o)
_mlipinterfacecontainer_interfaces_changed in libMLi3.a(mlipinterface.c.o)
_mlipinterfacecontainer_get_decimal_names in libMLi3.a(mlipinterface.c.o)
_mlipinterfacecontainer_get_domain_names in libMLi3.a(mlipinterface.c.o)
MLLists::MLList<std::basic_string<char, std::char_traits<char>, std::allocator<char> > >::~MLList()in libMLi3.a(mlipinterface.c.o)
MLLists::MLList<std::basic_string<char, std::char_traits<char>, std::allocator<char> > >::~MLList()in libMLi3.a(mlipinterface.c.o)
MLHashTables::MLHashTable<std::basic_string<char, std::char_traits<char>, std::allocator<char> >, bool, MLHashTables::MLGenericHashFunction<std::basic_string<char, std::char_traits<char>, std::allocator<char> > > >::~MLHashTable()in libMLi3.a(mlipinterface.c.o)
...
ld: symbol(s) not found for architecture x86_64
collect2: ld returned 1 exit status
make: *** [mlprog] Error 1
Oh, and this is not just for my programs, the example programs also don't work anymore. When I run make in
/Applications/Mathematica.app/SystemFiles/Links/MathLink/DeveloperKit/MathLinkExamples
I get the same errors:
/usr/bin/gcc -c -I/Applications/Mathematica.app/SystemFiles/Links/MathLink/DeveloperKit/MathLinkExamples/../CompilerAdditions addtwotm.c
/usr/bin/gcc -c -I/Applications/Mathematica.app/SystemFiles/Links/MathLink/DeveloperKit/MathLinkExamples/../CompilerAdditions addtwo.c
/usr/bin/c++ -I/Applications/Mathematica.app/SystemFiles/Links/MathLink/DeveloperKit/MathLinkExamples/../CompilerAdditions addtwotm.o addtwo.o -L/Applications/Mathematica.app/SystemFiles/Links/MathLink/DeveloperKit/MathLinkExamples/../CompilerAdditions -lMLi3 -lstdc++ -framework Foundation -o addtwo
Undefined symbols for architecture x86_64:
"__Unwind_Resume", referenced from:
_mlipinterfacecontainer_new in libMLi3.a(mlipinterface.c.o)
_mlipinterfacecontainer_interfaces_changed in libMLi3.a(mlipinterface.c.o)
_mlipinterfacecontainer_get_decimal_names in libMLi3.a(mlipinterface.c.o)
_mlipinterfacecontainer_get_domain_names in libMLi3.a(mlipinterface.c.o)
MLLists::MLList<std::basic_string<char, std::char_traits<char>, std::allocator<char> > >::~MLList()in libMLi3.a(mlipinterface.c.o)
MLLists::MLList<std::basic_string<char, std::char_traits<char>, std::allocator<char> > >::~MLList()in libMLi3.a(mlipinterface.c.o)
MLHashTables::MLHashTable<std::basic_string<char, std::char_traits<char>, std::allocator<char> >, bool, MLHashTables::MLGenericHashFunction<std::basic_string<char, std::char_traits<char>, std::allocator<char> > > >::~MLHashTable()in libMLi3.a(mlipinterface.c.o)
...
ld: symbol(s) not found for architecture x86_64
collect2: ld returned 1 exit status
make: *** [addtwo] Error 1
Have you experienced this? Did I do something to my computer to mess it up? How do I fix it so that I can get back to my actual work? I know this must be because it can't find some libraries but I don't know which libraries it now decided that it wants. This problem is under Mac OS X.