|
|||||||
![]() |
|
|
Thread Tools |
|
|
#1 |
|
DriverHeaven Lover
Join Date: Feb 2004
Location: Latvia
Posts: 154
Rep Power: 0 ![]() |
Compiler errors
I'm trying to compile the fx_demo program from the SDK, and I have problems. There's a conflict between kDefs.h and the system's atlconv.h - same functions AtlA2WHelper, AtlW2AHelper, AtlA2WHelper, AtlW2AHelper and macros A2W, W2A are defined. Their bodies are somewhat different in the two files. Trying to comment them out in kDefs.h leads to a perfect compile, but later to an assertion fail in winocc.cpp line 290 as soon as I press "tweak" on the plugin in the DSP. Commenting them out in atlconv.h leads to lots of "undeclared identifier" compiler errors. Using Visual C++ 7.0. So what am I doing wrong?
|
|
|
|
|
|
#2 |
|
kX user
Join Date: Apr 2004
Posts: 851
Rep Power: 0 ![]() |
That is strange. I've been using VC 6.0 and haven't had such problems at all. Did you try to compile it as it was, without altering the code or the project settings in any way?
__________________
Miss you, Steve... |
|
|
|
|
|
|
|
DriverHeaven Lover
Join Date: Feb 2004
Location: Latvia
Posts: 154
Rep Power: 0 ![]() |
The project/code wasn't altered in any way. atlconv.h gets included with some mfc header files, as far as I understand. Any ideas on how to resolve this problem?
|
|
|
|
|
|
#4 |
|
kX user
Join Date: Apr 2004
Posts: 851
Rep Power: 0 ![]() |
fx_demo should be all right, being already compiled in the SDK distribution and working fine.
This must be a kX SDK <-> VC 7.0 relation issue, because there are no such problems in 6.0. The difference between kDefs.h and atlconv.h is: ASSERT(something... != NULL); //kDefs ATLASSERT(something... != NULL); //atlconv.h Surely Eugene would know what this is about. I'll send him a mail. You can switch back to VC 6.0, but I don't know if this would be very comfortable for you for such a small problem.
__________________
Miss you, Steve... Last edited by Tiger M; Jul 12, 2004 at 06:54 AM. |
|
|
|
|
|
|
|
DriverHeaven Lover
Join Date: Feb 2004
Location: Latvia
Posts: 154
Rep Power: 0 ![]() |
The contents of my atlconv.h (hope I don't get massacred for posting its contents
) : inline LPWSTR WINAPI AtlA2WHelper(LPWSTR lpw, LPCSTR lpa, int nChars, UINT acp) throw() { ATLASSERT(lpa != NULL); ATLASSERT(lpw != NULL); if (lpw == NULL) return NULL; // verify that no illegal character present // since lpw was allocated based on the size of lpa // don't worry about the number of chars lpw[0] = '\0'; MultiByteToWideChar(acp, 0, lpa, -1, lpw, nChars); return lpw; } inline LPSTR WINAPI AtlW2AHelper(LPSTR lpa, LPCWSTR lpw, int nChars, UINT acp) throw() { ATLASSERT(lpw != NULL); ATLASSERT(lpa != NULL); if (lpa == NULL) return NULL; // verify that no illegal character present // since lpa was allocated based on the size of lpw // don't worry about the number of chars lpa[0] = '\0'; WideCharToMultiByte(acp, 0, lpw, -1, lpa, nChars, NULL, NULL); return lpa; } inline LPWSTR WINAPI AtlA2WHelper(LPWSTR lpw, LPCSTR lpa, int nChars) throw() { return AtlA2WHelper(lpw, lpa, nChars, CP_ACP); } inline LPSTR WINAPI AtlW2AHelper(LPSTR lpa, LPCWSTR lpw, int nChars) throw() { return AtlW2AHelper(lpa, lpw, nChars, CP_ACP); } /*... Some more defines here ... */ #define A2W(lpa) (\ ((_lpa = lpa) == NULL) ? NULL : (\ _convert = (lstrlenA(_lpa)+1),\ ATLA2WHELPER((LPWSTR) alloca(_convert*2), _lpa, _convert, _acp))) #define W2A(lpw) (\ ((_lpw = lpw) == NULL) ? NULL : (\ _convert = (lstrlenW(_lpw)+1)*2,\ ATLW2AHELPER((LPSTR) alloca(_convert), _lpw, _convert, _acp))) Please check if yours are the same (I mean for VC++ 6.0). Also, how is this not a conflict on your system? Is atlconv.h not #included in your MFC headers? Last edited by Doomsayer; Jul 10, 2004 at 10:42 AM. |
|
|
|
|
|
#6 |
|
kX user
Join Date: Apr 2004
Posts: 851
Rep Power: 0 ![]() |
There is a difference. Here it is:
throw() //this is not present in VC 6.0 version of the header I'll tell you what we'll do, but we should switch to PMs for that...
__________________
Miss you, Steve... |
|
|
|
|
|
|
|
DriverHeaven Lover
Join Date: Feb 2004
Location: Latvia
Posts: 154
Rep Power: 0 ![]() |
Well, another interesting thing I noticed. These functions/macros aren't used anywhere in the demo. So this means that I can safely comment them out. But then the abovementioned Assertion Fail seems to prove that there's deeper incompatibility between SDK 3537 and VC 7.0 include files...
The Assertion Fail happens here : int CWnd::GetDlgCtrlID() const { ASSERT(::IsWindow(m_hWnd) || (m_pCtrlSite != NULL)); // Line 290 if (m_pCtrlSite == NULL) return ::GetDlgCtrlID(m_hWnd); else return m_pCtrlSite->GetDlgCtrlID(); } Perhaps this thread should be moved to the bug reports section? |
|
|
|
|
|
|
|
DriverHeaven Lover
Join Date: Feb 2004
Location: Latvia
Posts: 154
Rep Power: 0 ![]() |
Btw, the Assertion Fail is caused by kxmixer.exe, so I'm not even sure if it's MY winocc.cpp where the error occurs. Probably it isn't.
Anyway, I seem to have narrowed the problem to one call inside iDemoPlugin::create_cp, namely tmp->create(). I'm afraid only the developer can investigate further... Last edited by Doomsayer; Jul 10, 2004 at 09:19 PM. |
|
|
|
|
|
#9 | |
|
kX user
Join Date: Apr 2004
Posts: 851
Rep Power: 0 ![]() |
Quote:
. I think this is the right place for this thread, but it actually doesn't matter, because nobody of the regular users would understand it anyway .btw, the 'Effects and the DSP' forum was intended by Eugene mostly for programmers and code sharing. It didn't turn out to be so, which is sad... ![]() Here is one very dramatic episode of kX history, take a look, its a real drama: http://www.hardwareheaven.com/showthre...ght=distortion
__________________
Miss you, Steve... |
|
|
|
|
|
|
#10 |
|
kX user
Join Date: Apr 2004
Posts: 851
Rep Power: 0 ![]() |
Check out your PM box again...
__________________
Miss you, Steve... |
|
|
|
|
|
#11 |
|
DH Senior Member
Join Date: Jan 2003
Location: The Netherlands
Posts: 1,932
Rep Power: 64 ![]() ![]() ![]() ![]() |
>>I think this is the right place for this thread,
Yes it is,.. So by all means continue..!! >>but it actually doesn't matter, because nobody of the regular users would understand it anyway. ![]() >>Here is one very dramatic episode of kX history, take a look, its a real drama: I got over it ... /LeMury |
|
|
|
|
|
#12 |
|
kX user
Join Date: Apr 2004
Posts: 851
Rep Power: 0 ![]() |
Yes, I think that it will be nice if I put the conclusion here, so anyone interested in plugins programing will be informed:
The best (and maybe the only working) compiler for kX Project related programming is MS Visual C++ 6.0. VC++ 7.0 or .NET doesn't seem to work due to MFC changes.
__________________
Miss you, Steve... |
|
|
|
|
|
#13 |
|
kX user
Join Date: Apr 2004
Posts: 851
Rep Power: 0 ![]() |
And here is the final conclusion and solution directly from Eugene:
"yes, VC7 uses different headers & binaries and is not 100% compatible with kX SDK. you may, however, use it provided you point to the original VC6 headers in your project" Its clear what should be done...
__________________
Miss you, Steve... |
|
|
|
|
|
#14 |
|
Apple Fanboy?
|
bloody microsoft and their non-standard following apps
__________________
Chris - The Aussie Super Mod
Hardwareheaven Rules - Sig Request Thread How you can help HardwareHeaven by using Digg! Hardwareheaven Super-Moderator |
|
|
|
|
|
#15 |
|
kX Project DSP Engineer
Join Date: Dec 2002
Location: Denmark
Posts: 94
Rep Power: 0 ![]() |
A little browsing in this forum should tell you this, since it has been discussed before.
MS Visual Studio 7 (.Net) will not work for creating kX-plugins. Cheers Soeren |
|
|
|
|
|
#16 | |
|
kX user
Join Date: Apr 2004
Posts: 851
Rep Power: 0 ![]() |
Quote:
VC 7 itself will work, provided that you have VC 6 MFC headers. By the way, I have read the thread you're speaking of, yes.
__________________
Miss you, Steve... |
|
|
|
|
|
|
|
|
DriverHeaven Lover
Join Date: Feb 2004
Location: Latvia
Posts: 154
Rep Power: 0 ![]() |
Well, that's sad. It's just another problem in the way of those who wish to participate actively in the kX community. And VS 7 is gaining in popularity, btw... Anyway, when I get past this problem, I'll post a how-to
|
|
|
|
|
|
#18 | |
|
kX Project DSP Engineer
Join Date: Dec 2002
Location: Denmark
Posts: 94
Rep Power: 0 ![]() |
Quote:
![]() Do you know if it is possible to get the VC 6 MFC headers somewhere (free, as in beer)? I am still using VC 6, but it would be nice to be able to show people the old headers. Still, if they want to make kX plugs badly enough they should be able to locate them by themselves ![]() /Soeren |
|
|
|
|
|
|
#19 | |
|
kX user
Join Date: Apr 2004
Posts: 851
Rep Power: 0 ![]() |
Quote:
its a great shame that kX project is such a superb environment and there are only 7-8 people in the whole world to venture in programming it Have fun.
__________________
Miss you, Steve... |
|
|
|
|
|
|
#20 | |
|
Apple Fanboy?
|
Quote:
__________________
Chris - The Aussie Super Mod
Hardwareheaven Rules - Sig Request Thread How you can help HardwareHeaven by using Digg! Hardwareheaven Super-Moderator |
|
|
|
|
|
|
#21 | |
|
kX Project DSP Engineer
Join Date: Dec 2002
Location: Denmark
Posts: 94
Rep Power: 0 ![]() |
Quote:
Still, I think it will be more feasible to make an "Advanced DSP programming guide" including all the pitfalls and strange issues that may occur in the process (for instance, these compiler issues). /Soeren P.S. I didn't actually mean that people should go hunting for the VC 6 headers on their own. We should rather provide these headers or at least the information reqiured to build plugins in some official manner. |
|
|
|
|
|
|
#22 |
|
Apple Fanboy?
|
if you can fins such headers i shall post the on the knowledgebase for use by DSP programmers
__________________
Chris - The Aussie Super Mod
Hardwareheaven Rules - Sig Request Thread How you can help HardwareHeaven by using Digg! Hardwareheaven Super-Moderator |
|
|
|
|
|
#23 | ||
|
kX user
Join Date: Apr 2004
Posts: 851
Rep Power: 0 ![]() |
Quote:
Such a guide should be written.Quote:
__________________
Miss you, Steve... |
||
|
|
|
|
|
|
|
DriverHeaven Lover
Join Date: Feb 2004
Location: Latvia
Posts: 154
Rep Power: 0 ![]() |
Well, the solution is just as was expected. In order to be able to correctly build the SDK3537 demo I needed the VC98\MFC\INCLUDE and VC98\MFC\LIB directories from Visual C++ 6.0. These had to be added to Tools->Options->Projects->VC++ Directories BEFORE the atlmfc folder of VC 7.0, both for lib and include files. Apparently nothing else is needed, at least not for the demo. I'll keep updating this thread if I find any other problems/solutions. Hopefully I can start coding now
|
|
|
|
|
|
#25 |
|
kX user
Join Date: Apr 2004
Posts: 851
Rep Power: 0 ![]() |
Good job, Doomsayer. I'm glad you solve it.
I'm shure you won't have further problems, provided that you've compiled the demo succesfully. Have fun coding...
__________________
Miss you, Steve... |
|
|
|
|
|
#26 |
|
DriverHeaven Newbie
Join Date: Dec 2005
Posts: 1
Rep Power: 0 ![]() |
Actually, all you need to do is put the following line of code before your string conversion calls:
USES_CONVERSION; This macro defines all the necessary variables. That's it! Worked for me. -Hugh Jorgan |
|
|
|
![]() |
| Thread Tools | |
|
|