adabo

Scite + g++ properties and Build issues

23 posts in this topic

#1 ·  Posted

Hey. When I installed g++ from cygwin, scite immediately started building and running my c++ code. Very good so far.

However, I want to take it a step further. I want to make Scite + g++ portable. All of it in one folder to put on anyones computer without changing system variables like PATH. Just run scite > write code > F5 > Output in scite console.

Only problem is that I don't know how to do it :) I can get scite to see python and autohotkey, which is all portable without any system changes.

Any one have experience with scite and such things?

Share this post


Link to post
Share on other sites



#2 ·  Posted

1 hour ago, adabo said:

Only problem is that I don't know how to do it :)

What is the issue? 
cpp.properties contains all definitions for the programs to run for the Run/Compile/Build options, so thats a good place to start in case of issues.

Jos


Visit the SciTE4AutoIt3 Download page for the latest versions        Beta files                                                          Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites

#3 ·  Posted

I'm using Windows 10 14393 64 Bit

Oh, I don't have the cpp.properties file. I guess it doesn't come with single file executable scite.exe download. I see there is a full download. I'll try that out.

Ok, so I've looked at the cpp.properties file and found:

command.compile.$(file.patterns.cplusplus)=$(cc)
command.build.$(file.patterns.cplusplus)=$(make.command)
command.clean.$(file.patterns.cplusplus)=$(make.command) clean
command.go.$(file.patterns.cplusplus)=./$(FileName)
command.go.needs.$(file.patterns.cplusplus)=g++ $(ccopts) $(FileNameExt) -o $(FileName)

It looks the same as I've been using in my local scite.properties file.

command.go.*.cpp=./$(FileName)
command.go.needs.*.cpp=cygwin64\bin\g++.exe -pedantic -Os $(FileNameExt) -o $(FileName)

command.go.*.ahk=AutoHotkey\AutoHotkeyU64.exe $(FileName).$(FileExt)
command.go.*.py=python 32 bit\pythonw.exe -u $(FileName).$(FileExt)

The first thing you should know is that I don't have cygwin in the PATH variable. Scite will build the cpp file normally when I put cygwin back in PATH environment variable.

You might be asking "why am I removing the path?". The reason is because I'm trying to make a portable programming environment. Something you can put in  a USB drive and run on another windows machine that doesn't have anything installed (Python, cygwin/g++, AutoHotkey). For example, if I run Scite.exe from the usb, I want to write some c++ code and run it without any problems. Actually, it's working for python and ahk. But g++ is where I have problems.

The error from scite output window for running c++ code is:

>cygwin64\bin\g++.exe -pedantic -Os cppout.cpp -o cppout
C:/Users/adabo/Videos/Programming Tutorial/DownloadandSetup/cygwin64/lib/gcc/x86_64-pc-cygwin/5.4.0/cc1plus.exe: error while loading shared libraries: ?: cannot open shared object file: No such file or directory
>Exit code: 1

I hope this all makes sense. I know what I'm doing is probably unconventional and not recommended. I just want to make it work if it's possible.

Share this post


Link to post
Share on other sites

#4 ·  Posted

1 minute ago, adabo said:

I hope this all makes sense.

It does. It is indeed much better to use the Full version as a base as that contains all the Scitilla lexers.
So to make it portable and default to the drive SciTE is ran from you simply add the $(SciteDefaultHome) to the path for g++.exe.

I've done the same for AutoIt3:

command.compile.$(au3)="$(SciteDefaultHome)\..\AutoIt3.exe" "$(SciteDefaultHome)\AutoIt3Wrapper\AutoIt3Wrapper.au3" /ShowGui /prod /in "$(FilePath)"

Let me know when you need more info, but then supplu the directory structure for SciTE and cygwin64 so I can help making the proper syntaxline for the properties file.

Jos


Visit the SciTE4AutoIt3 Download page for the latest versions        Beta files                                                          Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites

#5 ·  Posted

11 minutes ago, Jos said:

Let me know when you need more info, but then supplu the directory structure for SciTE and cygwin64 so I can help making the proper syntaxline for the properties file.
 

Jos

Wow. This is like hitting the jackpot! I'm so glad somebody understand what I'm trying to accomplish here.

So from what I understand is I need to do this:

command.go.needs.*.cpp=$(SciteDefaultHome)\cygwin64\bin\g++.exe -pedantic -Os $(FileNameExt) -o $(FileName)

Because scite.exe sits in the parent folder holding cygwin64. When I tried I still get the exact same error.

I'm going to be on the road for a while, so I'll check back again when I get home. Thank you very much for your efforts :)

Share this post


Link to post
Share on other sites

#6 ·  Posted

So, is the shown directory in the SciTE outputpane still incorrect?

Could be you need to add doublequotes around all files to avoid CMD getting confused:

command.go.needs.*.cpp="$(SciteDefaultHome)\cygwin64\bin\g++.exe" -pedantic -Os "$(FileNameExt)" -o "$(FileName)"

Jos


Visit the SciTE4AutoIt3 Download page for the latest versions        Beta files                                                          Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites

#7 ·  Posted

Looks like the output pane is still incorrect

>"C:\Users\adabo\Videos\Programming Tutorial\DownloadandSetup\cygwin64\bin\g++.exe" -pedantic -Os "cppout.cpp" -o "cppout"
C:/Users/adabo/Videos/Programming Tutorial/DownloadandSetup/cygwin64/lib/gcc/x86_64-pc-cygwin/5.4.0/cc1plus.exe: error while loading shared libraries: ?: cannot open shared object file: No such file or directory

There's only 2 lines in that code. The second one is just very long. But I think it's the same. If I remove the command.go from the properties the output looks like this:

