Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ld.exe: cannot find -lstrmbase

Tags:

c++

c

gcc

I am getting a the following error in code blocks using gnu gcc compiler, when I try to compile the code I get these errors:

c:/mingw/bin/../lib/gcc/mingw32/4.6.2/../../../../mingw32/bin/ld.exe: cannot find-                                          lstrmbase
c:/mingw/bin/../lib/gcc/mingw32/4.6.2/../../../../mingw32/bin/ld.exe: cannot find -lz
collect2: ld returned 1 exit status
Process terminated with status 1 (0 minutes, 21 seconds)
2 errors, 0 warnings (0 minutes, 21 seconds)
like image 244
user3190183 Avatar asked Oct 22 '25 09:10

user3190183


1 Answers

  1. First, make sure you have strmbase.lib (or libstrmbase.lib) and z.lib (libz.lib) in your mingw lib directory (it should be "c:/mingw/gcc/mingw32/4.6.2/" in your case).

  2. Second, if they do exist, try to add "c:/mingw/gcc/mingw32/4.6.2/" to your library search path.

    There may be GUI option like "LIBRARY PATH" for that, although I don't know about code blocks.

    Alternatively, you can pass an option to gcc "-L c:/mingw/gcc/mingw32/4.6.2/" (It must be before "-l..." flags)

EDIT:

  1. z.lib is zlib. You can build it using your gcc or download prebuilt binary from MinGW web-site (should be inside MinGW -> Extension).

  2. strmbase.lib is from DirectShow Samples. You can get its source code by installing Windows SDK. There might be someone distributing prebuit binary for MinGW.

like image 100
lukes Avatar answered Oct 24 '25 00:10

lukes



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!