|
From: Carlos L. <ca...@aa...> - 2015-03-31 15:50:35
|
I'm not sure if this is the right place to ask, but I'm not sure where else to look. I went on Stack Overflow ( http://stackoverflow.com/questions/29358095/issue-with-undefined-symbol-main-when-compiling-swig-wrapper ) but haven't received an answer. I'm on Mac OS X 10.10.2 (64-bit) and I have the swig and swig-python packages installed through MacPorts, as well as Xcode and the command line tools installed. I'm trying to create a wrapper from the Steamworks C++ API to Python. I have the following interface file (steamworks.i): %module steamworks %{ #define SWIG_FILE_WITH_INIT #include "/Users/aarzee/Documents/steamworks-sdk/public/steam/steam_api.h" %} I'm running these commands: swig -c++ -python steamworks.i g++ -O2 -fPIC -c steamworks_wrap.cxx -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.10.sdk/System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 g++ -L/Users/aarzee/Documents/steamworks-sdk/redistributable_bin/osx32 -lsteam_api -lpython steamworks_wrap.o The first two commands seem to work fine, but when I do the second g++ invocation, I get this error: Undefined symbols for architecture x86_64: "_main", referenced from: implicit entry/start for main executable ld: symbol(s) not found for architecture x86_64 clang: error: linker command failed with exit code 1 (use -v to see invocation) I did a little research on this and it seems that this can be caused by premature linking, but I am using the -c option in the first g++ invocation. Any help would be appreciated. - CL |