0

I am using code::blocks and boost. I can compile using boost::regex.

When I use boost::shared_ptr and compile my project. I am getting this compilation errors:

...\Local\Temp\ccviNbsT.s|30|Error: operand size mismatch for xadd'| ...\Local\Temp\ccviNbsT.s|63|Error: no such instruction:incl DWORD PTR [eax]'|

Note: I noticed that shared_ptr doesn't have static lib.

include <boost/smart_ptr/shared_ptr.hpp>

class AClass
{

  void VAddView(boost::shared_ptr<IClass> pView)
  {

  }
};

I am confused, Could anybody tell whats going on?

rink.attendant.6
  • 44,500
  • 61
  • 101
  • 156
  • relevant details: toolchains installed, compiler used, flags, OS & architecture (32/64)? Boost version – sehe Feb 11 '14 at 10:34

2 Answers2

0

It looks like the compiler is emitting instructions that the assembler doesn't recognize.

This shouldn't normally happen if your toolchain is well configured.

It could happen if your toolchain is somehow confused about the architecture (e.g. it emits assembly for x64 but the assembler assumes 32-bit architecture).

Check your compilation flags, and check that you're actually invoking the tools you expect to be invoking (especially if you have multiple toolchains installed, such as when cross compiling)

sehe
  • 374,641
  • 47
  • 450
  • 633
0

Thank you for the fast response, I found the cause of this problem. I was using Code::Blocks/Mingw with this compiler option: -masm=intel, I deleted this and my project start to build properly.