View Full Version : Error C8101 after upgrade from 7.04 to 8.0
timelox
10-29-2002, 01:39 AM
After upgrgading from 7.04 to 8.0 I can't compile my script (created using Dev 7).
This is the error I get:
...: error C8101: 'Sleep' : must specify DLL for this function
Before upgrading to 8.0 this script worked fine. The function Sleep is defined at the top of the setup.rul and I don't understand why this suddenly does not work. Sleep is defined like this:
prototype stdcall void kernel32.Sleep(BYVAL LONG);
The strange thing is that GetShortPathName defined like this:
prototype stdcall long kernel32.GetShortPathName(BYVAL STRING, BYREF STRING, BYVAL LONG);
...is also used in the script but the compiler only complains about Sleep(). Why? What is happening?
IS guaranteed that migrating from 7.0 to 8.0 would always work...apparently not :(
It seems that the word "Sleep" cannot be defined as a function name...strange
Art Middlekauff
10-29-2002, 06:21 AM
The migration guarantee is described here:
http://www.installshield.com/isd/info/migration.asp
The guarantee promises free support if you have a migration problem. Please select the "Migration Support Request Form" button.
timelox
10-29-2002, 06:40 AM
Yes I know...have posted a request. Just wanted others to know about it too.
JonArme
10-29-2002, 03:28 PM
The reason that you are receiving this error is because the Sleep function is already prototyped in Developer\Script\Include\Winapi.h.
In 8.0, modifications were made to the InstallScript compiler to handle redefinition situations.
prototype Kernel32.Sleep(NUMBER) is defined in winapi.h, and thus is included when you #include "ifx.h".
So, all you need to do is comment out your prototype statement at the beginning of your setup.rul file. You can then just call Sleep() in your script, since it has already been defined in the product.
timelox
10-30-2002, 01:54 AM
Yes it worked after I removed the prototype. If the compile error would whine about a redefinition I would have corrected this problem myself. Looks like the compiler still needs some tweeking...
ron100
11-20-2002, 03:18 PM
I have a similar problem when converting from 7.04 to 8.0 Eval. The dll causing the error is WritePrivateProfileStringA. When I comment out the prototype, however, the line of code that calls WritePrivateProfileStringA fails with an 8038 error (numeric value expected). This suggests that the function is no longer recognized. Does anyone have an idea why this occurs?
David Thornley
11-21-2002, 11:43 AM
I would think that 'numeric value expected' would mean that you either have a numeric constant where a numeric variable is definer or you have a string variable where a numeric variable is defined. Perhaps if you posted the line of code that is failing some else might be able to try and compile it to see what the error is.
ron100
11-21-2002, 02:02 PM
Sorry David, I was a bit brain dead last night when I made that post. Here is an exact recipe for duplicating the problem:
1. Create a new MSI script project in ISD 8
2. Add the following protoype:
prototype LONG kernel32.WritePrivateProfileStringA(BYVAL STRING, BYVAL STRING, BYVAL STRING, BYVAL STRING);
3. Declare the following variable:
LONG lResult
4. Add the following line of code to OnFirstUIBefore:
lResult = WritePrivateProfileStringA("","", "","M2MWin.ini");
When compiling, you will see the following error:
Compiling...
Setup.Rul
E:\DotNet IS Setups\TestWriteProfString\Setup.Rul(63) : error C8101: 'WritePrivateProfileStringA' : must specify DLL for this function
5. Comment out the prototype listed in step 2 above, and compile.
You will then see the following error:
Compiling...
Setup.Rul
E:\DotNet IS Setups\TestWriteProfString\Setup.Rul(63) : error C8038: '' : numeric value required
E:\DotNet IS Setups\TestWriteProfString\Setup.Rul(63) : error C8038: '' : numeric value required
Setup.inx - 2 error(s), 0 warning(s)
ISDEV : error -4370: There were errors compiling InstallScript
Hopefully this is a little more helpful.
JonArme
11-21-2002, 04:24 PM
WritePrivateProfileStringA is defined in winapi.h with a function signature of the following:
prototype KERNEL32.WritePrivateProfileStringA(BYVAL STRING, POINTER, POINTER, BYVAL STRING);
You should just use WritePrivateProfileString (without the 'A').
This is already predefined in winapi.h as
prototype KERNEL32.WritePrivateProfileString(BYVAL STRING, BYVAL STRING, BYVAL STRINg, BYVAL STRING);
Just drop the 'A' from your function calls in your script and you should be fine.
ron100
11-22-2002, 08:47 AM
Thanks Jon, your solution works fine. I'm still baffled about how this compiled in ISD 7, but I'll let that remain a mystery.
Powered by vBulletin® Version 4.2.0 Copyright © 2013 vBulletin Solutions, Inc. All rights reserved.