View Full Version : iPlug: Problem compiling the example-plugin
tonhelm
09-15-2009, 02:08 AM
Hi, just started to get into iPlug. I compiled the LICE and the IPLUG stuff.
I've also downloaded the extra grafics, but I still get these errors:
IPlug.lib(IGraphicsWin.obj) : error LNK2019: Verweis auf nicht aufgelöstes externes Symbol ""class LICE_IBitmap * __cdecl LICE_LoadJPGFromResource(struct HINSTANCE__ *,int,class LICE_IBitmap *)" (?LICE_LoadJPGFromResource@@YAPAVLICE_IBitmap@@PAU HINSTANCE__@@HPAV1@@Z)" in Funktion ""protected: virtual class LICE_IBitmap * __thiscall IGraphicsWin::OSLoadBitmap(int,char const *)" (?OSLoadBitmap@IGraphicsWin@@MAEPAVLICE_IBitmap@@H PBD@Z)".
Debug/IPlugExample_DEBUG.dll : fatal error LNK1120: 1 nicht aufgelöste externe Verweise.
What am I doing wrong?
Can anybody help?
Thanks in advance
Tony
PS: I'm using Visual C++ Express.
Andrew J
09-15-2009, 04:57 AM
I had this one too. What you need to do is add lice_jpg.cpp and the jpeglib into the lice library build (under Source Files).
It should end up looking like this:
- lice
..+ External Dependencies
..+ Header Files
..+ Source Files
.....+ jpeglib
.....+ libpng
.....+ zlib
........lice.cpp
........lice_arc.cpp
........lice_bmp.cpp
........lice_ico.cpp
........lice_jpg.cpp
........lice_line.cpp
........lice_png.cpp
........lice_texgen.cpp
........lice_text.cpp
tonhelm
09-15-2009, 06:16 AM
Hi Andrew,
thank you very much for your quick help. LICE compiled OK. And the iPlug example compiles now without any errors or warnings. BUT when REAPER scans the new plug I get new errors (see attached pic).
Did you experience this too?
So, I'm one step further now but still not really there.
Andrew J
09-15-2009, 04:25 PM
Hi Andrew,
thank you very much for your quick help. LICE compiled OK. And the iPlug example compiles now without any errors or warnings. BUT when REAPER scans the new plug I get new errors (see attached pic).
Did you experience this too?
So, I'm one step further now but still not really there.
No, I haven't seen that one Tony and I don't really understand it. Hopefully someone else can help.
tonhelm
09-16-2009, 05:09 AM
Thank you anyway, Andrew!
After recompiling the lice-library and the iplug-library I get the same message again. I've also tried another VST-host in the meantime. But still no luck.
I think I'll try reinstalling VS C++ Express. Don't know if that helps, probably not. I'll report later.
Anyone?
schwa
09-16-2009, 05:14 AM
It looks like you are linking against a run-time library with some very strict debugging options set -- if you link against the release run-time you won't get the error, and probably if you remove some linker options you won't get it either.
There are some places in LICE where chars (1-byte values) intentionally wrap, which may be what is triggering the debug assert, though I'd like to know exactly where the error is triggered, to be sure.
I have seen this before, although I don't think it was in the IPlug code. It wasn't a wrapping thing. What happens is that the ctype functions (like tolower) take an int, if you accidentally use a char as a parameter and it is negative ( >0x7f ) then it gets turned into a negative integer, which inside the ctype function gets cast to an unsigned, and becomes a big positive number which fails the assertion.
I had a quick grep through the IPlug source and found one tolower which is being passed an char in VSTHosts.cpp - you could try fixing that and see if the warnings go away.
tonhelm
09-17-2009, 01:57 AM
thanks for your responses.
I didn't set any strict debugging options. But if I get you right there is something wrong on my rig. I'll try to compile the "again" sample from the vstsdk 2.4 later on today. I am at work now at cannot test atm. But I truly hope that this will give me the same error. then a fresh windows install should be the solution.
Tony
tonhelm
09-17-2009, 04:47 AM
hey cc,
I've tried your tip with fixing all TOLOWERs in the IPLUG-project. Sadly didn't help.
... though I'd like to know exactly where the error is triggered, to be sure.
How can I see, where this error's triggered? Excuse my dumb question, but I'm still a C++ amateur.
Here is what I did in the meantime:
-reinstalled a fresh VC++ Express
-compiled the AGAIN-sample from the vstsdk with success (no errors in Reaper and VSTHost)
-compiled the LICE and IPLUG libraries again
-compiled the example, which suprisingly is now 2.3 MB (before 1.8 MB)
-the assertion error shows up again in both hosts, but when I click IGNORE two times the example-plug works just fine
For coding I use an old intel celeron. could this cause the problem?
At least my OS is uptodate (WinXP 32 SP3). Just trying to narrow it down.
Maybe tomorrow I'll have the chance to try it on more contemporary system (Core2Duo).
Tony
I'm not sure if this is related, but I also got an error when running the example in REAPER. I got the error when I defined "NDEBUG" while doing a customized release build from the command line. When I don't define "NDEBUG" everything seems alright.
hey cc,
I've tried your tip with fixing all TOLOWERs in the IPLUG-project. Sadly didn't help.
How can I see, where this error's triggered? Excuse my dumb question, but I'm still a C++ amateur.
When the assertion window comes up don't click ignore, click the button that will launch the debugger (Retry in english).
Then look at the stack to see which which IPlug function was the one that called the function that gave the assertion. If that means nothing to you I can explain more :)
tonhelm
09-18-2009, 01:22 AM
When the assertion window comes up don't click ignore, click the button that will launch the debugger (Retry in english).
Then look at the stack to see which which IPlug function was the one that called the function that gave the assertion. If that means nothing to you I can explain more :)
CC, you're da man!
OK, when I click retry I get the following message, which just confuses me more. You know what it means?
Hmm, that shouldn't happen. What should happen is that Visual studio opens up to debug the program. I don't know why it isn't.
How did you try modifying the ToLower function? I would change it to something like:
if (cStr[i] > 0) {
cStr[i] = tolower(cStr[i]);
}
I just tried setting a breakpoint on that assertion, and the other place the check gets called from is Log.cpp - there is a tolower() and an isupper() - the isupper() called on the timezone string, so maybe on a non-english machine that might contain characters >0x7f (characters with accents / umlauts etc).
tonhelm
09-21-2009, 02:18 AM
Thank you cc.
in the meantime I've tried compiling the example on another machine.
Still the same message.
my system-language is german. So what you said about probably umlauts or something like that causing this sounds very likely to me.
I'll be out for the next few days but when I'm back I'll set my system-language to english and see what happens. I'll report back.
Thanks again for your replies and patience to help me solving this.
Tony
Soundbytes
02-16-2010, 02:30 PM
I 've just stumbled over the same issue. Checking the call stack I quickly found the cause of the error: It happens in the CurrentTime() function
in Log.cpp.
strftime(cTZ, 64, "%Z", pT);
int i, j, nZ = strlen(cTZ);
for (i = 0, j = 0; i < nZ; ++i) {
if (isupper(cTZ[i])) {
tz[j++] = cTZ[i];
}
}
I have a german windows version and the contents of the cTZ string is "Westeuropäische Normalzeit". The assertion is hit of course when the "ä" is checked.
BTW: Even if the function worked properly it would not produce a useful output since "WN" isn't a known time zone code. (CET or MEZ would be more correct for my part of the world)
regards
Andreas
I'm not sure if this is related, but I also got an error when running the example in REAPER. I got the error when I defined "NDEBUG" while doing a customized release build from the command line. When I don't define "NDEBUG" everything seems alright.
I have finally found the cause of this. There is this line in IPlugBase.cpp:
assert(sscanf(channelIOStr, "%d-%d", &nIn, &nOut) == 2);
In a debug build it checks whether sscanf() returns 2, and in a release build it should do sscanf() without checking anything. However, because assert() is wrapped around sscanf() the compiler completely ignores it with NDEBUG defined, so sscanf() is never executed.
You can easily fix this by replacing this one line with these two lines:
bool channelIOStrValid = sscanf(channelIOStr, "%d-%d", &nIn, &nOut) == 2;
assert(channelIOStrValid);
Now you can build IPlug with NDEBUG without errors. :)
vBulletin® v3.8.11, Copyright ©2000-2025, vBulletin Solutions Inc.