32

I'm following the Matlab coder kalman tutorial in Matlab help. When using codegen, there's an error as below:

/usr/bin/ld: cannot find -lstdc++

collect2: ld returned 1 exit status

But there is libstdc++.so.6 in /lib/ and /usr/lib

Community
  • 1
  • 1
bitcold
  • 653
  • 2
  • 8
  • 10

5 Answers5

62

For Fedora 16 use:

sudo yum install libstdc++-static
JonnyRo
  • 1,844
  • 1
  • 14
  • 20
13

You can soft link the library to the name that is being sought

ln -s /usr/lib/libstdc++.so.6 /usr/lib/libstdc++.so

Bugzy
  • 131
  • 1
  • 3
6

i did sudo apt-get install g++-4.7 it work for me for matlab .

negi
  • 408
  • 7
  • 13
4

If you're compiling a 32-bit application on a 64-bit CentOS 7:

sudo yum install libstdc++-devel.i686
alkalinity
  • 1,750
  • 2
  • 21
  • 32
  • 3
    Following this website (http://tech.yipp.ca/compile-error/install-libstdc-for-32-bit-on-64-bit-centos/), I found that the command: `sudo yum install libstdc++-static libstdc++-static.i686` is more appropriate. Tried in my machine and worked. – rph Apr 12 '17 at 06:15
1

For CentOS, be sure you have installed gcc-c++ package (it includes libstdc++-devel dependency):

sudo yum install gcc-c++
caligari
  • 2,110
  • 20
  • 25