Sign in to follow this  

Compiling time error in VS

Recommended Posts

This is really for beginners... :unsure:
The project I have as reference has the same target windows version and the same lib/headers include paths. both projects has not headers/libs inside their project folders. VS takes the headers/libs from somewhere.
Intellisense is quiet.
The example project compiles, mine does not. (i tried with both with "debug", same errors)

I know it is hard to for you to solve my problem from the distance, but maybe I have luck and it results to be easier than I think.

28dfca6982.png

 

Share this post


Link to post
Share on other sites

I don't use visual studio, but your screenshot only confirms to me what you already said, you have errors.

Since the example program works, something happened in-between.

To debug the problem try to find what part breaks the compilation. Start with the working program, and slowly add new things or change things, constantly checking that it continues to work.

Then, 2 things can happen. A) It works after all changes have been made. Still no idea, but it works!

B) It fails somewhere. Go back to the last working version, and make the last change smaller, and try again. Eventually, you can't add anything without breaking it. At that point you know what change actually breaks the build, and you can concentrate on making that change work.

Share this post


Link to post
Share on other sites
Have you added new files to your project?
The linker error can happen if you included the header files but did not add the source files to your solution.
Also your code does compile. However it does not link, that's why intelisense won't find anything. You should have a look at how binaries in c++ are created to understand the problem better.

Share this post


Link to post
Share on other sites

I tried to rebuild it all from scratch, but it still can't find/resolve the Media Foundation stuff.
The book says: If you have error of unresolved stuff, make sure to add the include and library folders to the source paths. Those are for win7 and I don't have them anywhere. This is what says the book. But I changed it for 10.0.4.. and the original is still working. Where is taking the headers and libs from?!?!

How can I see which folder the path $(includes) points to? I could try to add the path the original demo reads from directly to my project, because maybe it is relative or something I just don't know. :((((((((

Share this post


Link to post
Share on other sites

I'm not familiar with Visual Studio or with Windows, but I think I see a line of text in your photograph that reads something like "Not all components required for linking are present on command line."  My first guess is that means that not all components required for linking are present in the Linker command line, so first thing I'd try is to go to the Linker page (which I also see in your photograph) and check to see that all the required components are present.  If they're not, I'd try adding them.

I also see text complaining about unresolved symbols, which usually mean you're missing components from the linker command line, like say a library or something.  Did you you add the headers and a search path to the compiler, but not the actual library names to the linker?

Share this post


Link to post
Share on other sites

Thank you, @Bregma, for the hint!
Your suggestion made me try things around the actual .lib files and it finally compiled without errors after introducing the .lib files manually inside the source code. For some reason VS was not linking them when i added them using the GUI the same way they are added in the original example project.

Thanks to all the others gave me suggestions too!

2ccb5b11f8.png

I know I am very far from being elegant with C++. I am not trying to shine with C++ skills, but with the algorithm that I will implement in C# once all the API part is working.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this