GoLand IDE debug where several .go files must be compiled? - goland

I have several .go files in a folder and functions can be referenced when I run them as "go run ." so all the .go files get compiled.
But I don't know how to do this inside the GoLand IDE. I'd especially like to be able to debug this code so running inside the GoLand IDE would be nice.
main2.go contains
func main2()
Which I can reference from main.go with
main2()
This works perfectly when run as "go run ." or "go run *.go" but "go run main.go" doesn't compile main2.go so the reference to main2() is not resolved and causes
./main.go:29:2: undefined: main2
And the GoLand IDE gets the same error when I try to run main.go. I guess I just don't know how to tell the GoLand IDE to compile all the .go files before linking and execution...
Any suggestions are very much appreciated!

You can compile these files by clicking on the directory name inside Project View and selecting Run > go build projectName. Or select Debug > go build projectName.

Related

issue with running javafx jar file

hope you all safe and well
I made a jar file like this, it's JavaFX jar, I putted the SDK inside the file
image of the files
also in the run, I made these arguments
#echo off
start "" java --module-path "javafx-sdk-15.0.1\lib" --add-modules javafx.controls,javafx.graphics,javafx.fxml -jar ShapeEditor.jar
exit
it works well on my computer, but when I moved it to another computer, cmd just appears and shutdown itself for no reason, I wish if someone could help me with it!.
this is my first ever JavaFX file, so I'm new to the whole concept
--udpdate:
i created the jar file by adding jar file to articats tab in intelJ as in here
, then went to build and built the jar file, added icons in the folder along with the fx SDK, and made a batch file to make run arguments as mentioned above, ran it and no problem, moved it to another windows 10 pc, ran it and a windows appears momentarily then shutdown

.jar file quickly opens, then closes

I am trying to make a FTB server that me and my friends can play on. So, I downloaded the .jar and it said "Choose what to open with. SO, I assigned java binary to what it is opened with. It then now opens, but then not less then a second later, closes. I tested with other .jar files. Each one of them either didn't open at all, or opened quickly, then closes. WHat could be wrong?
More than likely the jar (which is just a zip of the programs main classes) is running into an error and exiting.
In order to find and resolve that error you need to see the error message!
first locate the jar file in either your terminal or command prompt and run the following command
java -jar <YOUR_JAR_FILE_NAME>.jar
You will see any output sent from the java program to the console so you can diagnose and resolve it!
In your terminal, where your .jar file is located, type and run the following command :
java --enable-preview -jar <JAR FILE NAME>.jar
Most probably the .jar fill will open, or it will show you the error, which you can then resolve.

Running a python .py file on Jetbrain Pycharm

I write my .py files using Pycharm JetBrains editors. When I run my codes, the output is shown in a console entitled "Run", without any prompt. Therefore, I dont have access to the variables of my code output. How can I force the pycharm to show the output of my codes in ipython console?
You can edit the Run Configuration and check the box "Show command line afterwards". This will run your script, but leave you in an interactive prompt. Everything from your script will have been imported and available.
As a note, if you install the IPython package (Preferences -> Project -> Project Interpreter, click + to add packages) then you can get a nicer console interpreter.
Finally, a different way to accomplish what you are looking for: run under Debug rather than Run. You can set a breakpoint and then use the debugger's Console right at the line you might be interested in.

Can not call 'make clean' in cmd regarding qmake project

I'm reading Foundations of Qt Development - by Johan Thelin.
Here quote from page 450 about Building QMake Project.
If you choose to create a Makefile using QMake, you can build your project using a simple make command (or nmake if you’re using Visual Studio). You can clean up your intermediate files using make clean. The slightly more brutal step is to run make distclean, which cleans up all generated files, including the Makefile. You will have to run QMake again to get a Makefile for make.
I tried hard to clean the files using 'make clean'. But cmd displaying the message 'make' is not recognized as an internal or external command, operable program or batch file.
I searched here and tried to find the PATH to make inside Qt directory. But not successful. Then according to this solution I tried to use mingw32-make also. But same results.
Anyone of you can help me?
If you using mingw32, try mingw32-make clean. Remember, you must add mingw's bin directory to User Enviroment to use this command. Follow "My Computer" > "Properties" > "Advanced" > "Environment Variables" > "Path" and add ;C:\Qt\Tools\mingw492_32\bin
OR
use command: setx PATH %PATH%;C:\Qt\Tools\mingw492_32\bin

Pyinstaller executable not running

I made a small application using Python and Tkinter and I then tried to convert it into an executable file using Pyinstaller.
Pyinstaller creates the executable in the folder 'dist' as expected but when I double click on the file it will not run. Can you please help me find out what I am missing?
When this happens to me.. I use the process of elimination to discover the cause.
Simply remove modules from your code until the program execution actually begins. You can detect if you code is running by putting a dbgview output statement at the top of your code. Once your code execution works... you'll know what module or section of code is the root of the problem with regard to pyinstaller.

Resources