Build chaincode(hyperledger) on Atom on Windows fail - go

I'm trying to build simple chaincode example in Atom editor on Windows but build fails (I'm using go-plus package) with following error:
fatal error: ltdl.h: No such file or directory #include ltdl.h
I know that using flag: -tags nopkcs11 will solve the problem, but how can i configure go-plus/Atom to use this flag?

I believe there is still an open issue for go-plus to support build tags. I have not used Atom in a while, but the only option I can think of would be to try to use a Makefile (which is not the easiest thing in the world on Windows since most of the built-in Atom commands assume GNU commands being available).
If you are open to moving to something like Visual Studio Code it does support build tags.
Perhaps we should actually reverse the build tag within Fabric and require you to enabled pkcs11 with a tag rather than disable it with a tag. I debated this when first adding the tag. Feel free to open up a JIRA item for this.

Related

gorename failing in VS Code without explicit error

In VSCode, I am trying to rename a variable using F2. This seems to run the gorename tool, but fails every time without explicit error. It simply displays:
/home/oops/dev/mtg-tracker/mtg-tracker-server/handlers>Finished running tool: /home/oops/dev/go/bin/golint
/home/oops/dev/mtg-tracker/mtg-tracker-server/handlers>Finished running tool: /usr/local/go/bin/go build -i -o /tmp/vscode-goVw9yJs/go-code-check .
/home/oops/dev/mtg-tracker/mtg-tracker-server/handlers>Finished running tool: /usr/local/go/bin/go vet ./...
Rename failed
I've looked into similar issues and it seems to normally come with an error such as an invalid GOROOT or incorrect package naming, but I see no such error here and I haven't been able to find any further info.
I also saw that someone fixed this by updating gorename, which I tried looking into but have not been able to figure out how to do.
Expected result: VSCode actually renames my variable.
Actual result: The rename fails and it stays the same.
Note there is an issue 24661 dedicated to follow the tools and their updates, for command-line or VSCode usage.
That issue just included:
gorename will no longer be supported as gopls already implemented renaming functionality.
See issue 27571, which refers to issue 32875.
In the meantime, pending full support of gorename, I am using saibing/tools which does produced an "extended" version of gopls, with rename support.
And which is working just fine in VSCode.
Update Q4 2019 (Nov.): issue 32875 is now closed, gopls has released a 0.2.0 and those errors should be fixed.
A full rename support is still there: CL 194878
Remains CL 207579: This change adds command line support for prepare_rename.
Update Sept. 2020:
As commented and in CL 255053 (for go bundle), a lot of the tools in this list have been replaced by gopls as well.

Building Erlang projects on Windows

I'm looking for a way to build an Erlang project on Windows. I have Erlang installed and all project files, including makefile, cloned from GitHub. I would like to build the project as if I was using make command on Linux and run it. What tools can I use to do that?
I'd try cygwin. https://www.cygwin.com
http://erlang.org/doc/installation_guide/INSTALL-WIN32.html
You can either build erlang with cygwin or use gnu-make in combination with a native windows build of erlang
If you're asking "how do I run make in Windows?" then you can use Cygwin, the newly-available Bash shell, or the MinGW tools. These will all give you some level of ability to run make, though not every makefile will work.
If you're asking "how can I build an Erlang project using a makefile?" then you are looking for erlang.mk. Note that Rebar3 (which is configured with Erlang terms and looks nothing like a make system) was recently selected as the "official" build tool, but erlang.mk is quite popular and is well-maintained.

automatic reload sketches in processing

