Thread: ld.exe: cannot find -l-lstdc++

  1. #1
    Registered User Tonto's Avatar
    Join Date
    Jun 2005
    New York

    ld.exe: cannot find -l-lstdc++

    I am having a little problem with mingw and codeblocks. It is trying to link to the standard library in a silly way

    Reading specs from C:/Bin/Mingw/bin/../lib/gcc/mingw32/3.4.2/specs
    Configured with: ../gcc/configure --with-gcc --with-gnu-ld --with-gnu-as --host=mingw32 --target=mingw32 --prefix=/mingw --enable-threads --disable-nls --enable-languages=c,c++,f77,ada,objc,java --disable-win32-registry --disable-shared --enable-sjlj-exceptions --enable-libgcj --disable-java-awt --without-x --enable-java-gc=boehm --disable-libgcj-debug --enable-interpreter --enable-hash-synchronization --enable-libstdcxx-debug
    Thread model: win32
    gcc version 3.4.2 (mingw-special)
     C:/Bin/Mingw/bin/../libexec/gcc/mingw32/3.4.2/collect2.exe -Bdynamic -o a.exe C:/Bin/Mingw/bin/../lib/gcc/mingw32/3.4.2/../../../crt2.o C:/Bin/Mingw/bin/../lib/gcc/mingw32/3.4.2/crtbegin.o -LC:\Bin\Stk\bin -LC:\Bin\Mingw\Lib -LC:/Bin/Mingw/bin/../lib/gcc/mingw32/3.4.2 -LC:/Bin/Mingw/bin/../lib/gcc -LC:/Bin/Mingw/bin/../lib/gcc/mingw32/3.4.2/../../../../mingw32/lib -LC:/Bin/Mingw/bin/../lib/gcc/mingw32/3.4.2/../../.. Debug\stdafx.o Debug\a.o -lstk -lkernel32 -l-lstdc++ -lmingw32 -lgcc -lmoldname -lmingwex -lmsvcrt -luser32 -lkernel32 -ladvapi32 -lshell32 -lmingw32 -lgcc -lmoldname -lmingwex -lmsvcrt C:/Bin/Mingw/bin/../lib/gcc/mingw32/3.4.2/crtend.o
    C:\Bin\Mingw\bin\..\lib\gcc\mingw32\3.4.2\..\..\..\..\mingw32\bin\ld.exe: cannot find -l-lstdc++
    There are no options in the project file that would lead to this sort of problem (I've looked at it with a text editor), and can't find anything that references this stdc++ library. Of course, there's just an extra -l somewhere, but I can't find where, whether it's my fault, etc.

  2. #2
    Just Lurking Dave_Sinkula's Avatar
    Join Date
    Oct 2002
    I haven't fired up Code::Blocks proper in quite a while, so this is just speculation.

    To me it looks like it is concatenating an empty library with the next library; i.e. -l%missing_file% -lstdc++. Could there be some kind of "empty" library entry somewhere?
    7. It is easier to write an incorrect program than understand a correct one.
    40. There are two ways to write error-free programs; only the third one works.*

  3. #3
    C++ Witch laserlight's Avatar
    Join Date
    Oct 2003
    hmm... is a library with no name even possible?
    Quote Originally Posted by Bjarne Stroustrup (2000-10-14)
    I get maybe two dozen requests for help with some sort of programming or design problem every day. Most have more sense than to send me hundreds of lines of code. If they do, I ask them to find the smallest example that exhibits the problem and send me that. Mostly, they then find the error themselves. "Finding the smallest program that demonstrates the error" is a powerful debugging tool.
    Look up a C++ Reference and learn How To Ask Questions The Smart Way

  4. #4
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    The edge of the known universe
    Maybe an extra space character somewhere, which caused the IDE to output an extra -l, only to discover that there was no filename (buggy IDE?)

    The problem could be in the IDEs project file itself, and not visible via the user interface.
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Problem building Quake source
    By Silvercord in forum Game Programming
    Replies: 16
    Last Post: 07-11-2010, 09:13 AM
  2. could not find -lwsock32.lib
    By thomas_joyee in forum C++ Programming
    Replies: 8
    Last Post: 07-14-2008, 12:28 PM
  3. How to find O of threads ?
    By jabka in forum C Programming
    Replies: 3
    Last Post: 03-11-2008, 12:25 PM
  4. how do u find 2nd largest number??
    By juancardenas in forum C Programming
    Replies: 8
    Last Post: 02-14-2003, 08:28 AM
  5. Q: Recursion to find all paths of a maze
    By reti in forum C Programming
    Replies: 7
    Last Post: 11-26-2002, 09:28 AM