English 中文(简体)
Fixing "error C2065: undeclared identifier"
原标题:

First off, I m completely out of my depth here. So the question might be the wrong one to ask, but here goes...

As per the accepted answer to this question, I m trying to compile the bindings for the Audiere library, which are produced by Harald Fielker and available in the mailing list archives.

I ve opened the .vcproj file in VC++ Express Edition and it converted it to a solution it could use. I ve then gone into the properties and added:

  • "C:Documents and Settings dw20My Documentsaudiere-win32include" to the additional include directories

  • "C:Documents and Settings dw20My DocumentsDownloadsaudiere-win32lib" to the additional library directories

Yet I still get "undeclared identifier" errors. The full output is listed on pastebin.

Does anyone have any idea what might be wrong?

问题回答

I can only start to guess, but are you sure the header files are where you anticipate them to be?

The OutputStream class referenced in outputstream.cpp isn t being recognised. As far as i can tell it s defined in the audiere.h header file in the audiere project, and the #include directive at line 2 of outputstream.cpp should be including that file.

Two things to try in VC++:

  1. In line 8 of outputstream.cpp double-click on OutputStream and then right-click, and on the context menu select Go To Definition. See what file it opens (if any).
  2. Right-click line 2 (#include <audiere.h>) and select Open Document.... Again see if it opens a file.

Actually, just realied you said you added C:Documents and Settings dw20My Documentsaudiere-win32include to the include but it looks to me like audiere.h is in a src sub-directory of audiere. Also the path you specified for the libs is inconsistent - it has an extra Downloads dir in the path. Are both these paths definitely correct? The dir you add to the include path should contain header files such as audiere.h and the dir for the libs should contain .lib files.

You shouldn t need to compile outputstream.cpp for the C# binding s libaudieresharpglue.dll. Did you download Audiere 1.9.4 Win32 binary release? I actually encountered an issue where I downloaded an old version of Audiere from 2002, I think, and it gave me a ton of trouble until I realized I had the wrong version.

The only source file you should need to worry about is include/audiere.h. You ll link against lib/audiere.lib, and at runtime your application will need to access bin/audiere.dll (which should probably be moved to your executable s directory, on on the DLL path, when you run your executable).





相关问题
Undefined reference

I m getting this linker error. I know a way around it, but it s bugging me because another part of the project s linking fine and it s designed almost identically. First, I have namespace LCD. Then I ...

C++ Equivalent of Tidy

Is there an equivalent to tidy for HTML code for C++? I have searched on the internet, but I find nothing but C++ wrappers for tidy, etc... I think the keyword tidy is what has me hung up. I am ...

Template Classes in C++ ... a required skill set?

I m new to C++ and am wondering how much time I should invest in learning how to implement template classes. Are they widely used in industry, or is this something I should move through quickly?

Print possible strings created from a Number

Given a 10 digit Telephone Number, we have to print all possible strings created from that. The mapping of the numbers is the one as exactly on a phone s keypad. i.e. for 1,0-> No Letter for 2->...

typedef ing STL wstring

Why is it when i do the following i get errors when relating to with wchar_t? namespace Foo { typedef std::wstring String; } Now i declare all my strings as Foo::String through out the program, ...

C# Marshal / Pinvoke CBitmap?

I cannot figure out how to marshal a C++ CBitmap to a C# Bitmap or Image class. My import looks like this: [DllImport(@"test.dll", CharSet = CharSet.Unicode)] public static extern IntPtr ...

Window iconification status via Xlib

Is it possible to check with the means of pure X11/Xlib only whether the given window is iconified/minimized, and, if it is, how?

热门标签