Xamarin.iOS - Symbol(s) not found for architecture i386 - xamarin.ios

Since I installed the new version of monotouch (Xamarin.iOS 6.4 [Mono 3.0]), I'm getting the following error when compiling for the simulator:
Undefined symbols for architecture i386: "___gxx_personality_v0", referenced from: Dwarf Exception Unwind Info (__eh_frame) in libziparchive.a(ZipArchive.o)
ld: symbol(s) not found for architecture i386
collect2: ld returned 1 exit status error MT5202: Native linking failed. Please review the build log.
It works fine compiling for device. Any idea?

This is a wild shot, but try to pass --cxx to mtouch in the additional mtouch arguments in the project's iOS Build options.

Related

golang with cgo throws error collect2: error: ld returned 1 exit status

I am compiling a golang package, which includes the integration of a shared c library using cgo.
Everything builds successfully inside docker images golang:1.15.15, golang:1.16.6, but since golang:1.16.7 (also golang:1.17) it fails with error:
/usr/bin/ld: src/foobar/lib/libXYZ.so: undefined reference to `feenableexcept'
/usr/bin/ld: src/foobar/lib/libXYZ.so: undefined reference to `floor'
...
/usr/bin/ld: src/foobar/lib/libXYZ.so: undefined reference to `memoFree'
/usr/bin/ld: src/foobar/lib/libXYZ.so: undefined reference to `memoMalloc'
collect2: error: ld returned 1 exit status
I checked the golang release notes, and could not find any relevant changes for cgo.
I checked versions of gcc and ld, those are all different. I even setup a ubuntu distro with go1.13.8, gcc (Ubuntu 8.4.0-3ubuntu2) 8.4.0 and GNU ld (GNU Binutils for Ubuntu) 2.34, where I run into this issue, so I guess, that go goes not cause it.
Do you have any clue or suggestion, how I can find the root cause of this issue? Is it right to check gcc and ld, or which other tools need investigation?
Thanks to Zyl, I was able to narrow down the problem.
I checked several distributions (bullseye, buster, stretch) and with bullseye, the build failed. In my case, neither the version of ld coming from binutils nor gcc caused the problem.
It seems, that the default settings for handling DT_NEEDED tags for the linker have changed. I resolved my problem taking the solution from https://stackoverflow.com/a/62117174/2290153 and adding export CGO_LDFLAGS=-Wl,--no-as-needed to the environment. According to https://manpages.debian.org/bullseye/binutils-common/gold.1.en.html this is the default for the ld.gold linker, but not for ld.
What helped me a lot, was the -x flag of the go build command to have a look at the gcc command being executed for cgo.

Problems with PySide installation

I have python2.7.9 on my new Xubuntu installation, albeit it's 14.04.
PySide installation stuck with Shiboken
Linking CXX shared library libshiboken-python2.7.so
/usr/bin/ld: /usr/local/lib/libpython2.7.a(abstract.o): relocation R_X86_64_32S against `_Py_NotImplementedStruct' can not be used when making a shared object; recompile with -fPIC
/usr/local/lib/libpython2.7.a: error adding symbols: Bad value
collect2: error: ld returned 1 exit status
make[2]: *** [libshiboken/libshiboken-python2.7.so.1.2.2] Error 1
make[1]: *** [libshiboken/CMakeFiles/libshiboken.dir/all] Error 2
make: *** [all] Error 2
error: Error compiling shiboken
After some "googling" I concluded that the problem could be solved with add --enable-shared at ./configure options.
Following docs tried to installed Shiboken in several ways, but after failed, tried to find configure in source files which I couldn't.
Please help. Thank you.
The output is showing that it's trying to link against a static python library, rather than a shared one - i.e. libpython2.7.a, rather than libpython2.7.so.
Thus, it's python that needs to be re-compiled with --enable-shared, not shiboken.

Libhand library compilation error cannot find -lNOTFOUND

I'm trying to build a hand model library from libhand.org on Ubuntu 14.04. The library uses ogre and opencv libraries. I followed the instructions provided by the author that allowed me to successfully install ogre and opencv. There is no problem with cmake .. . but during execute command
make -j4
I get the following error:
[ 87%] Building CXX object source/CMakeFiles/hand_renderer.dir/hand_pose.cc.o
[ 91%] Building CXX object source/CMakeFiles/hand_renderer.dir/scene_spec.cc.o
Linking CXX static library libhand_renderer.a
[ 91%] Built target hand_renderer
Scanning dependencies of target pose_designer
[ 95%] Building CXX object source/CMakeFiles/pose_designer.dir/pose_designer_main.cc.o
[100%] Building CXX object source/CMakeFiles/pose_designer.dir/pose_designer.cc.o
Linking CXX executable pose_designer
/usr/bin/ld: cannot find -lNOTFOUND
/usr/bin/ld: cannot find -lNOTFOUND
libhand_utils.a(file_dialog.cc.o): In function
`libhand::FileDialog::TkExec(std::string const&)':
file_dialog.cc:(.text+0xead): warning: the use of `mktemp' is dangerous, better use `mkstemp' or `mkdtemp'
collect2: error: ld returned 1 exit status
make[2]: *** [source/pose_designer] Error 1
make[1]: *** [source/CMakeFiles/pose_designer.dir/all] Error 2
make: *** [all] Error 2
Does anyone know why this error occurs and what can be done?
I assume this error occurs because some required library was not found during the run of cmake but that incident was not correctly detected (ie. cmake did not abort with an error). More details on that should be available in a file named CMakeError.log or CMakeOutput.log in the CMakeFiles directory.
The solution to this problem is either installing the missing library (which name should be available from the aforementioned files) or fix the build process to find the library, if it is already installed (for autotools, this would be using the CFLAGS and LDFLAGS environment variables to point to the correct include paths, compiler options, library paths and libraries; that should also work with CMake).
As an alternative explanation, cmake found the library but somehow failed to write the correct Makefiles. Then the solution would be manually replacing -lNOTFOUND by -l<library name> in the Makefiles.

