Advertisement

Compiling time error in VS

Started by June 15, 2017 01:45 PM
4 comments, last by NikiTo 7 years, 5 months ago

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

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.

Advertisement
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.

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. :((((((((

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?

Stephen M. Webb
Professional Free Software Developer

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.

This topic is closed to new replies.

Advertisement