Calling compiler from external editor

Questions about MultiCharts and user contributed studies.
Squib
Posts: 17
Joined: 25 Nov 2011
Has thanked: 19 times
Been thanked: 6 times

Calling compiler from external editor

Postby Squib » 01 Dec 2011

Hi,

is it possible to call the MC-compiler from an external editor and if yes, which exe needs to be used?

Thanks!

User avatar
Henry MultiСharts
Posts: 9165
Joined: 25 Aug 2011
Has thanked: 1264 times
Been thanked: 2957 times

Re: Calling compiler from external editor

Postby Henry MultiСharts » 02 Dec 2011

Hi,

is it possible to call the MC-compiler from an external editor and if yes, which exe needs to be used?

Thanks!
Please describe what you are trying to do and what is your final goal.

User avatar
JoshM
Posts: 2195
Joined: 20 May 2011
Location: The Netherlands
Has thanked: 1544 times
Been thanked: 1565 times
Contact:

Re: Calling compiler from external editor

Postby JoshM » 02 Dec 2011

is it possible to call the MC-compiler from an external editor and if yes, which exe needs to be used?
You mean for debugging purposes Squib? As far as I know, that's not possible. There's a project management feature request for a debugger: debugging (please vote for it if haven't already done so).

From what I noticed when compiling, the MC-compiler itselfs calls "g++.exe" (in C:\Program Files\MultiCharts\make\MinGW\bin). But I'm definitely not suggesting you can connect an IDE to that process (if it's even the correct process). If you do know a way, please enlighten us.

Regards,
Josh

Squib
Posts: 17
Joined: 25 Nov 2011
Has thanked: 19 times
Been thanked: 6 times

Re: Calling compiler from external editor

Postby Squib » 02 Dec 2011

Hi,
Please describe what you are trying to do and what is your final goal.
Hi,

I want to use UltraeditStudio as an alternative editor. It is more comfortable then the built in MC editor. Final goal would be to be able to compile my studies out of UE.
I can configure this editor in a way, that it can call external compilers, but I don't know, if the MC compiler works more or less "stand-alone".

Is there a way to do this, or should I better stop spending energy in this approach?

Regards!

Squib
Posts: 17
Joined: 25 Nov 2011
Has thanked: 19 times
Been thanked: 6 times

Re: Calling compiler from external editor

Postby Squib » 02 Dec 2011

is it possible to call the MC-compiler from an external editor and if yes, which exe needs to be used?
You mean for debugging purposes Squib?
No, not for debugging. Just for writing and compiling code.

User avatar
Henry MultiСharts
Posts: 9165
Joined: 25 Aug 2011
Has thanked: 1264 times
Been thanked: 2957 times

Re: Calling compiler from external editor

Postby Henry MultiСharts » 06 Dec 2011

Hi,
Please describe what you are trying to do and what is your final goal.
Hi,

I want to use UltraeditStudio as an alternative editor. It is more comfortable then the built in MC editor. Final goal would be to be able to compile my studies out of UE.
I can configure this editor in a way, that it can call external compilers, but I don't know, if the MC compiler works more or less "stand-alone".

Is there a way to do this, or should I better stop spending energy in this approach?

Regards!
Unfortunately that is not possible.
There is no external compiler in MultiCharts.

biffhero
Posts: 47
Joined: 22 Sep 2020
Has thanked: 29 times
Been thanked: 7 times

Re: Calling compiler from external editor

Postby biffhero » 22 Sep 2020

I agree that this would be nice. My goal is to type my scripts in emacs, and I'm sure a lot of people would prefer to use Visual Studio Code, even for the MC that is _not_ for .NET.

I just poked around a little bit in C:\Program Files\TS Support\MultiCharts64\ , and I did _not_ see a Makefile. I was hoping that there would be a Makefile there and this would be as easy to work with as arduino. But it is not. I think I'll continue to mash the F3 key in the editor a little longer.

My only next hope is an autohotkey script. ;-)

User avatar
JoshM
Posts: 2195
Joined: 20 May 2011
Location: The Netherlands
Has thanked: 1544 times
Been thanked: 1565 times
Contact:

Re: Calling compiler from external editor

Postby JoshM » 23 Sep 2020

It would for sure be nice to write MultiCharts PowerLanguage code in a different editor.

I don't know the answer, but perhaps you can make progress with what I know:

When you compile in the PowerLanguage Editor, MultiCharts's `StudyServer.exe` process calls `g++.exe`, which in turn executes `cc1plus.exe` do to the actual compilation. There's also a `conhost.exe` process launched, but I think it's a side process from `g++.exe`.

`StudyServer.exe` is a process that's located in C:\Program Files\MultiCharts\StudyServer.exe (on my computer).

`g++.exe` is located in C:\Program Files\MultiCharts\make\MinGW64\bin\g++.exe (again my computer).

And `cc1plus.exe` is located in c:\Program Files\MultiCharts\make\MinGW64\bin\..\libexec\gcc\x86_64-w64-mingw32\4.6.1\cc1plus.exe.

If you ever figure it out, please share. :)

biffhero
Posts: 47
Joined: 22 Sep 2020
Has thanked: 29 times
Been thanked: 7 times

Re: Calling compiler from external editor

Postby biffhero » 24 Sep 2020

@JoshM,

The more I look into this, the more difficult I think it will be. There is signaling going on behind the scenes between the editor as shipped with MC and the main MC process. I think there might be good value in running the editor under a system-wide debugger, to see how the communication is taking place. However, I don't see any output of any text files, or anything like that. Therefore, I am currently presuming that the editor is taking the .o files from gcc and talking to the window-equivalent of a named pipe and feeding the binary file in that way.

I think the most bang for the buck will be to write some python that copies the code from our preferred editor and pasting it into the default editor before hitting F3.

I wonder if this is something that autohotkey could do.

Rob


Return to “MultiCharts”