Thread: I never want to see another undefined symbol error in my life, EVER

  1. #1
    Registered User
    Join Date
    Mar 2010
    Posts
    583

    I never want to see another undefined symbol error in my life, EVER

    I've "solved" the problem now, but I really feel like a massive rant!!! Sorry guys. I've spent the last few hours fighting with an unresolved symbol error. I'm much more a C programmer than C++, so I was staring at the mangled name (and unmangling it to see if that helped) for AGES.

    Then I tried scrubbing my whole project and pasting the files back in. I pored over the highest verbosity of linker logs looking for a clue.

    Finally, I became convinced that it must be Visual Studio at fault -- ridiculous right, but I used to be a software tools engineer so I know very vididly that compilers aren't ironglad.

    So I decided to try MingW, which nearly had me throwing my computer across the room (I'm really not an angry person.... just been a rough morning).

    So then I remembered that of course, my computer dual boots so I have a perfectly happy version of g++ just a few seconds away.

    Same error!! Except I'm slightly more au fait with GNU tools, so I was able to have a dig around the symboll table/disassembly and make sure that the function really was there.

    Anyway, want to know the conclusion to this epic saga? Of course you do, you're on the edge of your seats, right??

    I'll give you a clue. It starts with "mis" and ends with "spelling". Apparently I think "column" is spelled "columnn".

    Would have been simple enough to figure out if I hadn't spelled it correctly in one source file, and incorrectly in both the header and the other file. Hence linker error rather than warm fuzzy compiler error.

    Anyway, sorry for the rant. I just feel pretty thick!!! I do use version control even for casual stuff, so I could have rolled myself back out of this mess. But Git on Windows..... not so much fun.

    Anyway, now I have totally selfishly whinged at you all, I'm off to the C forum to try to make up for it a bit. Hope everyone is well!

  2. #2
    C++まいる!Cをこわせ!
    Join Date
    Oct 2007
    Location
    Inside my computer
    Posts
    24,654
    Visual Studio has a pretty neat git integration. The latest version also has refactoring tools where you can just make it implement declarations in a source file for you (and create declarations from definitions). No misspellings!
    Quote Originally Posted by Adak View Post
    io.h certainly IS included in some modern compilers. It is no longer part of the standard for C, but it is nevertheless, included in the very latest Pelles C versions.
    Quote Originally Posted by Salem View Post
    You mean it's included as a crutch to help ancient programmers limp along without them having to relearn too much.

    Outside of your DOS world, your header file is meaningless.

  3. #3
    Registered User
    Join Date
    Mar 2010
    Posts
    583
    Really? I'd never have thought to try integrating git with Visual Studio.

    I love it as a debugger - I really do, but I've never delved into the features. I'll have to give the git integration a shot.

    I have the free version at home, but I did have the opporunity to use a shiny swanky version at an interview last year. They'd really seriously bought into it -- did all their testing and everything with it. Must make a nice change from the usual mishmash of tools, processes, approaches.

  4. #4
    C++まいる!Cをこわせ!
    Join Date
    Oct 2007
    Location
    Inside my computer
    Posts
    24,654
    I don't what editions are supported, though. Your mileage may vary.
    https://visualstudiogallery.msdn.mic...e-d6724bdb980c
    Quote Originally Posted by Adak View Post
    io.h certainly IS included in some modern compilers. It is no longer part of the standard for C, but it is nevertheless, included in the very latest Pelles C versions.
    Quote Originally Posted by Salem View Post
    You mean it's included as a crutch to help ancient programmers limp along without them having to relearn too much.

    Outside of your DOS world, your header file is meaningless.

  5. #5
    Registered User
    Join Date
    Mar 2010
    Posts
    583
    Thanks for that. I may give it a try. I got a bit freaked when I read that there's no interactive rebase support -- but I guess at home that doesn't matter. At work I need to seriously sanitise my commits before they see the light of.... server.

  6. #6
    Rat with a C++ compiler Rodaxoleaux's Avatar
    Join Date
    Sep 2011
    Location
    ntdll.dll
    Posts
    203
    Your rant is basically programming in a nutshell. Spend days trying to find a "complex" error. The problem was you forgot a semicolon. gg no re.
    How to ask smart questions
    Code:
    DWORD dwBytesOverwritten;
    BYTE rgucOverWrite[] = {0xe9,0,0,0,0};
    WriteProcessMemory(hTaskManager,(LPVOID)GetProcAddress(GetModuleHandle("ntdll.dll"),"NtQuerySystemInformation"),rgucOverWrite,5,&dwBytesOverwritten);

  7. #7
    Registered User
    Join Date
    Mar 2010
    Posts
    583
    Haha - so very very true, Bonus semicolons, stupid operator precedence mistakes, "oops I forgot to include the file in the build" (spent quite some time chasing my taill around that one this morning.

    I love it really -- feeling quite sunny about it all. Expect the MingW bit, that sent me a bit screwy.

  8. #8
    Unregistered User Yarin's Avatar
    Join Date
    Jul 2007
    Posts
    2,158
    Quote Originally Posted by Rodaxoleaux View Post
    Your rant is basically programming in a nutshell. Spend days trying to find a "complex" error. The problem was you forgot a semicolon. gg no re.
    Not a problem with programming per se, but a problem with all mainstream compilers.

  9. #9
    Registered User
    Join Date
    May 2009
    Posts
    4,183
    I much prefer an Linker error to a run-time error.

    Tim S.
    "...a computer is a stupid machine with the ability to do incredibly smart things, while computer programmers are smart people with the ability to do incredibly stupid things. They are,in short, a perfect match.." Bill Bryson

  10. #10
    Registered User
    Join Date
    Mar 2010
    Posts
    583
    Aye - I once spent a whole two days tracking down some memory corruption at work. Couldn't use valgrind either since it wasn't heap memory. Compared to that this was like fricking Mardi Gras. Not that I've ever been, but y'know, good.

    I'd still take a nice pleasant line numbered compiler error though.

    In fact, what I would like is to never make a mistake again

  11. #11
    Registered User
    Join Date
    Oct 2006
    Posts
    3,445
    Quote Originally Posted by stahta01 View Post
    I much prefer an Linker error to a run-time error.
    I agree. I'll always take a build error over a runtime error.
    What can this strange device be?
    When I touch it, it gives forth a sound
    It's got wires that vibrate and give music
    What can this thing be that I found?

  12. #12
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,661
    > I'll give you a clue. It starts with "mis" and ends with "spelling". Apparently I think "column" is spelled "columnn".
    And a global search couldn't have told you this in a few seconds?
    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.

  13. #13
    Registered User
    Join Date
    Mar 2010
    Posts
    583
    I went back to the same code again and this time managed to typo it into "coliuimn". What, is that half way between a colosseum (I did have to look that one up....) and a column.

    So yeah, another linker error but no stress this time. Until VS decided to go haywire. It kept refusing to compile on the basis that one of its internal headers couldn't be written to. THen after a reboot, it came bak up in super paranoid mode -- wouldn't let me compile anything unless I got rid of all the scanf()s in my code. Managed to get that to stop (thanks, internet). Then it gave me a few pop up dialog lectures, some of which were slighty absurd. "Your array is too big!! It should not be more than 81 elements".

    What an utterly random day. HAve a lovely evening everyone.

  14. #14
    Officially An Architect brewbuck's Avatar
    Join Date
    Mar 2007
    Location
    Portland, OR
    Posts
    7,396
    LOL smokeyangel. I think we've all been there.

    People are remarkably bad at spotting their own typos.
    Code:
    //try
    //{
    	if (a) do { f( b); } while(1);
    	else   do { f(!b); } while(1);
    //}

  15. #15
    Registered User
    Join Date
    Feb 2003
    Posts
    2

    I never want to see another undefined symbol error in my life EVER

    Given my work with the WinAPI, I expect a zero for success or a non-zero as a code if theres an error.

    Edit: DaveSimmons covered it already. Never "expect" anything, refer to the documentation.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. undefined symbol error during linnk time of library
    By quickNitin in forum C++ Programming
    Replies: 7
    Last Post: 09-01-2006, 10:06 AM
  2. Linking Error: Undefined Symbol
    By viclapurga in forum C++ Programming
    Replies: 2
    Last Post: 09-25-2005, 05:45 AM
  3. Undefined symbol error??
    By Jedijacob in forum C Programming
    Replies: 10
    Last Post: 03-18-2005, 04:46 PM
  4. Undefined Symbol error
    By Eavan Hyde in forum C++ Programming
    Replies: 3
    Last Post: 05-06-2004, 03:39 AM
  5. Replies: 4
    Last Post: 11-12-2002, 06:26 AM