CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 6 of 6
  1. #1
    Join Date
    Dec 2011
    Posts
    9

    C++ 2010 Problem

    I recently downloaded Visual C++ 2010 Express Edition and found a weird bug. If the project path is too long, even with the simplest projects, and you compile it, it'll say Source File Not Found, and in the error will have '\...\...\...\...\...\...\my project path here. It doesn't matter how short the code is or what the code is. Could be a hello world app, doesn't matter. The only way it works is if you move the entire project to another location that has a shorter file path. But then you get another error message where its saying that the source file hasn't been found, and it lists the old path it originally was, thus forcing you to remove the cpp file and reopen it into your project and then it finally works. I never had this problem with C++ 2008 and was wondering if there's a way to fix this bug. Thanks in advance.

  2. #2
    Join Date
    Jun 2010
    Location
    Germany
    Posts
    2,675

    Re: C++ 2010 Problem

    There's a limitation to path length imposed by Windows itself (see http://msdn.microsoft.com/en-us/libr...7.aspx#maxpath), so the limit as such is not related to VC++.

    I'm using VC++ 2010 Express myself and never had that problem, and I also never have seen any other reports of a problem like that. So I suspect that there's something misconfigured in your VC++ installation. I somehow doubt that "\...\...\...\...\...\...\my project path here" really is the actual path reported in the error message, and perhaps knowing the real path may be helpful in diagnosing the problem.

    Also, can you reproduce the problem with a native C++ Hello World program (Win32 console application)? In that case it clearly is a problem with the VC++ IDE and unrelated to C++/CLI, so I'd suggest to repost your question in the Visual C++ section where you have a much bigger audience.
    I was thrown out of college for cheating on the metaphysics exam; I looked into the soul of the boy sitting next to me.

    This is a snakeskin jacket! And for me it's a symbol of my individuality, and my belief... in personal freedom.

  3. #3
    Join Date
    Dec 2011
    Posts
    9

    Re: C++ 2010 Problem

    Ok here is the problem. I'm gonna have a simple msgbox hello world app that works on VC++ 2008 and 2010.

    Code:
        #include <windows.h>
         
        int WINAPI WinMain (HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpszArgument, int nCmdShow)
        {
            MessageBox(NULL, "Hello World", "", MB_OK);
            return(0);
        }
    And this is the error message I receive:

    Code:
    1>------ Build started: Project: DX Tut, Configuration: Debug Win32 ------
    1>  Main.cpp
    1>c1xx : fatal error C1083: Cannot open source file: '..\..\..\..\..\..\..\..\..\Jacob's Stuff\Source Code\Massive DirectX Tutorial\C++\2010\DirectXGraphics\2D\DX Tut - 2D Polygon Drawing\DX Tut\Main.cpp': No such file or directory
    ========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
    The actual path is this:
    C:\Jacob's Stuff\Source Code\ Massive DirectX Tutorial\C++\2010\DirectXGraphics\2D\DX Tut - 2D Polygon Drawing\DX Tut\Main.cpp

    Also whats funny is the bug I talked about in post #1. I moved the entire project back to the path I had before (the long one) and it's working still.

  4. #4
    Join Date
    Dec 2011
    Posts
    9

    Re: C++ 2010 Problem

    I also did another test on top of what I did from the last post. I made a project called Test, put it in the C:\ drive, did the same code listed above, the hello world messagebox, and it suceeeded. Something is really iffy here:

    Code:
    1>------ Rebuild All started: Project: Test, Configuration: Debug Win32 ------
    1>  Main.cpp
    1>  Test.vcxproj -> C:\Test\Debug\Test.exe
    ========== Rebuild All: 1 succeeded, 0 failed, 0 skipped ==========

  5. #5
    Join Date
    Jun 2010
    Location
    Germany
    Posts
    2,675

    Re: C++ 2010 Problem

    You do know what ".." means in terms of directories, don't you? It means "one nesting level up" (i.e. towards the root). So, assuming the current working directory from which that weird path is evaluated actually is C:\Jacob's Stuff\Source Code\ Massive DirectX Tutorial\C++\2010\DirectXGraphics\2D\DX Tut - 2D Polygon Drawing\DX Tut (not taking into account the file that is supposed to be found at the end of the path), that chain of "..\" would eventually evaluate to C:\ and be mostly redundant. In turn, the completely resolved path would be C:\Jacob's Stuff\Source Code\ Massive DirectX Tutorial\C++\2010\DirectXGraphics\2D\DX Tut - 2D Polygon Drawing\DX Tut\Main.cpp, just where you claim the file in question to be.

    All that pretty much looks like there's some problem in your configuration of VC++ or the configuration of your project.

    Also, as the test code you quoted in the first snippet in post #3 clearly is Win32, the problem is as clearly unrelated to C++/CLI, so you may want to repost your question in the native VC++ section, as I already suggested. (At least I, myself, don't have any idea what's going on here... )
    I was thrown out of college for cheating on the metaphysics exam; I looked into the soul of the boy sitting next to me.

    This is a snakeskin jacket! And for me it's a symbol of my individuality, and my belief... in personal freedom.

  6. #6
    Join Date
    Dec 2011
    Posts
    9

    Re: C++ 2010 Problem

    Ok I'll do that. :P

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured