Building a Window exe using MinGW, Windows-7 in virtual machine - gcc

I'm working in Windows 7, 64 bit, running in a Virtual Box machine on a (recent-ish) Mac with Intel processor.
I have MinGW installed:
gcc -dumpmachine
>>> x86_64-w64-mingw32
I am trying to compile a Windows exe for this code (Landsat-8 routines for solar and satellite angle calculations):
gcc -I ias_lib -o l8_angle.exe -c l8_angle.c
which gives me no errors or warnings when run, and creates l8_angle.exe as expected. When opened, the exe gives:
The version of this file is not compatible with the version of Windows
you're running. Check your computer's system information to see
whether you need an x86 (32-bit) for x64 (64-bit) version of the
program, and then contact the software publisher.
Is it possible to compile this program on my setup?
If you're wondering I can run make on the Mac OS side to get a Linux executable, but I need a Windows executable for my production machine.

I was able to compile successully by echoing the gcc statements in both makefiles:
#echo $(value INCS)
which for some reasom prints the completely assembled gcc command. I then confirmed what the selected flags did and saw that they were all equally appropriate for a Windows build.
The build commands were then:
cd ias_lib
gcc -g -Wall -O2 -march=nocona -mfpmath=sse -msse2 -c ias_angle_gen_calculate_angles_rpc.c -o ias_angle_gen_calculate_angles_rpc.o
gcc -g -Wall -O2 -march=nocona -mfpmath=sse -msse2 -c ias_angle_gen_read_ang.c -o ias_angle_gen_read_ang.o
gcc -g -Wall -O2 -march=nocona -mfpmath=sse -msse2 -c ias_angle_gen_utilities.c -o ias_angle_gen_utilities.o
gcc -g -Wall -O2 -march=nocona -mfpmath=sse -msse2 -c ias_angle_gen_initialize.c -o ias_angle_gen_initialize.o
gcc -g -Wall -O2 -march=nocona -mfpmath=sse -msse2 -c ias_angle_gen_write_image.c -o ias_angle_gen_write_image.o
gcc -g -Wall -O2 -march=nocona -mfpmath=sse -msse2 -c ias_angle_gen_find_scas.c -o ias_angle_gen_find_scas.o
gcc -g -Wall -O2 -march=nocona -mfpmath=sse -msse2 -c ias_geo_convert_dms2deg.c -o ias_geo_convert_dms2deg.o
gcc -g -Wall -O2 -march=nocona -mfpmath=sse -msse2 -c ias_math_compute_unit_vector.c -o ias_math_compute_unit_vector.o
gcc -g -Wall -O2 -march=nocona -mfpmath=sse -msse2 -c ias_math_compute_vector_length.c -o ias_math_compute_vector_length.o
gcc -g -Wall -O2 -march=nocona -mfpmath=sse -msse2 -c ias_math_find_line_segment_intersection.c -o ias_math_find_line_segment_intersection.o
gcc -g -Wall -O2 -march=nocona -mfpmath=sse -msse2 -c ias_logging.c -o ias_logging.o
gcc -g -Wall -O2 -march=nocona -mfpmath=sse -msse2 -c ias_misc_create_output_image_trim_lut.c -o ias_misc_create_output_image_trim_lut.o
gcc -g -Wall -O2 -march=nocona -mfpmath=sse -msse2 -c ias_misc_convert_to_uppercase.c -o ias_misc_convert_to_uppercase.o
gcc -g -Wall -O2 -march=nocona -mfpmath=sse -msse2 -c ias_misc_write_envi_header.c -o ias_misc_write_envi_header.o
gcc -g -Wall -O2 -march=nocona -mfpmath=sse -msse2 -c ias_odl_free_tree.c -o ias_odl_free_tree.o
gcc -g -Wall -O2 -march=nocona -mfpmath=sse -msse2 -c ias_odl_get_field.c -o ias_odl_get_field.o
gcc -g -Wall -O2 -march=nocona -mfpmath=sse -msse2 -c ias_odl_read_tree.c -o ias_odl_read_tree.o
gcc -g -Wall -O2 -march=nocona -mfpmath=sse -msse2 -c ias_parm_provide_help.c -o ias_parm_provide_help.o
gcc -g -Wall -O2 -march=nocona -mfpmath=sse -msse2 -c ias_parm_read.c -o ias_parm_read.o
gcc -g -Wall -O2 -march=nocona -mfpmath=sse -msse2 -c ias_parm_map_odl_type.c -o ias_parm_map_odl_type.o
gcc -g -Wall -O2 -march=nocona -mfpmath=sse -msse2 -c ias_parm_check_ranges.c -o ias_parm_check_ranges.o
gcc -g -Wall -O2 -march=nocona -mfpmath=sse -msse2 -c ias_satellite_attributes.c -o ias_satellite_attributes.o
gcc -g -Wall -O2 -march=nocona -mfpmath=sse -msse2 -c landsat8.c -o landsat8.o
gcc -g -Wall -O2 -march=nocona -mfpmath=sse -msse2 -c lablib3.c -o lablib3.o
ar -r libl8ang.a ias_angle_gen_calculate_angles_rpc.o ias_angle_gen_read_ang.o ias_angle_gen_utilities.o ias_angle_gen_initialize.o ias_angle_gen_write_image.o ias_angle_gen_find_scas.o ias_geo_convert_dms2deg.o ias_math_compute_unit_vector.o ias_math_compute_vector_length.o ias_math_find_line_segment_intersection.o ias_logging.o ias_misc_create_output_image_trim_lut.o ias_misc_convert_to_uppercase.o ias_misc_write_envi_header.o ias_odl_free_tree.o ias_odl_get_field.o ias_odl_read_tree.o ias_parm_provide_help.o ias_parm_read.o ias_parm_map_odl_type.o ias_parm_check_ranges.o ias_satellite_attributes.o landsat8.o lablib3.o
cd ..
gcc -g -Wall -O2 -march=nocona -mfpmath=sse -msse2 -I./ias_lib/ -I./ -c -o l8_angles.o l8_angles.c
gcc -g -Wall -O2 -march=nocona -mfpmath=sse -msse2 -I./ias_lib/ -I./ -c -o angles_api.o angles_api.c
gcc -g -Wall -O2 -I./ias_lib/ -I./ -o l8_angles.exe ias_lib/libl8ang.a l8_angles.o angles_api.o -L./ias_lib/ -ll8ang -lm
where the only change was in the final line, l8_angles.exe rather than l8_angles. If anyone has a more straightforward way, I would love to see it.