>g++ -pedantic -Os cppout.cpp -o cppout
'g++' is not recognized as an internal or external command,
operable program or batch file.

 

Share this post


Link to post
Share on other sites

#8 ·  Posted

Looks like the g++ compiler is started fine as far as I can see.... right?
I have no experience with making cygwin portable, so that is the next thing to look for on the Internet as I am sure you aren't the first one to try.

Jos


Visit the SciTE4AutoIt3 Download page for the latest versions        Beta files                                                          Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites

#9 ·  Posted

15 minutes ago, Jos said:

Looks like the g++ compiler is started fine as far as I can see.... right?
I have no experience with making cygwin portable, so that is the next thing to look for on the Internet as I am sure you aren't the first one to try.

Jos

That's exactly what I was thinking while I was out driving. Surely somebody's had some success. And, yes, the it looks like the compiler is starting.

Share this post


Link to post
Share on other sites

#10 ·  Posted

I have done something similar for another compiler and made life easy by using a batch file and ensuring that the workdir was set correctly as that compiler needed it.
SciTE leaves the workdir to the Sourcefile being edited, so that could cause this. In case you proceed this way you need to use the fully qualified name for the input source file so use  "$(FilePath)" in stead of  "$(FileNameExt)"

Jos


Visit the SciTE4AutoIt3 Download page for the latest versions        Beta files                                                          Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites

#11 ·  Posted

Have some interesting results.

With `"$(FilePath)"` the output is the same except it prints the full path starting from c:\. Which is fine. Which makes me think that the path isn't the problme

So I tried removing the double quotes `$(FilePath)` and the output changed:

>c:\cygwin64\bin\g++.exe -pedantic -Os C:\Users\adabo\Videos\Programming Tutorial\DownloadandSetup\cppout.cpp -o "cppout"
g++: error: C:\Users\adabo\Videos\Programming: No such file or directory
g++: error: Tutorial\DownloadandSetup\cppout.cpp: No such file or directory
g++: fatal error: no input files
compilation terminated.

You can see it thinks I put two paths. When in fact it's one path split up at the space in `\Programming Tutorial`. The next discovery is that g++ is giving the error. Whereas before it was `cc1plus.exe` with the error. That leads me to believe that g++.exe is working, and that whatever g++ needs to compile gets stopped for whatever reason.

My first search for "portable cygwin" had promising results. One is a git repo with instructions. But it wants to lock it to the USB drive. The other result was this. I haven't finished reading, but so far it sounds like it's what I want, because I want to make this "toolbox of goodies" something I can share and people can save it to whichever directory they want and it should just work.

Share this post


Link to post
Share on other sites

#12 ·  Posted

2 minutes ago, adabo said:

You can see it thinks I put two paths.

That is why I mentioned to put doube qoutes around the paths!

Jos


Visit the SciTE4AutoIt3 Download page for the latest versions        Beta files                                                          Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites

#13 ·  Posted

Yes, and of course I will make this a habit from now on ;)

The second link wants to change some environment variables. I don't want that. In fact, if that is the only way g++ will work, then I need to find an alternative compiler.

Can you think of a portable c++ compiler I can throw in my little box of goodies?

This is the "toolbox" I'm trying to build: (Sorry. I couldn't inline the image for some reason) The folder named "DownloandSetup" will be what I will zip and share with students. Thankfully the license agreement allows this. Plus I'm not a business, just a volunteer.

explorer_2017-03-28_13-45-43.png

Share this post


Link to post
Share on other sites

#14 ·  Posted

adabo,

So just to be clear - you are asking for help on the AutoIt forum to package AHK? Good job we are open-minded here!

M23


Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind._______My UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Share this post


Link to post
Share on other sites

#15 ·  Posted

I had seen that too, and it is even worse, there is no AutoIt3 on that ThumbDrive,  but we're in the general Developers forum so let that slide as not everybody is aware about the past of these 2 products. :)

Jos


Visit the SciTE4AutoIt3 Download page for the latest versions        Beta files                                                          Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites

#16 ·  Posted

Just now, Melba23 said:

adabo,

So just to be clear - you are asking for help on the AutoIt forum to package AHK? Good job we are open-minded here!

M23

Not at all. Hmm, the post is about g++ and scite. I understand this is autoit, but since you mentioned it: When I was searching google for help with scite, I couldn't find a forum. Not even IRC. The only forum that showed up in relation to scite was this forum. So I looked through the different sub forums for one suitable for this off topic situation. And now here I am. Does this help? If I'm missing a joke here, sarcasm is kind of hard to detect through text. But I understand it now if it is  ;)

Share this post


Link to post
Share on other sites

#17 ·  Posted

Wait a second, are you the same melba form #ahk on freenode? There was someone named melba that would come in all the time. This was a few years ago, but I clearly remember.

Share this post


Link to post
Share on other sites

#18 ·  Posted

adabo,

Most certainly not.

M23


Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind._______My UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Share this post


Link to post
Share on other sites

#19 ·  Posted

11 minutes ago, adabo said:

The second link wants to change some environment variables. I don't want that. In fact, if that is the only way g++ will work, then I need to find an alternative compiler.

I honestly don't see any issue with this blog and is more or less like I mentioned in one of the previous posts. 
The Blog explains how to set some Enviroment variable temporarily, and then puts everything back as it was. Actually simple setting some environment variables in a batch file which is shelled by SciTE wouldn't make any permanent changes anyways. So why not give that a try?

Jos


Visit the SciTE4AutoIt3 Download page for the latest versions        Beta files                                                          Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites

#20 ·  Posted

Ok, I can try. I had no idea it was temporary. I can be flexible. It's all a bit over my head, really. Which is why I'm here of course. I have next to no experience with batch script.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now