Why this error, from a simple test function?

This forum is meant for questions and discussions about the X# language and tools
Post Reply
xnetExplorer
Posts: 41
Joined: Thu Dec 31, 2015 5:28 pm
Location: USA

Why this error, from a simple test function?

Post by xnetExplorer »

Hi,

First trial, of XSharp and XIDE.

I'm getting a compiler error

Compiler has returned exit code -532462766

Unhandled Exception: System.MissingMethodException: Method not found: '!!0[] System.Array.Empty()'.
at LanguageService.CodeAnalysis.XSharp.CommandLine.Program.Main(String[] args)

Code: Select all

FUNCTION Test AS VOID

VAR s_Test := "Test"
? today
 
 
RETURN

I took out a Compiler dialect parameter

/dialect: Harbour

, and left it at the default, which I assume is X#.
User avatar
Chris
Posts: 4562
Joined: Thu Oct 08, 2015 7:48 am
Location: Greece

Why this error, from a simple test function?

Post by Chris »

Hi Dan,

It looks like a .Net version problem, the compiler tries to use something that's not available in the system dlls of your machine. Please check this folder:

C:Program Files (x86)Reference AssembliesMicrosoftFramework.NETFramework

It should list all the .Net versions of your machine, please tell us that list.

Chris

ps. for using the Today() function, you will need to include the parentheses as well.
Chris Pyrgas

XSharp Development Team test
chris(at)xsharp.eu
User avatar
wriedmann
Posts: 3644
Joined: Mon Nov 02, 2015 5:07 pm
Location: Italy

Why this error, from a simple test function?

Post by wriedmann »

Hi Chris, hi Dan,

I have seen such an error (only at runtime, not from the compiler) only two times:
- one time on a Windows XP machine
- the other time on a Windows 8 machine (not 8.1)

So I suspect there is effectively an outdated .NET Framework version on the machine.

What ist the OS version?

Wolfgang
Wolfgang Riedmann
Meran, South Tyrol, Italy
wolfgang@riedmann.it
https://www.riedmann.it - https://docs.xsharp.it
xnetExplorer
Posts: 41
Joined: Thu Dec 31, 2015 5:28 pm
Location: USA

Why this error, from a simple test function?

Post by xnetExplorer »

Hi Chris and Wolfgang,

Ok, I'll check that PC on Tuesday. It's Windows 7 Pro.

I just tried the following code, on a Windows 8.1 laptop:

Code: Select all

FUNCTION test AS VOID
	VAR s_Test := "Test"
	? s_Test
	
	RETURN
(Note that the today variable, should have been s_Test)

, and received the following error:

error XS1558: 'Functions' does not have a suitable static Start method
Compilation failed (1 error)
User avatar
wriedmann
Posts: 3644
Joined: Mon Nov 02, 2015 5:07 pm
Location: Italy

Why this error, from a simple test function?

Post by wriedmann »

Hi Dan,

you need a Start() function as entry point in your application.

If you write

Code: Select all

FUNCTION Start AS VOID
	VAR s_Test := "Test"
	? s_Test
	
	RETURN
it works (at least on my machine) - compiles and runs.

Wolfgang
Wolfgang Riedmann
Meran, South Tyrol, Italy
wolfgang@riedmann.it
https://www.riedmann.it - https://docs.xsharp.it
User avatar
robert
Posts: 4225
Joined: Fri Aug 21, 2015 10:57 am
Location: Netherlands

Why this error, from a simple test function?

Post by robert »

Dan,
That message is not really a compiler error:

If you create a standalone Exe you must have a Start() function. If you compile to a DLL that is not needed.
In C# and C++ you would have to create a main() function.

Robert
XSharp Development Team
The Netherlands
robert@xsharp.eu
xnetExplorer
Posts: 41
Joined: Thu Dec 31, 2015 5:28 pm
Location: USA

Why this error, from a simple test function?

Post by xnetExplorer »

Got it, thanks W.R. and Robert.
xnetExplorer
Posts: 41
Joined: Thu Dec 31, 2015 5:28 pm
Location: USA

Why this error, from a simple test function?

Post by xnetExplorer »

Hi Chris,

The .net versions are 3.5 and 4.0.

By the way, where are the new XSharp versions? The one at

https://www.xsharp.eu/itm-downloads?fol ... 252FSetups

is from July 10th. That's the one that I have.


Regards,

DC
User avatar
Chris
Posts: 4562
Joined: Thu Oct 08, 2015 7:48 am
Location: Greece

Why this error, from a simple test function?

Post by Chris »

Hi Dan,

OK, that's the problem, you need to install a newer .Net Framework version, at least 4.6.1:

https://www.microsoft.com/en-us/downloa ... x?id=49982

Maybe we should add a check in the compiler to show an error message when there's an old version installed only.

About X# versions, the one you have is the latest public version, newer ones are released to FOX subscribers (https://www.xsharp.eu/store). But the public version is just fine for your first steps/tests in X#.

Chris
Chris Pyrgas

XSharp Development Team test
chris(at)xsharp.eu
xnetExplorer
Posts: 41
Joined: Thu Dec 31, 2015 5:28 pm
Location: USA

Why this error, from a simple test function?

Post by xnetExplorer »

Ok, thanks. I'm actually a subscriber as of this morning, but it's just taking a while for the payment to be processed.

Thanks Chris, will download the newer .net version.
Post Reply