python-MySQLdb iphone - iphone

Does anybody know where to get python-MySQLdb compiled for the arm iPhone architecture? or how to do it?
I'm stucked at this point:
:~/MySQL-python-1.2.3 root# python setup.py build
running build
running build_py
copying MySQLdb/release.py -> build/lib.darwin-10.5-arm-2.5/MySQLdb
running build_ext
building '_mysql' extension
arm-apple-darwin9-gcc -undefined dynamic_lookup -dynamiclib build/temp.darwin-10.5-arm-2.5/_mysql.o -L/usr/local/arm-apple-darwin/lib/ -L/private/var/root/mysql/lib/mysql -lmysqlclient_r -lz -lm -o build/lib.darwin-10.5-arm-2.5/_mysql.dylib
ld: library not found for -lmysqlclient_r
collect2: ld returned 1 exit status
error: command 'arm-apple-darwin9-gcc' failed with exit status 1

i solved the previous problem.....it was the threadsafe = True in site.cfg i had to put False.
Now i have another problem really similar
python setup.py build
running build
running build_py
copying MySQLdb/release.py -> build/lib.darwin-10.5-arm-2.5/MySQLdb
running build_ext
building '_mysql' extension
arm-apple-darwin9-gcc -undefined dynamic_lookup -dynamiclib build/temp.darwin-10.5-arm-2.5/_mysql.o -L/usr/local/arm-apple-darwin/lib/ -L/private/var/root/mysql/lib/mysql -lmysqlclient -lz -lm -o build/lib.darwin-10.5-arm-2.5/_mysql.dylib
ld: library not found for -lm
collect2: ld returned 1 exit status
error: command 'arm-apple-darwin9-gcc' failed with exit status 1
Which Library is needed for -lm?? (for example for -lz it needs zlib library).

Related

VS code error : exited with code 1 in mac os

Running] cd "/Users/abhiaryan/Desktop/c+++/" && g++ demo.cpp -o demo && "/Users/abhiaryan/Desktop/c+++/"demo
Undefined symbols for architecture arm64:
"_main", referenced from:
implicit entry/start for main executable
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
[Done] exited with code=1 in 0.052 seconds
the screen shots are here
go to settings > search for run > select save file before run
It resolved my same issue.

Object file not created after building

I am getting an error when I am compiling my project on Eclipse Kepler.
The project builds successfully, but the object is unsuccessfully created.
I am getting the following output on my console
23:13:32 **** Build of configuration Debug for project Dictionary ****
make all
Building file: ../src/Diction.cpp
Invoking: GCC C++ Compiler
g++ -O0 -g3 -Wall -c -fmessage-length=0 -MM -MMD -MP -MF"src/Diction.d" -MT"src/Diction.d" -o "src/Diction.o" "../src/Diction.cpp"
Finished building: ../src/Diction.cpp
Building target: Dictionary
Invoking: GCC C++ Linker
g++ -o "Dictionary" ./src/Diction.o
./src/Diction.o: file not recognized: File truncated
collect2: ld returned 1 exit status
make: *** [Dictionary] Error 1
23:13:32 Build Finished (took 69ms)
Can someone please tell me what am I doing wrong??

Apple Mach-O Linker (ID) Error _compress and linker command failed with exit code 1

I have been working on an app to upload photo images from an iPhone to a web server for internship, but every time I try to run the app, I get a Mach-O Linker Error.
I have tried everything I found on this site (recreating the app, add libz.dylib, add QuartzCore.Framework), but the errors still remain.
Anyone know what's wrong with the code?
Error
Undefined symbols for architecture x86_64:<br>
"_compress", referenced from:<br>
-[Uploader(Private) compress:] in AppDelegate.o<br>
ld: symbol(s) not found for architecture x86_64<br>
clang: error: linker command failed with exit code 1 (use -v to see invocation)<br>
Ld /Users/AppleStoreStaples/Library/Developer/Xcode/DerivedData/PhotoUploader-bafqzogdtrxrvdgesppeismhxrkf/Build/Products/Debug/PhotoUploader.app/Contents/MacOS/PhotoUploader normal x86_64
cd /Users/AppleStoreStaples/Documents/Projects/PhotoUploader
setenv MACOSX_DEPLOYMENT_TARGET 10.7
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -arch x86_64 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk -L/Users/AppleStoreStaples/Library/Developer/Xcode/DerivedData/PhotoUploader-bafqzogdtrxrvdgesppeismhxrkf/Build/Products/Debug -F/Users/AppleStoreStaples/Library/Developer/Xcode/DerivedData/PhotoUploader-bafqzogdtrxrvdgesppeismhxrkf/Build/Products/Debug -filelist /Users/AppleStoreStaples/Library/Developer/Xcode/DerivedData/PhotoUploader-bafqzogdtrxrvdgesppeismhxrkf/Build/Intermediates/PhotoUploader.build/Debug/PhotoUploader.build/Objects-normal/x86_64/PhotoUploader.LinkFileList -mmacosx-version-min=10.7 -fobjc-link-runtime -framework QuartzCore -framework Cocoa -o /Users/AppleStoreStaples/Library/Developer/Xcode/DerivedData/PhotoUploader-bafqzogdtrxrvdgesppeismhxrkf/Build/Products/Debug/PhotoUploader.app/Contents/MacOS/PhotoUploader
Your AppDelegate file includes a category called Uploader (Private). It defines a method called compress:, which uses a function called compress(). You haven't linked whatever implements the compress() function into the app binary.

ImageMagick Mac OS Eclipse Linker Issue