undefined reference to symbol 'vtkImageAlgorithm::GetOutput()'

I want to build a project using make in Ubuntu. This project includes VTK, Xerces and Cmake libraries. While builing I get the following error:
Linking CXX static library libMA_LaTIM.a
[ 96%] Built target MA_LaTIM
Scanning dependencies of target MA_LaTIM_entrainement
[100%] Building CXX object applications/CMakeFiles/MA_LaTIM_entrainement.dir/entrainement.cxx.o
Linking CXX executable MA_LaTIM_entrainement
/usr/bin/ld: ../algorithmes/libMA_LaTIM.a(LecteurImage.cxx.o): undefined reference to symbol 'vtkImageAlgorithm::GetOutput()'
/usr/bin/ld: note: 'vtkImageAlgorithm::GetOutput()' is defined in DSO /usr/lib/libvtkFiltering.so.5.8 so try adding it to the linker command line
/usr/lib/libvtkFiltering.so.5.8: could not read symbols: Invalid operation
collect2: ld returned 1 exit status
How can I fix this problem? Here is my CMakeLists.txt, and here is my Makefile.
If you happen to not use cmake to build your application, here is the solution to resolve the linker error undefined reference to symbol with VTK!
The libraries have to be chosen manually. The problem is, that e.g. with my version VTK 6.1 there are 377 shared libs to choose from. Well, some are as before with version 5 but split in Core and special libs.
Others can be found if you check the header of the module the compiler complains about: there is a macro between "class" and the class name: "class VTK_......_EXPORT" , which gives you a hint how the lib is named.
E.g. class VTKRENDERINGCORE_EXPORT vtkRenderer needs library libvtkRenderingCore. Here an example (Linux) which worked for my application:
-L/usr/lib64/vtk -lvtkCommonCore -lvtkFiltersCore -lvtkRenderingCore -lvtkImagingCore -lvtkCommonExecutionModel -l vtkCommonDataModel \
-lvtkFiltersSources -lvtkFiltersGeometry -lvtkFiltersGeneral -lvtkIOCore -lvtkIOImage -lvtkRenderingOpenGL

Unable to locate library liboleaut32 in Linux Mint 15

I'm using Mint 15, I'm a total noob when it comes to compiling softwares, but I'm trying to compile the "infinite-qt" GUI from the Git repo.
I managed to get "infinitecoind"(daemon) compiled, using the 'Makefile.unix' file.
What I'm trying to do now is to get the "infinitecoin-qt GUI" working.
I think it kinda compiles alright to the point where I get this error message:
build/qrc_bitcoin.o -L/usr/lib/i386-linux-gnu -lrt -lssl -lcrypto -ldb_cxx -loleaut32 -lboost_system -lboost_filesystem -lboost_program_options -lboost_thread -lQtGui - lQtCore -lpthread
/usr/bin/ld: cannot find -loleaut32
collect2: error: ld returned 1 exit status
make: ** [infinitecoin-qt] Error 1
Seems like it's some kind of lib missing somehow related to Windows, but I can't find it.
Thanks in advance for your help!
oleaut32 is a library used by Microsoft for OLE technologies - you won't be able to link against it on Linux...
see: http://msdn.microsoft.com/en-us/library/aa268922(v=vs.60).aspx

Resources