I'd like to be more efficient with processing programming, is there a way to run a sketch from the command line? maybe also with a watch for file saves?
Also, is there some autocompletion for processing? the default IDE is very limited..
Windows and Linux
Pretty much the same when you want to run the sketch from the command line.
Within your processing folder there should be a processing-java file. If you cd to it's folder, you can use
./processing-java --help
Which will show you the required parameters to running, compiling and whatnot.
If you are in a hurry, this would do (replace the $parameters with the folders you want or automate it with your editor):
$PROCESSING_DIR/processing-java --sketch=$CURRENT_DOCUMENT_DIR --output=$CURRENT_DOCUMENT_DIR/run --run --force
This is my Gedit script:
/home/otto/GameDev/processing-2.1/processing-java --sketch=$GEDIT_CURRENT_DOCUMENT_DIR --output=$GEDIT_CURRENT_DOCUMENT_DIR/run --run --force
MacOSX
Haven't had a chance to test it but it shouldn't be any harder.
Source: http://wiki.processing.org/w/Command_Line
As #erisoco mentions, using the Eclipse IDE is your best bet (especially for autocomplete/etc.) and the Proclipsing plugin makes it very easy to setup Processing projects in eclipse (including integration with external libraries)
There's also a quick video tutorial on setup if necessary.
You mentioned "watch for file saves" - that sounds along the lines of "live coding".
There are multiple options. One I've used in the past is through the FluidForms library. The library also includes some handy features for (3D) design (like parameter changer, automatic arcball for 3D scenes, STL export, etc.)
You can find a few quick video tutorials on live coding Processing with Fluid Forms libs:
Fluid-Forms-Libs ~ HelloWorld
Fluid Forms Libs Parameter Changer
FluidFormsLibs-LiveCoding
This is the command I use:
> processing-java --sketch=R:\sketch_folder --force --run
I do the coding using Visual Studio Code https://code.visualstudio.com/ with the processing extension.

Code::blocks verbose build

I want to see the actual commands sent to g++ during a Code::Blocks build. I want to see exactly what command-line arguments it uses in the compile and link steps, and I don't want to have to poke around in the build settings GUI to do it.
Alternatively, converting the Code::Blocks project to an equivalent Makefile would work, but I see nowhere where I can do that, either...
Edit
I ended up using a Code::Blocks plugin, "cbMakeGen", to generate a makefile from which I removed some #s. Then I was able to see the commands. Surely there is an easier way...
I see you already solved the problem, but there's still a bit more to that.
Code::Blocks can write a build log when the following option is checked:
Settings->Compiler and debugger->Global compiler settings->{slide tabs to the right}->Build options tab->Save build log to HTML.
Besides, you can use "cbp2make" to convert Code::Blocks projects to makefiles. This is not a plugin like "cbMakeGen", but a stand-alone command-line tool. See also http://forums.codeblocks.org/index.php/topic,13675.0.html .
Besides the logging to html you can also go to
Settings->Compiler and debugger->Global compiler settings->{slide tabs to the right}->Other Settings and in that tab set 'Compiler Logging:' to 'full command line' (from drop down menu).
Now you can see the gcc command line in the console when you build.

Configuring Bison to compile an input file under Visual C 6

I'm trying to get Bison to do it's thing in VC6. I'm sure this must be a problem with my configuration. At the moment I have a Custom Build step as follows.
<Commands>
echo Start parser generation
"C:\GnuWin32\bin\bison.exe" $(InputPath)
echo Finish parser generation
<Outputs>
$(ProjDir)\$(InputName).c
$(ProjDir)\$(InputName).h
The error I get is "C:\GnuWin32\bin\bison.exe: m4: No such file or directory", which makes me think the m4.exe doesn't exist or isn't on the path, but I can run the exact same command from CMD in the same directory with no errors.
This thought process makes me think it's a problem with the output options, but I've tried various configurations with no luck.
Any help would be great, thanks in advance.
Edit: I've added some more visual studio versions to the tag list to try to get some more exposure for the question. Hopefully someone will have done this in a later version and I can work backwards.
Okay, I've managed to slove this in a very round-about way but I will try my best to document it here.
It seems that VC6 Custom build options will only look in the project directory for the m4.exe, even when you specify where the calling exe (bison) is explicitly. To solve this I did a bit of a hack and did a full cd command in the custom build window to get to the gnuwin32 directory (where both bison and m4 live) before trying to call the parser generator.
This works fine but is a bit of a hassle for trying to distribute it to other people when they may have installed GNU tools to a different location.

Resources