Thread: Unknown error...

  1. #1
    Not stupid, just stupider yaya's Avatar
    Join Date
    May 2007
    Location
    Earthland
    Posts
    204

    Thumbs up Unknown error...

    I was just wondering if someone could tell me what this error means in Dev-C++

    [Warning] local symbol `text' has no section

    [Warning] local symbol `' has no section

    BFD 2.15.91 20040904 assertion fail ../../src/bfd/cofflink.c:2269
    I've gone over the code countless times and I can't find anything.

  2. #2
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,659
    Trying to use an object file generated by another compiler springs to mind.

    Care to share more details on what you're doing, like are you using any additional libraries?

    Also, does a "rebuild all" fix it.
    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.

  3. #3
    Not stupid, just stupider yaya's Avatar
    Join Date
    May 2007
    Location
    Earthland
    Posts
    204
    I always wondered what that "Rebuild All" button done.

    But now I've got another error. It says I'm missing .o files for all my .cpp files (except for my main.cpp).

    Question 1: What do I do?
    Question 2: What do these .o files do?

  4. #4
    C++ Witch laserlight's Avatar
    Join Date
    Oct 2003
    Location
    Singapore
    Posts
    28,413
    Did you place your source files in a project? The .o files are objects that are generated after compilation. It looks like not all of the files were compiled, so the linker cannot link those left not compiled.
    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

  5. #5
    Not stupid, just stupider yaya's Avatar
    Join Date
    May 2007
    Location
    Earthland
    Posts
    204
    This is what happend: It came up with that BFD error so I went to Rebuild All. Now I find out that my .o files are gone and I get more errors saying absolutely nothing's declared (and, of course, the .o files are gone). What now? I'm sure all the source files are in the project.

  6. #6
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,659
    Well the compiler creates all the .o files from the .c or .cpp files.

    > I'm sure all the source files are in the project.
    In order to create them, you need to add all your .cpp files to your project (not just the one containing main).
    You do mean in the project (as seen by dev-c++), and not just in the same directory right?
    Did you get any errors when trying to compile?


    Some people have said in the past that dev-c++ is a bit on the buggy side when it comes to managing it's project files, so maybe it's managed to shoot itself. If you've only got a few files, then creating a whole new project, moving them across and adding them to the new project seems to fix a lot of things.
    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.

  7. #7
    Not stupid, just stupider yaya's Avatar
    Join Date
    May 2007
    Location
    Earthland
    Posts
    204
    I just tried creating another project and even doing it in Code::Blocks it failed. This is really starting to get on my nerve...

  8. #8
    Not stupid, just stupider yaya's Avatar
    Join Date
    May 2007
    Location
    Earthland
    Posts
    204
    Nevermind, I fixed it. For some reason, when I changed the .cpp files to .h files, there was no problems. Does this mean it was my bad all along?

  9. #9
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,659
    You were doing something wrong if that was the fix.

    In general, you shouldn't be doing
    #include "myclass.cpp"
    in one source file,
    and compiling myclass.cpp separately.

    There's a FAQ on creating multi-file projects.
    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. Getting an error with OpenGL: collect2: ld returned 1 exit status
    By Lorgon Jortle in forum C++ Programming
    Replies: 6
    Last Post: 05-08-2009, 08:18 PM
  2. how do you resolve this error?
    By -EquinoX- in forum C Programming
    Replies: 32
    Last Post: 11-05-2008, 04:35 PM
  3. Quantum Random Bit Generator
    By shawnt in forum C++ Programming
    Replies: 62
    Last Post: 06-18-2008, 10:17 AM
  4. We Got _DEBUG Errors
    By Tonto in forum Windows Programming
    Replies: 5
    Last Post: 12-22-2006, 05:45 PM
  5. ras.h errors
    By Trent_Easton in forum Windows Programming
    Replies: 8
    Last Post: 07-15-2005, 10:52 PM