I am trying to use ImageMagick 6.7.3 with a C++ project in eclipse on my mac air running osx lion. I have been fighting with it for a few days googling and researching I can't seem to get the linker to find the files no matter what I try. Here is my linker log from eclipse does anyone have any idea why this isnt working?
I have populated the library search path and the include path settings in properties -> c/c++ build -> settings menus with the paths to the ImageMagick installation. Any help would be greatly appreciated!!!
Build of configuration Debug for project ImportingLibrary **
make all
Building target: ImportingLibrary
Invoking: MacOS X C++ Linker
g++ -L/Users/jon/Programs/ImageMagick-6.7.3/lib -o "ImportingLibrary" ./src/ChoicePath.o ./src/ImageCreation.o ./src/NavFocus.o ./src/RouteInputAnalyzer.o
Undefined symbols for architecture x86_64:
"_MagickWandGenesis", referenced from:
_main in NavFocus.o
ld: symbol(s) not found for architecture x86_64
collect2: ld returned 1 exit status
make: * [ImportingLibrary] Error 1
Build Finished **
Build of configuration Release for project ImportingLibrary **
make all
Building file: ../src/NavFocus.cpp
Invoking: GCC C++ Compiler
g++ -O3 -Wall -c -fmessage-length=0 -MMD -MP -MF"src/NavFocus.d" -MT"src/NavFocus.d" -o "src/NavFocus.o" "../src/NavFocus.cpp"
../src/NavFocus.cpp:13:29: warning: wand/MagickWand.h: No such file or directory
../src/NavFocus.cpp: In function 'int main()':
../src/NavFocus.cpp:19: error: 'MagickWandGenesis' was not declared in this scope
make: * [src/NavFocus.o] Error 1
Build Finished **

iPhone toolchain problems

I built an iPhone toolchain on Ubuntu based on the directions at http://www.saurik.com/id/4 . When I try to compile something as simple as:
int main () {
return 4;
}
It gives me this:
Undefined symbols:
"_main", referenced from:
_main$non_lazy_ptr in crt1.o
ld: symbol(s) not found
collect2: ld returned 1 exit status
This happens for both the crt1.o from the iPhone SDK and from the http://code.google.com/p/iphone-dev/wiki/Building . Using -save-temps, I found out that the cc1 command produced no output. Why is that? Is there something wrong with my specs file?
Using built-in specs.
Target: arm-apple-darwin10
Configured with: ../llvm-gcc-4.2-2.8.source/configure --target=arm-apple-darwin10 --prefix=/home/kevin/it --with-sysroot=/home/kevin/is --enable-languages=c,c++,objc,obj-c++ --with-as=/home/kevin/it/bin/arm-apple-darwin10-as --with-ld=/home/kevin/it/bin/arm-apple-darwin10-ld --enable-wchar_t=no --with-gxx-include-dir=/usr/include/c++/4.2.1
Thread model: posix
gcc version 4.2.1 (Based on Apple Inc. build 5658)
/home/kevin/it/libexec/gcc/arm-apple-darwin10/4.2.1/cc1 -quiet -v -D__DYNAMIC__ test.c -miphoneos-version-min=3.0 -fPIC -fno-builtin-strcat -fno-builtin-strcpy -quiet -dumpbase test.c -auxbase test -version -o /tmp/ccyVHwhV.s
ignoring nonexistent directory "/home/kevin/is/usr/local/include"
ignoring nonexistent directory "/home/kevin/is/home/kevin/it/lib/gcc/arm-apple-darwin10/4.2.1/../../../../arm-apple-darwin10/include"
ignoring nonexistent directory "/home/kevin/is/Library/Frameworks"
#include "..." search starts here:
#include <...> search starts here:
/home/kevin/it/lib/gcc/arm-apple-darwin10/4.2.1/include
/home/kevin/is/usr/include
/home/kevin/is/System/Library/Frameworks (framework directory)
End of search list.
GNU C version 4.2.1 (Based on Apple Inc. build 5658) (arm-apple-darwin10)
compiled by GNU C version 4.4.5.
GGC heuristics: --param ggc-min-expand=150 --param ggc-min-heapsize=131072
Compiler executable checksum: 47b826ed9d7049d0b0acd26e928e4c9e
/home/kevin/it/bin/arm-apple-darwin10-as -arch arm -force_cpusubtype_ALL -o /tmp/cck3gviA.o /tmp/ccyVHwhV.s
ERROR: ld.so: object '/etc/override.so' from /etc/ld.so.preload cannot be preloaded: ignored.
ERROR: ld.so: object '/etc/override.so' from /etc/ld.so.preload cannot be preloaded: ignored.
/home/kevin/it/libexec/gcc/arm-apple-darwin10/4.2.1/collect2 -dynamic -arch arm -force_cpusubtype_ALL -iphoneos_version_min 3.0 -syslibroot /home/kevin/is -weak_reference_mismatches non-weak -o test -lcrt1.o -L/home/kevin/is/usr/lib -L/home/kevin/it/lib/gcc/arm-apple-darwin10/4.2.1 -L/home/kevin/it/lib/gcc/arm-apple-darwin10/4.2.1/../../../../arm-apple-darwin10/lib /tmp/cck3gviA.o -lgcc -lSystem
ERROR: ld.so: object '/etc/override.so' from /etc/ld.so.preload cannot be preloaded: ignored.
ld warning: unknown option to -iphoneos_version_min, not 1.x or 2.x
Undefined symbols:
"_main", referenced from:
_main$non_lazy_ptr in crt1.o
ld: symbol(s) not found
collect2: ld returned 1 exit status
Never mind, it turns out that I forgot to compile llvm along with it, and I didn't realize that obviously llvm-gcc would need llvm to function correctly.