IOsipov / androguard

Automatically exported from code.google.com/p/androguard
Apache License 2.0
0 stars 0 forks source link

make error on OSX 10.7.3 #21

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Grab source from mercurial, or 0.9 or 1.0RC1
2. Edit *.h files to point to correct location of hash_map

#ifdef __APPLE__
#include <ext/hash_map>
#else
#include <ext/hash_map>

3. Install all prerequisites

4. type 'make'

What is the expected output? What do you see instead?

Expected output: all sources should be compiled

What I get:

Undefined symbols for architecture x86_64:
  "_PyType_GenericNew", referenced from:
      _initdvmnative in dvm.o
  "_PyType_Ready", referenced from:
      _initdvmnative in dvm.o
  "_Py_InitModule4_64", referenced from:
      _initdvmnative in dvm.o
  "_PyModule_AddObject", referenced from:
      _initdvmnative in dvm.o
  "_Py_BuildValue", referenced from:
      DCode_get_nb_bytecodes(dvm_DCodeObject*, _object*)      in dvm.o
      DBC_get_opvalue(dvm_DBCObject*, _object*)     in dvm.o
      DBC_get_length(dvm_DBCObject*, _object*)     in dvm.o
      DBC_get_type_ins(dvm_DBCObject*, _object*)     in dvm.o
      DBCSpe_get_opvalue(dvm_DBCSpeObject*, _object*)     in dvm.o
      DBCSpe_get_length(dvm_DBCSpeObject*, _object*)     in dvm.o
      DBCSpe_get_type_ins(dvm_DBCSpeObject*, _object*)     in dvm.o
      ...
  "_PyList_New", referenced from:
      DCode_get_bytecodes(dvm_DCodeObject*, _object*)      in dvm.o
      DCode_get_bytecodes_spe(dvm_DCodeObject*, _object*)      in dvm.o
      DBC_get_operands(dvm_DBCObject*, _object*)     in dvm.o
      DBCSpe_get_operands(dvm_DBCSpeObject*, _object*)     in dvm.o
      DBCSpe_get_targets(dvm_DBCSpeObject*, _object*)     in dvm.o
  "_PyList_Append", referenced from:
      DCode_get_bytecodes(dvm_DCodeObject*, _object*)      in dvm.o
      DCode_get_bytecodes_spe(dvm_DCodeObject*, _object*)      in dvm.o
      DBC_get_operands(dvm_DBCObject*, _object*)     in dvm.o
      DBCSpe_get_operands(dvm_DBCSpeObject*, _object*)     in dvm.o
      DBCSpe_get_targets(dvm_DBCSpeObject*, _object*)     in dvm.o
  "_PyArg_ParseTuple", referenced from:
      DCode_init(dvm_DCodeObject*, _object*, _object*)in dvm.o
  "_PyString_FromString", referenced from:
      DBC_get_name(dvm_DBCObject*, _object*)     in dvm.o
      DBC_get_operands(dvm_DBCObject*, _object*)     in dvm.o
      DBCSpe_get_name(dvm_DBCSpeObject*, _object*)     in dvm.o
  "_PyInt_FromLong", referenced from:
      DBC_get_operands(dvm_DBCObject*, _object*)     in dvm.o
      DBCSpe_get_operands(dvm_DBCSpeObject*, _object*)     in dvm.o
      DBCSpe_get_targets(dvm_DBCSpeObject*, _object*)     in dvm.o
  "_PyString_FromStringAndSize", referenced from:
      DBCSpe_get_operands(dvm_DBCSpeObject*, _object*)     in dvm.o
  "__Py_NoneStruct", referenced from:
      DBCSpe_get_operands(dvm_DBCSpeObject*, _object*)     in dvm.o
      DBCSpe_get_targets(dvm_DBCSpeObject*, _object*)     in dvm.o
ld: symbol(s) not found for architecture x86_64
collect2: ld returned 1 exit status
make: *** [LIBDVM] Error 1

What version of the product are you using? On what operating system?

Androguard from mercurial, 0.9 or 1.0RC1
OSX 10.7.2
Python 2.7.1 (standard Python package that was shipped with OSX)

Please provide any additional information below.

g++ was installed from Command Line Tools for Xcode:

Using built-in specs.
Target: i686-apple-darwin11
Configured with: /private/var/tmp/llvmgcc42/llvmgcc42-2336.9~22/src/configure 
--disable-checking --enable-werror 
--prefix=/Applications/Xcode.app/Contents/Developer/usr/llvm-gcc-4.2 
--mandir=/share/man --enable-languages=c,objc,c++,obj-c++ 
--program-prefix=llvm- --program-transform-name=/^[cg][^.-]*$/s/$/-4.2/ 
--with-slibdir=/usr/lib --build=i686-apple-darwin11 
--enable-llvm=/private/var/tmp/llvmgcc42/llvmgcc42-2336.9~22/dst-llvmCore/Develo
per/usr/local --program-prefix=i686-apple-darwin11- 
--host=x86_64-apple-darwin11 --target=i686-apple-darwin11 
--with-gxx-include-dir=/usr/include/c++/4.2.1
Thread model: posix
gcc version 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2336.9.00)

Original issue reported on code.google.com by meli...@gmail.com on 6 Mar 2012 at 6:18

GoogleCodeExporter commented 9 years ago

Original comment by anthony....@gmail.com on 6 Mar 2012 at 7:24

GoogleCodeExporter commented 9 years ago
have you more traceback ?

Original comment by anthony....@gmail.com on 9 Mar 2012 at 5:48

GoogleCodeExporter commented 9 years ago
Nope - this is the only error that I get.

I played around with -march=x86 CFLAGS but that produces a different make 
error. 

Original comment by meli...@gmail.com on 11 Mar 2012 at 4:34

GoogleCodeExporter commented 9 years ago
Ok.

I will try to have an access to OSX to have more information

Original comment by anthony....@gmail.com on 13 Mar 2012 at 11:35

GoogleCodeExporter commented 9 years ago
I get the same problem under mac os x.
you can just append '-lpython' on LDFLAGS in Makefile to solve it.

Original comment by xiaozih...@gmail.com on 21 Mar 2012 at 3:00

GoogleCodeExporter commented 9 years ago
Ok.

But you can skip the compilation of this module if you would like to work with 
androguard, because I have the same "things" in python.

But I will fix that :)

Original comment by anthony....@gmail.com on 21 Mar 2012 at 8:16

GoogleCodeExporter commented 9 years ago
Hi, adding -lpython to LDFLAGS fixes the issues. Thanks!

Original comment by meli...@gmail.com on 22 Mar 2012 at 4:41

GoogleCodeExporter commented 9 years ago
Fixed in the mercurial repository.

Thx

Original comment by anthony....@gmail.com on 23 Mar 2012 at 8:48