fbpx
Welcome, Guest
Username: Password: Remember me
  • Page:
  • 1

TOPIC: Why this error, from a simple test function?

Why this error, from a simple test function? 1 year 9 months ago #2575

  xnetExplorer's Avatar Topic Author xnetExplorer Offline Posts: 14
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)

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#.

Please Log in or Create an account to join the conversation.

Why this error, from a simple test function? 1 year 9 months ago #2576

  Chris's Avatar Chris Offline Posts: 1181
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 Assemblies\Microsoft\Framework\.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.
XSharp Development Team
chris(at)xsharp.eu

Please Log in or Create an account to join the conversation.

Why this error, from a simple test function? 1 year 9 months ago #2577

  wriedmann's Avatar wriedmann Away Posts: 1573
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
This email address is being protected from spambots. You need JavaScript enabled to view it.
www.riedmann.it - docs.xsharp.it

Please Log in or Create an account to join the conversation.

Why this error, from a simple test function? 1 year 9 months ago #2594

  xnetExplorer's Avatar Topic Author xnetExplorer Offline Posts: 14
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:
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)

Please Log in or Create an account to join the conversation.

Last edit: by xnetExplorer.

Why this error, from a simple test function? 1 year 9 months ago #2595

  wriedmann's Avatar wriedmann Away Posts: 1573
Hi Dan,

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

If you write
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
This email address is being protected from spambots. You need JavaScript enabled to view it.
www.riedmann.it - docs.xsharp.it

Please Log in or Create an account to join the conversation.

Last edit: by wriedmann.

Why this error, from a simple test function? 1 year 9 months ago #2596

  robert's Avatar robert Offline Posts: 1004
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
This email address is being protected from spambots. You need JavaScript enabled to view it.

Please Log in or Create an account to join the conversation.

Last edit: by robert.

Why this error, from a simple test function? 1 year 9 months ago #2603

  xnetExplorer's Avatar Topic Author xnetExplorer Offline Posts: 14
Got it, thanks W.R. and Robert.

Please Log in or Create an account to join the conversation.

Why this error, from a simple test function? 1 year 9 months ago #2620

  xnetExplorer's Avatar Topic Author xnetExplorer Offline Posts: 14
Hi Chris,

The .net versions are 3.5 and 4.0.

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

www.xsharp.info/itm-downloads?folder=general%252FSetups

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


Regards,

DC

Please Log in or Create an account to join the conversation.

Why this error, from a simple test function? 1 year 9 months ago #2622

  Chris's Avatar Chris Offline Posts: 1181
Hi Dan,

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

www.microsoft.com/en-us/download/details.aspx?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 ( www.xsharp.info/store ). But the public version is just fine for your first steps/tests in X#.

Chris
XSharp Development Team
chris(at)xsharp.eu

Please Log in or Create an account to join the conversation.

Why this error, from a simple test function? 1 year 9 months ago #2623

  xnetExplorer's Avatar Topic Author xnetExplorer Offline Posts: 14
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.

Please Log in or Create an account to join the conversation.

  • Page:
  • 1