There is no source code available for the current location?!

This is a discussion on There is no source code available for the current location?! within the C++ Programming forums, part of the General Programming Boards category; Hi, I've spent several hours on this and I can't figure out what's wrong Please help. Edit 2: I tried ...

  1. #1
    Registered User
    Join Date
    May 2010
    Posts
    4

    There is no source code available for the current location?!

    Hi, I've spent several hours on this and I can't figure out what's wrong Please help.

    Edit 2: I tried everything in Dev-C++ and there were no errors (I was originally using VC++), so it's a debugger problem :/ I still don't know how to solve it...
    Edit: Here's a smaller program that I thought was pretty straightforward that still gives me the same error when debugging

    Code:
    #include<iostream>
    using namespace std;
    
    int main() {
    	int m=4;
    	int ** Rows;
    	Rows = new int * [m];
    	return 0;
    }
    Code:
    #include<iostream>
    using namespace std;
    
    struct Node {
    	int row;
    	int col;
    	int value;
    	Node * next_in_col;
    	Node * next_in_row;
    };
    
    int main() {
    	int m, n;
    	cin >> m >> n;
    	Node * * Rows;
    	Rows = new Node * [m];
    }

    When I debug I get this error message:
    "There is no source code available for the current location.
    OK / Show Disassembly"

    --- f:\dd\vctools\crt_bld\self_x86\crt\src\newaop.cpp --------------------------
    002C14C0 mov edi,edi
    002C14C2 push ebp
    002C14C3 mov ebp,esp
    002C14C5 mov eax,dword ptr [count]
    002C14C8 push eax
    002C14C9 call operator new (2C1186h)
    002C14CE add esp,4
    002C14D1 pop ebp
    002C14D2 ret
    (the yellow arrow points to the first line: "mov edi,edi")

    Also, I know it runs, but when I put it in a larger program it crashes miserably
    Last edited by en_em_i; 05-01-2010 at 05:43 AM.

  2. #2
    spurious conceit MK27's Avatar
    Join Date
    Jul 2008
    Location
    segmentation fault
    Posts
    8,300
    If it's any consolation, both those snippets compile and run fine for me (g++ on linux), I don't think you are doing anything wrong.

    Try it with malloc:
    Code:
    #include <cstdlib>
    [...]
    	Rows = (Node**)malloc(m*sizeof(Node));
    C programming resources:
    GNU C Function and Macro Index -- glibc reference manual
    The C Book -- nice online learner guide
    Current ISO draft standard
    CCAN -- new CPAN like open source library repository
    3 (different) GNU debugger tutorials: #1 -- #2 -- #3
    cpwiki -- our wiki on sourceforge

  3. #3
    Just a pushpin. bernt's Avatar
    Join Date
    May 2009
    Posts
    426
    Make sure you're compiling with debug flag. I don't know if Dev-C++ automatically switches to the debug target when you choose to run the debugger or not, so check the build options or whatever pertains to that.

    I think Dev-C++ comes with a really old version of MinGW, too, so you might consider getting the new version of that.
    Consider this post signed

  4. #4
    Super Moderator VirtualAce's Avatar
    Join Date
    Aug 2001
    Posts
    9,586
    You normally get that when working with DLLs that you do not have the source for - otherwise called release candidates. Not sure why you are getting that with this particular project.

  5. #5
    Registered User
    Join Date
    Mar 2010
    Posts
    68
    Maybe try parenthesis? like this:

    Rows = new (Node*)[m]

    If not, I am out of idears!

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Need software to help to understand C source code
    By Kincider in forum C++ Programming
    Replies: 1
    Last Post: 09-28-2006, 09:44 PM
  2. Lines from Unix's source code have been copied into the heart of Linux????
    By zahid in forum A Brief History of Cprogramming.com
    Replies: 13
    Last Post: 05-19-2003, 03:50 PM
  3. How do I get the current date in my code?
    By FromHolland in forum C++ Programming
    Replies: 3
    Last Post: 04-08-2003, 01:37 PM
  4. C source code for int25 or code help
    By Unregistered in forum C Programming
    Replies: 0
    Last Post: 09-26-2001, 02:04 AM
  5. Source Location
    By Unregistered in forum C Programming
    Replies: 1
    Last Post: 09-07-2001, 08:25 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21