Boost-Extension-Reflection How to fix segmentation error when compiling an official sample not using bjam?

So, I will try to transfer some Boost.Extension samples for standard IDEs - to make TAM free from BJAM and be able to work with them using standard platform methods .

Now I have trolleybuses with a description here . Here is my code port (the library we are trying to load in the main code file , the main application , the general idea of ​​the port is described here , and some current linux versions here (most samples really work as needed!) ). When I compile this sample under linux, it compiles, it finds the library, but does not work at runtime with a segmentation error . When I compile it on Windows, the same thing happens.

I tried my best not to modify the source code of the textbook as much as possible.

So, what's wrong with the code, why, if it crashes, and it just matters - how to fix it?

So, how to create this material with the premiere:

  • You get svn from here (only this folder is required)
  • You will get a start for your platform or create it from the source and place it in the folder that you downloaded from svn
  • You must have the official Boost compiled and installed (please read the ReadMe.txt file that we provide in the directory), so you need to:
    • Boost C ++ Library (we tested with version 1.4.16)
    • Boost-Extension (we use the latest version , we added it as part of boost 'boost / extension / ** ' We had to make some chandes (actually only one) to increase the extension, so we provide it inside the Boost.Extension.Tutorial/libs/boost/extension/ folder Boost.Extension.Tutorial/libs/boost/extension/ , so when you downloaded svn you got it, this is just the header )
    • Boost-Reflection (we use because of this tutorial , we use the latest revision , we reverse it as part of boost 'boost / reflection / ** ' *, and for simplicity we recommend just putting it in Boost.Extension.Tutorial/libs/boost/reflection * )
  • Now that official Boost is used on your system, only the Boost-reflection and Boost extensions headers are in the Boost.Extension.Tutorial/libs/boost folder, the Boost.Extension.Tutorial/libs/boost executable is inside the Boost.Extension.Tutorial/ folder, which we can just call Boost.Extension.Tutorial/ premake4-build-windows.bat on Windows to get sln for Visual Studio or Boost.Extension.Tutorial/ premake-build.sh to get makefiles.
  • You can find the generated solution / make files inside the generated projects folder.
  • Good luck =)

Update:

Project files for Windows and Linux are now in svn , so you can get the project created with the premiere - just use Boost, our svn and reflection of the headers only lib.

Update 2: So in general my computer shows problems in both Windows and Linux. Details on my Linux ( which is an OpenSUSE 11.3 VMWare file that includes Mono 2.10.2 ) GCC ( gcc -v ):

 rupert@linux:~> gcc -v Using built-in specs. COLLECT_GCC=gcc COLLECT_LTO_WRAPPER=/usr/lib/gcc/i586-suse-linux/4.5/lto-wrapper Target: i586-suse-linux Configured with: ../configure --prefix=/usr --infodir=/usr/share/info --mandir=/usr/share/man --libdir=/usr/lib --libexecdir=/usr/lib --enable-languages=c,c++,objc,fortran,obj-c++,java,ada --enable-checking=release --with-gxx-include-dir=/usr/include/c++/4.5 --enable-ssp --disable-libssp --disable-plugin --with-bugurl=http://bugs.opensuse.org/ --with-pkgversion='SUSE Linux' --disable-libgcj --disable-libmudflap --with-slibdir=/lib --with-system-zlib --enable-__cxa_atexit --enable-libstdcxx-allocator=new --disable-libstdcxx-pch --enable-version-specific-runtime-libs --program-suffix=-4.5 --enable-linux-futex --without-system-libunwind --enable-gold --with-plugin-ld=/usr/bin/gold --with-arch-32=i586 --with-tune=generic --build=i586-suse-linux Thread model: posix gcc version 4.5.0 20100604 [gcc-4_5-branch revision 160292] (SUSE Linux) 

My windows is standard Windows 7 with Team Team Team 2008 Team Team on the platform.

My boost 1.46.1 download here , compiled and installed manually.

0
c ++ segmentation-fault boost
May 01 '11 at 10:08
source share
1 answer

There should be a difference in the configuration, as this is the result of my testing:

outputs:

First reflection: this is an SUV. Second reflection: compact.

Is buld release possible?

  • cd ../ ..
  • make -Bs config = release
  • cd bin / release /
  • ./Interaction

First reflection: this is an SUV. Second reflection: compact.




Update

Since then, I have tested this on 32-bit Linux using

  • ubuntu gcc 4.4.5, boost 1.42.0
  • ubuntu gcc 4.5.1, boost 1.42.0
  • debian gcc 4.5.2-8, boost 1.46.1.1
  • debian gcc 4.6.1 20110428 (preview), upgrade 1.46.1.1

Image Mono-2.10.2.vmdk SuSE with

  • gcc 4.5.0 20100604, boost 1.42.0.7.1.1 (from yast2 repo)
  • gcc 4.5.0 20100604, boost 1.46.1 (from source)

Conclusions, tips

All verified versions gave me the correct and identical result. Surely something must be happening PEBCAK? Perhaps repeat my previous steps on a new virtual machine to verify this ?

The only thing I really see is going wrong:

  • Incorrect library paths (dynamically loading (old?) incompatible assemblies).
  • Incorrect headers are used (resulting in incompatible assemblies).
+1
May 01 '11 at 15:36
source share



All Articles