Thread: Circular dependency problem

  1. #16
    Registered User
    Join Date
    May 2009
    Posts
    4,183
    If you do NOT post the CB Build Log, I will add you to my list of people to ignore since you are just wasting everybody's time in this thread!

    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

  2. #17
    Registered User
    Join Date
    Dec 2007
    Posts
    932
    Quote Originally Posted by stahta01 View Post
    If you do NOT post the CB Build Log, I will add you to my list of people to ignore since you are just wasting everybody's time in this thread!

    Tim S.
    Sorry, I thought the errors were enough. Here it is:

    Code:
    cl.exe /nologo /MD /EHc /EHs /GS /Gy /D_USING_V110_SDK71_  /GS /GL /analyze- /W3 /Gy /Zc:wchar_t /Zi /Gm- /O2 /sdl  /fp:precise /D "_MBCS" /errorReport:prompt /WX- /Zc:forScope /Gd /Oy- /Oi /MD  /EHsc /nologo   /I"C:\Program Files (x86)\Microsoft SDKs\Windows\v7.1A\Include" /I"C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include"  /ID:\openssl-1.0.1c\inc32\ /ID:\openssl-1.0.1c\inc32\openssl  /ID:\OpenCV\build\include /ID:\OpenCV\build\include\opencv2  /ID:\@C++\CURL\libcurl-7.19.3-win32-ssl-msvc\include /IC:\WinDDK\7600.16385.1\inc\api  /ID:\DIRECTSHOW\FFMPEG\ffmpeg-20140713-git-42c1cc3-win32-dev\include /I"C:\Program Files (x86)\Microsoft SDKs\Cpp REST SDK for Visual Studio 2013\SDK\include" /I"C:\Program Files\Microsoft SDKs\Windows\v7.1\Samples\multimedia\directshow\baseclasses" /I"C:\Program Files\Microsoft SDKs\Windows\v7.1\Samples\multimedia\directshow\common" /I"C:\Program Files (x86)\Windows Kits\8.1\Include\shared" /I"C:\Program Files (x86)\Microsoft Visual Studio 8\VC\include"  /c D:\test.cpp /FoD:\test.obj
    test.cpp
    D:\test.cpp(25) : error C2143: syntax error : missing ';' before '<'
    D:\test.cpp(25) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
    Process terminated with status 2 (0 minutes, 1 seconds)
    2 errors, 0 warnings
    Last edited by Ducky; 12-27-2014 at 04:05 PM.
    Using Windows 10 with Code Blocks and MingW.

  3. #18
    Registered User
    Join Date
    May 2009
    Posts
    4,183
    FYI:

    Do you have the Windows SDK Installed that contains the header Streams.h?

    I tried the code you posted and I am now trying to install the Windows 8.1 SDK to see if the error goes away.

    I got the same error with MSVS 2010; but, I was missing the header Streams.h.

    Edit: It is about 800MByte download; so, I will NOT be done with it for several hours.

    Tim S.
    Last edited by stahta01; 12-27-2014 at 05:33 PM.
    "...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

  4. #19
    Registered User
    Join Date
    May 2009
    Posts
    4,183
    Still waiting for the Windows 8.1 SDK to download.

    But, I did get it to compile by breaking the rules using Windows SDK 7.1

    Code:
    #include <windows.h>
     
    #include <Dshow.h>      // I had to move this header before the headers inside Streams.h
    
    // #include <Streams.h> //
    #include <wxdebug.h>    // Debug support for logging and ASSERTs
    #include <Combase.h>
    #include <Wxlist.h>
    You might be right about a Circular dependency problem or it might just be an user issue. I am NOT a C++ programmer and I use MSVC very rarely.

    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

  5. #20
    Registered User
    Join Date
    May 2009
    Posts
    4,183
    FYI:

    You should NOT be including more that a single windows SDK; but, this is a guess from a C programmer instead of a C++ programmer.

    No idea about this SDK include path.
    Code:
    /I"C:\Program Files (x86)\Microsoft SDKs\Cpp REST SDK for Visual Studio 2013\SDK\include"
    Mixing multiple versions of Windows SDK is normally a very bad idea.
    Code:
    /I"C:\Program Files (x86)\Microsoft SDKs\Windows\v7.1A\Include"
    Code:
    /I"C:\Program Files\Microsoft SDKs\Windows\v7.1\Samples\multimedia\directshow\baseclasses" 
    /I"C:\Program Files\Microsoft SDKs\Windows\v7.1\Samples\multimedia\directshow\common"
    Code:
    /I"C:\Program Files (x86)\Windows Kits\8.1\Include\shared"
    Mixing two versions of MSVC headers is also bad.
    Code:
    /I"C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include"
    Code:
    /I"C:\Program Files (x86)\Microsoft Visual Studio 8\VC\include"
    Tim S.
    Last edited by stahta01; 12-27-2014 at 06:23 PM.
    "...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

  6. #21
    Registered User
    Join Date
    May 2009
    Posts
    4,183
    Got it to work without breaking the rules


    Code:
    #include <windows.h>
     
    #include <Dshow.h>      // I had to move this header before the headers inside Streams.h
    #include "Streams.h"
    Note: I have to add the path to the non standard header to the project to do this right.

    Code:
    C:\Program Files\Microsoft SDKs\Windows\v7.1\Samples\multimedia\directshow\baseclasses
    My Build log; edited because I missed changing the SDK version in my CB Settings.
    Code:
    cl.exe /nologo /W3 /EHsc  /Ox /DNDEBUG /MD    /I"C:\Program Files\Microsoft SDKs\Windows\v7.1\Samples\multimedia\directshow\baseclasses" /I"C:\Program Files\Microsoft SDKs\Windows\v7.1\include" /I"C:\Program Files\Microsoft Visual Studio 10.0\VC\include" /c main.cpp /Foobj\ReleaseWin32\main.obj
    main.cpp
    link.exe /nologo /LIBPATH:"C:\Program Files\Microsoft SDKs\Windows\v7.1\lib" /LIBPATH:"C:\Program Files\Microsoft Visual Studio 10.0\VC\lib" /out:bin\ReleaseWin32\CRouting.exe msvcrt.lib msvcprt.lib obj\ReleaseWin32\main.obj  
    Output file is bin\ReleaseWin32\CRouting.exe with size 5.50 KB
    Process terminated with status 0 (0 minute(s), 3 second(s))
    0 error(s), 0 warning(s) (0 minute(s), 3 second(s))
    So, I go with the problem was user error and MS documentation error.

    Edit: The MS documentation error was the header Streams.h was implied to be a standard windows header instead of a non-standard header. It likely started out as a non-standard and might have been changed to a standard header after Windows SDK 7.1 or the documentation is very wrong. FYI: These <> brackets implies standard or supplied header. These "" quotes implies non standard or user header. I think all sample headers should use double quotes.

    Tim S.
    Last edited by stahta01; 12-27-2014 at 06:43 PM.
    "...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

  7. #22
    Registered User
    Join Date
    Dec 2007
    Posts
    932
    You're brilliant Tim!

    You taught me how to avoid these errors in the future.

    Thank you very much.
    Using Windows 10 with Code Blocks and MingW.

  8. #23
    Registered User
    Join Date
    Dec 2007
    Posts
    932
    By the way, it compiled with #include <Streams.h> instead of #include "Streams.h" too.

    So it must be a standard header.
    Using Windows 10 with Code Blocks and MingW.

  9. #24
    C++ Witch laserlight's Avatar
    Join Date
    Oct 2003
    Location
    Singapore
    Posts
    28,413
    No, that does not mean it is a standard header (it isn't).
    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

  10. #25
    Registered User
    Join Date
    Dec 2007
    Posts
    932
    Quote Originally Posted by laserlight View Post
    No, that does not mean it is a standard header (it isn't).
    It's an important header of Directshow. How can it be not standard then?
    Using Windows 10 with Code Blocks and MingW.

  11. #26
    C++ Witch laserlight's Avatar
    Join Date
    Oct 2003
    Location
    Singapore
    Posts
    28,413
    Quote Originally Posted by Ducky
    It's an important header of Directshow. How can it be not standard then?
    The term standard in this context refers to something that is specified in the C++ standard.
    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

  12. #27
    Registered User
    Join Date
    May 2009
    Posts
    4,183
    FYI: The header Streams.h you wished to use is neither a Standard C++ header nor a normal Windows OS header.
    It is a sample windows header; note there was also another header named Streams.h or streams.h that might be or was a normal Windows OS header.

    That is a likely cause of the error you got; the wrong Streams.h was being found before the one you wanted to include.

    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

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Circular Dependency A Dead End?
    By Waleed Mujeeb in forum C++ Programming
    Replies: 2
    Last Post: 04-24-2012, 09:41 AM
  2. Circular main <- main.o dependency dropped.
    By Queatrix in forum C++ Programming
    Replies: 4
    Last Post: 10-21-2005, 02:32 PM
  3. Headers circular referencing problem
    By Malefaust in forum C Programming
    Replies: 5
    Last Post: 09-10-2005, 04:01 PM
  4. Replies: 3
    Last Post: 08-31-2005, 12:41 PM
  5. Circular dependency / Compile Error
    By jester in forum C++ Programming
    Replies: 4
    Last Post: 05-23-2003, 11:17 PM