Related

Error installing Mike's Arbitrary Precision Math Library (MAPM)

Please I need help, I need to install this library quickly for a project I am working on (https://github.com/LuaDist/mapm) and I don't understand makefile. Per the instructions I run the command "make" and get the following output:
gcc -c -Wall -O2 mapmhsin.c
gcc -c -Wall -O2 mapm_pow.c
gcc -c -Wall -O2 mapm_log.c
gcc -c -Wall -O2 mapm_lg2.c
gcc -c -Wall -O2 mapm_lg4.c
gcc -c -Wall -O2 mapm_exp.c
gcc -c -Wall -O2 mapm_lg3.c
gcc -c -Wall -O2 mapmasin.c
gcc -c -Wall -O2 mapmasn0.c
gcc -c -Wall -O2 mapm_sin.c
gcc -c -Wall -O2 mapm5sin.c
gcc -c -Wall -O2 mapmrsin.c
gcc -c -Wall -O2 mapm_cpi.c
gcc -c -Wall -O2 mapmsqrt.c
gcc -c -Wall -O2 mapmcbrt.c
gcc -c -Wall -O2 mapmgues.c
gcc -c -Wall -O2 mapmfact.c
gcc -c -Wall -O2 mapm_gcd.c
gcc -c -Wall -O2 mapmipwr.c
gcc -c -Wall -O2 mapmpwr2.c
gcc -c -Wall -O2 mapm_rnd.c
gcc -c -Wall -O2 mapm_flr.c
gcc -c -Wall -O2 mapm_fpf.c
gcc -c -Wall -O2 mapm_rcp.c
gcc -c -Wall -O2 mapmstck.c
gcc -c -Wall -O2 mapm_div.c
gcc -c -Wall -O2 mapm_mul.c
gcc -c -Wall -O3 mapmfmul.c
gcc -c -Wall -O2 mapm_fft.c
gcc -c -Wall -O2 mapm_add.c
gcc -c -Wall -O2 mapmistr.c
gcc -c -Wall -O2 mapm_set.c
gcc -c -Wall -O2 mapm_fam.c
gcc -c -Wall -O3 mapmutil.c
gcc -c -Wall -O2 mapmutl2.c
gcc -c -Wall -O2 mapmutl1.c
gcc -c -Wall -O2 mapmcnst.c
rm -f libmapm.a
ar rc libmapm.a mapmhasn.o mapmhsin.o mapm_pow.o mapm_log.o mapm_lg2.o mapm_lg4.o mapm_exp.o mapm_lg3.o mapmasin.o mapmasn0.o mapm_sin.o mapm5sin.o mapmrsin.o mapm_cpi.o mapmsqrt.o mapmcbrt.o mapmgues.o mapmfact.o mapm_gcd.o mapmipwr.o mapmpwr2.o mapm_rnd.o mapm_flr.o mapm_fpf.o mapm_rcp.o mapmstck.o mapm_div.o mapm_mul.o mapmfmul.o mapm_fft.o mapm_add.o mapmistr.o mapm_set.o mapm_fam.o mapmutil.o mapmutl2.o mapmutl1.o mapmcnst.o
gcc -c -Wall -O2 calc.c
gcc -s -static -o calc calc.o libmapm.a -lm
/usr/bin/ld: cannot find -lm
/usr/bin/ld: cannot find -lc
collect2: error: ld returned 1 exit status
make: *** [Makefile:63: calc] Error 1
It looks like everything goes fine until the end:
/usr/bin/ld: cannot find -lm
/usr/bin/ld: cannot find -lc
collect2: error: ld returned 1 exit status
Is there any way I fix this, and what does the command -lm and -lc do?

how can I fix gcc -c -g -Wall -Wno-unused-function -O2 -DHAVE_PTHREAD -DUSE_MALLOC_WRAPPERS to install bwa

I am trying to install bwa package in the terminal of mac. I downloaded bwa-0.7.17 from https://sourceforge.net/projects/bio-bwa/files/
I followed the steps to install it but when I tried to "make", it showed me this:
gcc -c -g -Wall -Wno-unused-function -O2 -DHAVE_PTHREAD -DUSE_MALLOC_WRAPPERS utils.c -o utils.o
gcc -c -g -Wall -Wno-unused-function -O2 -DHAVE_PTHREAD -DUSE_MALLOC_WRAPPERS kthread.c -o kthread.o
gcc -c -g -Wall -Wno-unused-function -O2 -DHAVE_PTHREAD -DUSE_MALLOC_WRAPPERS kstring.c -o kstring.o
gcc -c -g -Wall -Wno-unused-function -O2 -DHAVE_PTHREAD -DUSE_MALLOC_WRAPPERS ksw.c -o ksw.o
gcc -c -g -Wall -Wno-unused-function -O2 -DHAVE_PTHREAD -DUSE_MALLOC_WRAPPERS bwt.c -o bwt.o
gcc -c -g -Wall -Wno-unused-function -O2 -DHAVE_PTHREAD -DUSE_MALLOC_WRAPPERS bntseq.c -o bntseq.o
gcc -c -g -Wall -Wno-unused-function -O2 -DHAVE_PTHREAD -DUSE_MALLOC_WRAPPERS bwa.c -o bwa.o
gcc -c -g -Wall -Wno-unused-function -O2 -DHAVE_PTHREAD -DUSE_MALLOC_WRAPPERS bwamem.c -o bwamem.o
gcc -c -g -Wall -Wno-unused-function -O2 -DHAVE_PTHREAD -DUSE_MALLOC_WRAPPERS bwamem_pair.c -o bwamem_pair.o
gcc -c -g -Wall -Wno-unused-function -O2 -DHAVE_PTHREAD -DUSE_MALLOC_WRAPPERS bwamem_extra.c -o bwamem_extra.o
gcc -c -g -Wall -Wno-unused-function -O2 -DHAVE_PTHREAD -DUSE_MALLOC_WRAPPERS malloc_wrap.c -o malloc_wrap.o
gcc -c -g -Wall -Wno-unused-function -O2 -DHAVE_PTHREAD -DUSE_MALLOC_WRAPPERS QSufSort.c -o QSufSort.o
gcc -c -g -Wall -Wno-unused-function -O2 -DHAVE_PTHREAD -DUSE_MALLOC_WRAPPERS bwt_gen.c -o bwt_gen.o
gcc -c -g -Wall -Wno-unused-function -O2 -DHAVE_PTHREAD -DUSE_MALLOC_WRAPPERS rope.c -o rope.o
gcc -c -g -Wall -Wno-unused-function -O2 -DHAVE_PTHREAD -DUSE_MALLOC_WRAPPERS rle.c -o rle.o
gcc -c -g -Wall -Wno-unused-function -O2 -DHAVE_PTHREAD -DUSE_MALLOC_WRAPPERS is.c -o is.o
gcc -c -g -Wall -Wno-unused-function -O2 -DHAVE_PTHREAD -DUSE_MALLOC_WRAPPERS bwtindex.c -o bwtindex.o
ar -csru libbwa.a utils.o kthread.o kstring.o ksw.o bwt.o bntseq.o bwa.o bwamem.o bwamem_pair.o bwamem_extra.o malloc_wrap.o QSufSort.o bwt_gen.o rope.o rle.o is.o bwtindex.o
gcc -c -g -Wall -Wno-unused-function -O2 -DHAVE_PTHREAD -DUSE_MALLOC_WRAPPERS bwashm.c -o bwashm.o
gcc -c -g -Wall -Wno-unused-function -O2 -DHAVE_PTHREAD -DUSE_MALLOC_WRAPPERS bwase.c -o bwase.o
gcc -c -g -Wall -Wno-unused-function -O2 -DHAVE_PTHREAD -DUSE_MALLOC_WRAPPERS bwaseqio.c -o bwaseqio.o
gcc -c -g -Wall -Wno-unused-function -O2 -DHAVE_PTHREAD -DUSE_MALLOC_WRAPPERS bwtgap.c -o bwtgap.o
gcc -c -g -Wall -Wno-unused-function -O2 -DHAVE_PTHREAD -DUSE_MALLOC_WRAPPERS bwtaln.c -o bwtaln.o
gcc -c -g -Wall -Wno-unused-function -O2 -DHAVE_PTHREAD -DUSE_MALLOC_WRAPPERS bamlite.c -o bamlite.o
gcc -c -g -Wall -Wno-unused-function -O2 -DHAVE_PTHREAD -DUSE_MALLOC_WRAPPERS bwape.c -o bwape.o
gcc -c -g -Wall -Wno-unused-function -O2 -DHAVE_PTHREAD -DUSE_MALLOC_WRAPPERS kopen.c -o kopen.o
gcc -c -g -Wall -Wno-unused-function -O2 -DHAVE_PTHREAD -DUSE_MALLOC_WRAPPERS pemerge.c -o pemerge.o
gcc -c -g -Wall -Wno-unused-function -O2 -DHAVE_PTHREAD -DUSE_MALLOC_WRAPPERS maxk.c -o maxk.o
gcc -c -g -Wall -Wno-unused-function -O2 -DHAVE_PTHREAD -DUSE_MALLOC_WRAPPERS bwtsw2_core.c -o bwtsw2_core.o
gcc -c -g -Wall -Wno-unused-function -O2 -DHAVE_PTHREAD -DUSE_MALLOC_WRAPPERS bwtsw2_main.c -o bwtsw2_main.o
gcc -c -g -Wall -Wno-unused-function -O2 -DHAVE_PTHREAD -DUSE_MALLOC_WRAPPERS bwtsw2_aux.c -o bwtsw2_aux.o
gcc -c -g -Wall -Wno-unused-function -O2 -DHAVE_PTHREAD -DUSE_MALLOC_WRAPPERS bwt_lite.c -o bwt_lite.o
gcc -c -g -Wall -Wno-unused-function -O2 -DHAVE_PTHREAD -DUSE_MALLOC_WRAPPERS bwtsw2_chain.c -o bwtsw2_chain.o
gcc -c -g -Wall -Wno-unused-function -O2 -DHAVE_PTHREAD -DUSE_MALLOC_WRAPPERS fastmap.c -o fastmap.o
gcc -c -g -Wall -Wno-unused-function -O2 -DHAVE_PTHREAD -DUSE_MALLOC_WRAPPERS bwtsw2_pair.c -o bwtsw2_pair.o
gcc -c -g -Wall -Wno-unused-function -O2 -DHAVE_PTHREAD -DUSE_MALLOC_WRAPPERS main.c -o main.o
gcc -g -Wall -Wno-unused-function -O2 -DHAVE_PTHREAD -DUSE_MALLOC_WRAPPERS bwashm.o bwase.o bwaseqio.o bwtgap.o bwtaln.o bamlite.o bwape.o kopen.o pemerge.o maxk.o bwtsw2_core.o bwtsw2_main.o bwtsw2_aux.o bwt_lite.o bwtsw2_chain.o fastmap.o bwtsw2_pair.o main.o -o bwa -L. -lbwa -lm -lz -lpthread
Then I tried again "make" and it showed:
make: Nothing to be done for `all'
Do you know what is the problem and how can I fix it? I would really appreciate your help.
All the best,
Mayra

Order of arguments to g++ shuffled when parsing makefile

Following makefile:
#Regular c++ rules
CXX=g++
CXXFLAGS=-Wall -march=native -ffast-math -O3
CXX_OBJECTS=AbsNode.o rle16.o rle8.o
# Link command:
test : $(CXX_OBJECTS)
$(CXX) $(CXX_OBJECTS) -o test
# Compilation commands:
$.o : %.cpp
$(CXX) -c $< $(CXXFLAGS) -o $#
Outputs
g++ -Wall -march=native -ffast-math -O3 -c -o AbsNode.o AbsNode.cpp
g++ -Wall -march=native -ffast-math -O3 -c -o rle16.o rle16.cpp
g++ -Wall -march=native -ffast-math -O3 -c -o rle8.o rle8.cpp
while I expect
g++ -c AbsNode.cpp -Wall -march=native -ffast-math -O3 -o AbsNode.o
g++ -c rle16.cpp -Wall -march=native -ffast-math -O3 -o rle16.o
g++ -c rle8.cpp -Wall -march=native -ffast-math -O3 -o rle8.o
Why is the order of arguments to g++ switched compared to the rule stated in makefile???
$.o : %.cpp
You typed $ instead of %, which turned is into a non-template rule. However make has a default rule for C++ file, which was taken instead of yours. The order of arguments match this internal rule.

pyvlfeat error during installation: /usr/bin/ld: cannot find -lboost_python-mt-py26

I've haven't been successful in finding a solution to the following error which I get during the pyvlfeat 0.1.1a3 installation: /usr/bin/ld: cannot find -lboost_python-mt-py26
I've installed boost python. Here's the console output:
lenovo#lenovo-ThinkPad-T61:~/Downloads/pyvlfeat-0.1.1a3$ ipython
Python 2.7.2+ (default, Oct 4 2011, 20:03:08)
Type "copyright", "credits" or "license" for more information.
IPython 0.12 -- An enhanced Interactive Python.
? -> Introduction and overview of IPython's features.
%quickref -> Quick reference.
help -> Python's own help system.
object? -> Details about 'object', use 'object??' for extra details.
In [1]: run setup.py clean
running clean
removing 'build/temp.linux-i686-2.7' (and everything under it)
In [2]: run setup.py build
running build
running build_py
running build_ext
building '_vlfeat' extension
creating build/temp.linux-i686-2.7
creating build/temp.linux-i686-2.7/vlfeat
creating build/temp.linux-i686-2.7/vlfeat/vl
creating build/temp.linux-i686-2.7/vlfeat/mser
creating build/temp.linux-i686-2.7/vlfeat/sift
creating build/temp.linux-i686-2.7/vlfeat/imop
creating build/temp.linux-i686-2.7/vlfeat/misc
creating build/temp.linux-i686-2.7/vlfeat/kmeans
creating build/temp.linux-i686-2.7/vlfeat/quickshift
gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -Ivlfeat/ -I/usr/include/python2.7 -c vlfeat/vl/aib.c -o build/temp.linux-i686-2.7/vlfeat/vl/aib.o -msse2 -O2 -fPIC -w
gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -Ivlfeat/ -I/usr/include/python2.7 -c vlfeat/vl/generic.c -o build/temp.linux-i686-2.7/vlfeat/vl/generic.o -msse2 -O2 -fPIC -w
gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -Ivlfeat/ -I/usr/include/python2.7 -c vlfeat/vl/hikmeans.c -o build/temp.linux-i686-2.7/vlfeat/vl/hikmeans.o -msse2 -O2 -fPIC -w
gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -Ivlfeat/ -I/usr/include/python2.7 -c vlfeat/vl/ikmeans.c -o build/temp.linux-i686-2.7/vlfeat/vl/ikmeans.o -msse2 -O2 -fPIC -w
gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -Ivlfeat/ -I/usr/include/python2.7 -c vlfeat/vl/imopv.c -o build/temp.linux-i686-2.7/vlfeat/vl/imopv.o -msse2 -O2 -fPIC -w
gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -Ivlfeat/ -I/usr/include/python2.7 -c vlfeat/vl/mathop.c -o build/temp.linux-i686-2.7/vlfeat/vl/mathop.o -msse2 -O2 -fPIC -w
gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -Ivlfeat/ -I/usr/include/python2.7 -c vlfeat/vl/mathop_sse2.c -o build/temp.linux-i686-2.7/vlfeat/vl/mathop_sse2.o -msse2 -O2 -fPIC -w
gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -Ivlfeat/ -I/usr/include/python2.7 -c vlfeat/vl/pgm.c -o build/temp.linux-i686-2.7/vlfeat/vl/pgm.o -msse2 -O2 -fPIC -w
gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -Ivlfeat/ -I/usr/include/python2.7 -c vlfeat/vl/rodrigues.c -o build/temp.linux-i686-2.7/vlfeat/vl/rodrigues.o -msse2 -O2 -fPIC -w
gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -Ivlfeat/ -I/usr/include/python2.7 -c vlfeat/vl/stringop.c -o build/temp.linux-i686-2.7/vlfeat/vl/stringop.o -msse2 -O2 -fPIC -w
gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -Ivlfeat/ -I/usr/include/python2.7 -c vlfeat/vl/getopt_long.c -o build/temp.linux-i686-2.7/vlfeat/vl/getopt_long.o -msse2 -O2 -fPIC -w
gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -Ivlfeat/ -I/usr/include/python2.7 -c vlfeat/vl/host.c -o build/temp.linux-i686-2.7/vlfeat/vl/host.o -msse2 -O2 -fPIC -w
gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -Ivlfeat/ -I/usr/include/python2.7 -c vlfeat/vl/imopv_sse2.c -o build/temp.linux-i686-2.7/vlfeat/vl/imopv_sse2.o -msse2 -O2 -fPIC -w
gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -Ivlfeat/ -I/usr/include/python2.7 -c vlfeat/vl/mser.c -o build/temp.linux-i686-2.7/vlfeat/vl/mser.o -msse2 -O2 -fPIC -w
gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -Ivlfeat/ -I/usr/include/python2.7 -c vlfeat/vl/random.c -o build/temp.linux-i686-2.7/vlfeat/vl/random.o -msse2 -O2 -fPIC -w
gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -Ivlfeat/ -I/usr/include/python2.7 -c vlfeat/vl/sift.c -o build/temp.linux-i686-2.7/vlfeat/vl/sift.o -msse2 -O2 -fPIC -w
gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -Ivlfeat/ -I/usr/include/python2.7 -c vlfeat/vl/dsift.c -o build/temp.linux-i686-2.7/vlfeat/vl/dsift.o -msse2 -O2 -fPIC -w
gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -Ivlfeat/ -I/usr/include/python2.7 -c vlfeat/vl/quickshift.c -o build/temp.linux-i686-2.7/vlfeat/vl/quickshift.o -msse2 -O2 -fPIC -w
gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -Ivlfeat/ -I/usr/include/python2.7 -c vlfeat/mser/vl_erfill.cpp -o build/temp.linux-i686-2.7/vlfeat/mser/vl_erfill.o -msse2 -O2 -fPIC -w
cc1plus: warning: command line option ‘-Wstrict-prototypes’ is valid for Ada/C/ObjC but not for C++ [enabled by default]
gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -Ivlfeat/ -I/usr/include/python2.7 -c vlfeat/mser/vl_mser.cpp -o build/temp.linux-i686-2.7/vlfeat/mser/vl_mser.o -msse2 -O2 -fPIC -w
cc1plus: warning: command line option ‘-Wstrict-prototypes’ is valid for Ada/C/ObjC but not for C++ [enabled by default]
gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -Ivlfeat/ -I/usr/include/python2.7 -c vlfeat/sift/vl_sift.cpp -o build/temp.linux-i686-2.7/vlfeat/sift/vl_sift.o -msse2 -O2 -fPIC -w
cc1plus: warning: command line option ‘-Wstrict-prototypes’ is valid for Ada/C/ObjC but not for C++ [enabled by default]
gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -Ivlfeat/ -I/usr/include/python2.7 -c vlfeat/sift/vl_dsift.cpp -o build/temp.linux-i686-2.7/vlfeat/sift/vl_dsift.o -msse2 -O2 -fPIC -w
cc1plus: warning: command line option ‘-Wstrict-prototypes’ is valid for Ada/C/ObjC but not for C++ [enabled by default]
gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -Ivlfeat/ -I/usr/include/python2.7 -c vlfeat/sift/vl_siftdescriptor.cpp -o build/temp.linux-i686-2.7/vlfeat/sift/vl_siftdescriptor.o -msse2 -O2 -fPIC -w
cc1plus: warning: command line option ‘-Wstrict-prototypes’ is valid for Ada/C/ObjC but not for C++ [enabled by default]
gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -Ivlfeat/ -I/usr/include/python2.7 -c vlfeat/imop/vl_imsmooth.cpp -o build/temp.linux-i686-2.7/vlfeat/imop/vl_imsmooth.o -msse2 -O2 -fPIC -w
cc1plus: warning: command line option ‘-Wstrict-prototypes’ is valid for Ada/C/ObjC but not for C++ [enabled by default]
gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -Ivlfeat/ -I/usr/include/python2.7 -c vlfeat/misc/vl_binsum.cpp -o build/temp.linux-i686-2.7/vlfeat/misc/vl_binsum.o -msse2 -O2 -fPIC -w
cc1plus: warning: command line option ‘-Wstrict-prototypes’ is valid for Ada/C/ObjC but not for C++ [enabled by default]
gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -Ivlfeat/ -I/usr/include/python2.7 -c vlfeat/kmeans/vl_hikmeans.cpp -o build/temp.linux-i686-2.7/vlfeat/kmeans/vl_hikmeans.o -msse2 -O2 -fPIC -w
cc1plus: warning: command line option ‘-Wstrict-prototypes’ is valid for Ada/C/ObjC but not for C++ [enabled by default]
gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -Ivlfeat/ -I/usr/include/python2.7 -c vlfeat/kmeans/vl_ikmeans.cpp -o build/temp.linux-i686-2.7/vlfeat/kmeans/vl_ikmeans.o -msse2 -O2 -fPIC -w
cc1plus: warning: command line option ‘-Wstrict-prototypes’ is valid for Ada/C/ObjC but not for C++ [enabled by default]
gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -Ivlfeat/ -I/usr/include/python2.7 -c vlfeat/kmeans/vl_hikmeanspush.cpp -o build/temp.linux-i686-2.7/vlfeat/kmeans/vl_hikmeanspush.o -msse2 -O2 -fPIC -w
cc1plus: warning: command line option ‘-Wstrict-prototypes’ is valid for Ada/C/ObjC but not for C++ [enabled by default]
gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -Ivlfeat/ -I/usr/include/python2.7 -c vlfeat/kmeans/vl_ikmeanspush.cpp -o build/temp.linux-i686-2.7/vlfeat/kmeans/vl_ikmeanspush.o -msse2 -O2 -fPIC -w
cc1plus: warning: command line option ‘-Wstrict-prototypes’ is valid for Ada/C/ObjC but not for C++ [enabled by default]
gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -Ivlfeat/ -I/usr/include/python2.7 -c vlfeat/quickshift/vl_quickshift.cpp -o build/temp.linux-i686-2.7/vlfeat/quickshift/vl_quickshift.o -msse2 -O2 -fPIC -w
cc1plus: warning: command line option ‘-Wstrict-prototypes’ is valid for Ada/C/ObjC but not for C++ [enabled by default]
gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -Ivlfeat/ -I/usr/include/python2.7 -c vlfeat/py_vlfeat.cpp -o build/temp.linux-i686-2.7/vlfeat/py_vlfeat.o -msse2 -O2 -fPIC -w
cc1plus: warning: command line option ‘-Wstrict-prototypes’ is valid for Ada/C/ObjC but not for C++ [enabled by default]
g++ -pthread -shared -Wl,-O1 -Wl,-Bsymbolic-functions -Wl,-Bsymbolic-functions build/temp.linux-i686-2.7/vlfeat/vl/aib.o build/temp.linux-i686-2.7/vlfeat/vl/generic.o build/temp.linux-i686-2.7/vlfeat/vl/hikmeans.o build/temp.linux-i686-2.7/vlfeat/vl/ikmeans.o build/temp.linux-i686-2.7/vlfeat/vl/imopv.o build/temp.linux-i686-2.7/vlfeat/vl/mathop.o build/temp.linux-i686-2.7/vlfeat/vl/mathop_sse2.o build/temp.linux-i686-2.7/vlfeat/vl/pgm.o build/temp.linux-i686-2.7/vlfeat/vl/rodrigues.o build/temp.linux-i686-2.7/vlfeat/vl/stringop.o build/temp.linux-i686-2.7/vlfeat/vl/getopt_long.o build/temp.linux-i686-2.7/vlfeat/vl/host.o build/temp.linux-i686-2.7/vlfeat/vl/imopv_sse2.o build/temp.linux-i686-2.7/vlfeat/vl/mser.o build/temp.linux-i686-2.7/vlfeat/vl/random.o build/temp.linux-i686-2.7/vlfeat/vl/sift.o build/temp.linux-i686-2.7/vlfeat/vl/dsift.o build/temp.linux-i686-2.7/vlfeat/vl/quickshift.o build/temp.linux-i686-2.7/vlfeat/mser/vl_erfill.o build/temp.linux-i686-2.7/vlfeat/mser/vl_mser.o build/temp.linux-i686-2.7/vlfeat/sift/vl_sift.o build/temp.linux-i686-2.7/vlfeat/sift/vl_dsift.o build/temp.linux-i686-2.7/vlfeat/sift/vl_siftdescriptor.o build/temp.linux-i686-2.7/vlfeat/imop/vl_imsmooth.o build/temp.linux-i686-2.7/vlfeat/misc/vl_binsum.o build/temp.linux-i686-2.7/vlfeat/kmeans/vl_hikmeans.o build/temp.linux-i686-2.7/vlfeat/kmeans/vl_ikmeans.o build/temp.linux-i686-2.7/vlfeat/kmeans/vl_hikmeanspush.o build/temp.linux-i686-2.7/vlfeat/kmeans/vl_ikmeanspush.o build/temp.linux-i686-2.7/vlfeat/quickshift/vl_quickshift.o build/temp.linux-i686-2.7/vlfeat/py_vlfeat.o -o build/lib.linux-i686-2.7/_vlfeat.so -msse -shared -lboost_python-mt-py26
/usr/bin/ld: cannot find -lboost_python-mt-py26
collect2: ld returned 1 exit status
An exception has occurred, use %tb to see the full traceback.
SystemExit: error: command 'g++' failed with exit status 1
In [3]:
A quick fix to this is to simply edit the setup.py for pyvlfeat and modify the LinkArgs line to refer to your installation of boost-python. For my system, (and likely many others) this amounts to just changing -lboost_python-mt-py26 to -lboost_python-mt-py27 to refer to the proper Python revision.

Why aren't debugging symbols being added to my output file?

I am trying to compile a project to run on an ARM board that I have. To use the debugger, I have to put debugging symbols in the resulting .elf file.
I configured everything and ran my makefile, which produced the following results:
arm-elf-gcc -x assembler-with-cpp -c -mcpu=arm7tdmi-s -g -gdwarf-2 -Wa,-amhls=src/crt.lst src/crt.S -o src/crt.o
arm-elf-gcc -c -mcpu=arm7tdmi-s -O0 -g -gdwarf-2 -mthumb-interwork -fomit-frame-pointer -Wall -Wstrict-prototypes -fverbose-asm -Wa,-ahlms=src/main.lst -MD -MP -MF .dep/main.o.d -I . -I./inc src/main.c -o src/main.o
arm-elf-gcc -c -mcpu=arm7tdmi-s -O0 -g -gdwarf-2 -mthumb-interwork -fomit-frame-pointer -Wall -Wstrict-prototypes -fverbose-asm -Wa,-ahlms=library/md5.lst -MD -MP -MF .dep/md5.o.d -I . -I./inc library/md5.c -o library/md5.o
arm-elf-gcc -c -mcpu=arm7tdmi-s -O0 -g -gdwarf-2 -mthumb-interwork -fomit-frame-pointer -Wall -Wstrict-prototypes -fverbose-asm -Wa,-ahlms=library/bignum.lst -MD -MP -MF .dep/bignum.o.d -I . -I./inc library/bignum.c -o library/bignum.o
arm-elf-gcc ./src/crt.o ./src/main.o ./library/md5.o ./library/bignum.o -mcpu=arm7tdmi-s -g -nostartfiles -T./prj/LPC2138_flash.ld -Wl,-Map=testFLASH.map,--cref,--no-warn-mismatch -nostdlib -L. -Wl,-static -ffunction-sections -Wl,--gc-sections -Wl,-s -fdata-sections -lc -lg -lnosys -o testFLASH.elf
I have put in the -g flags, but when I try to find debugging symbols, I get only :
C:\Users\stkerr\Code\EclipseWorkspace\LibraryWork>objdump -g testFLASH.elf
testFLASH.elf: file format elf32-little
This is further confirmed when I try to open the .elf file in my debugger, I get an error about the file not having debugging symbols.
Can anyone point to an error in my arm-elf-gcc calls or a flag that I am missing?
After poking around a little more in the documentation, the -Wl,-s is the problem.
It strips all symbols from the resulting executable, including the debugging information.

Resources