Goland IDE complains about builtin types - goland

I have a project which is intended to have completely own environment. That means:
The Go language compiler and tools are installed inside the project's folder (in .deps\go subfolder).
Similarly, the project has own GOPATH folder.
Also, this project uses the Go modules approach.
There is a special build.cmd file which sets GOROOT and GOPATH accordingly and builds the application. That cmd file works fine.
But, when I open the project in GoLand, it shows a lot of complains like "Unexported type usage" about all builtin types, such as string, bool, float64, etc.
This is a screenshot of how it looks like in GoLand
When I Ctrl-click on the type name I'm getting to the builtin.go file inside the custom GOROOT, but it is shown with a lot of "Invalid recursive type" errors:
The GOROOT and GOPATH settings in the Settings dialog are set accordingly (but there is another installation of the Go tools on the computer, if that does matter).
The question is: why GoLand produces those complains and what should I do to overcome them?

The problem is that the Go SDK is located inside the project so GoLand thinks that the user's files are inside. Excluding the .deps directory in Preferences | Project Structure should help.

Related

How to add an external library to QT?

I am trying to create a project assosiated with the SimConnect SDK.
I am new to QT, and in Visual Studio, I just had a SimConnect.h file, a .lib file, and a .dll file, and I managed to make it work. Now I am trying to create a C++ widget project, using the same SDK, but in QT.
I put the header file in my QT project's folder, where the other default code and header files are located, and then I went to the project and added them as existing files, as I read in Google. I'm having problems with the actual library.
I've been searching Google for a guide on how to add a library file to the project, I did some things I saw on the internet, like the LIBS line for example, but I probably did it wrong, even though it looked very simple.
I am not sure where to drop my dll/library files in the project directory, maybe the problem is I always put them in the wrong spot.
The furthest I got to, was an error message saying "Unresolved external symbol", and a red writing saying ".obj file not found" on every function I tried to use from the SimConnect functions, which probably means QT couldn't find my library/dll file.
I also tried to add the libraries from the "Add library" option in the project, but that didn't work too.
EDIT: it also warns "warning: LNK4272: library machine type 'X86' conflicts with target machine type 'x64'" maybe it has to do something with it.
(Posted on behalf of the OP).
Solved! My problem was my machine was set to 64bit, while the library was set to 32bit, so I downloaded the 32bit kit, and ran the project through that, and it worked!

Cannot find correct file called qtnetwork4.dll

Guys I've written app in qt and when trying to run it (double click on *.exe) I'm getting error that this application cannot start because qtnetwork4.dll isn't available. I've searched my drive and I found few files with this name (and copied one by one every time trying to run my app) but none of them seems to work. How can I solve it?
place into your *.exe - folder appropriate dll-s from %QT_PATH%\bin\
There is an app called Dependency Walker that will let you know what functions in qtnetwork4.dll are being used in your program. It can be found at the following:
http://www.dependencywalker.com/
All of the DLLs your program use will be from the same installation as the qmake.exe that is used to compile the program. If you are using Qt Creator you can see where the qmake.exe your using is located by going to:
tools->options->Qt4
Get the DLLs that are located at the path displayed here to make sure they will work with your program.
On windows, DLL are looked for in folder where executable lies, then using "PATH" environenment variable.
In your case, you want to put your dll along your executable, taking them from the sdk you're using to compile
The following page provides a lot of additional information on the subject (example, plugins, strategy for building installers)
To force using QtNetwork and linking it, you have to put
QT += network
in your poject file.
If you're sure you're not using it, you can use
QT -= network

How can I make MSVC debugger step into Qt library source code again?

Until now my Visual Studio 2008 debugger gracefully stepped into Qt library code when I pressed F11. After upgrading Qt to the latest version and changing QTDIR, F11 does not step into library code anymore. Any clues how to make the debugger smart again?
Activate the modules list, Debug - Windows - Modules, to see what libraries are loaded and if debug symbols are loaded for those libraries. Note that you need to have the debugger active on your process to be able to do this.
In debug mode, the Qt libraries should be suffixed by d. QtCored4.dll for instance. If you see QtCore4.dll on the list, you have linked to the wrong libraries. If it does say QtCored4.dll but under Symbol Status there is something different than Symbols loaded., then that's the reason. You can manually load the symbols here by right clicking on the dll and selecting Load Symbols. It asks for the Pdb file after clicking that.
You can add more pdb file locations, if they weren't loaded but exist, from Tools - Options - Debugging(tree) - Symbols(tree). If you want the symbols to be automatically loaded.
Should it give some error, that the pdb file doesn't match the binary or something like that, you should re-build your Qt debug version, unless you have more pdb files to try. Use the Visual studio command prompt and go to the Qt directory, run configure and nmake. It takes a while, possibly some hours. There was some switch to only build debug version but i forgot where it goes. Note that the build might fail and after that it's a lot of fun www.google.com searches. The best bet might be to get the source only package, I forgot where to get that and it's not easily found. If you know where to get it, tell me please. I vaguely remember that there might be some other way to build the debug version, but this is the only one i know for sure.
#0xbaadf00d's recommendation to "open the Debug/Windows/Modules view" for verifying which modules have loaded successfully and which are not loaded is extremely useful.
Here is a summary of what I check when I need to step into Qt source code:
The DLLs must be for the Qt version in developer's Qt kit
The Qt .pdb files must be present in Qt kit's folders: bin, lib, plugins/platforms, plugins/qmltooling
Visual Studio Tools/Option/Debugging/Symbols needs paths to .pdb files:
If qt.conf file is used, must point to correct bin folder
If target is WinCE or WEC2013 and using HKLM\Loader\SystemPath, you must specify path to DLLs in SystemPath variable
Set the location for the source files in the project property pages:

FlexUnit4 in IntelliJ

When I try to run test with FlexUnit4 and IntelliJ, I get this error:
SecurityError: Error #2148: SWF file file:///C|/Users/LIC/Projects/ProgramJef/out/production/Flex%2DClient%2DTests/%5Fflexunit.swf cannot access local resource file:///C|/Users/LIC/Projects/ProgramJef/out/production/Flex%2DClient%2DTests/textLayout_1.1.0.604.swf. Only local-with-filesystem and trusted local SWF files may access local resources.
at flash.net::URLStream/load()
at flash.net::URLLoader/load()
at mx.core::CrossDomainRSLItem/load()[E:\dev\4.x\frameworks\projects\framework\src\mx\core\CrossDomainRSLItem.as:240]
at mx.core::RSLListLoader/loadNext()[E:\dev\4.x\frameworks\projects\framework\src\mx\core\RSLListLoader.as:184]
at mx.core::RSLListLoader/load()[E:\dev\4.x\frameworks\projects\framework\src\mx\core\RSLListLoader.as:156]
at mx.preloaders::Preloader/initialize()[E:\dev\4.x\frameworks\projects\framework\src\mx\preloaders\Preloader.as:279]
at mx.managers::SystemManager/http://www.adobe.com/2006/flex/mx/internal::initialize()[E:\dev\4.x\frameworks\projects\framework\src\mx\managers\SystemManager.as:1925]
at mx.managers::SystemManager/initHandler()[E:\dev\4.x\frameworks\projects\framework\src\mx\managers\SystemManager.as:2419]
I really wouldn't know what the problem is here, and I can't find anything on it online. Even on IntelliJ and FlexUnit4 there's not much to find...
You must allow the resulting SWF access to your file system. Set the Flashplayer trust settings in a file. On Linux this file must be in
~/.macromedia/Flash_Player/#Security/FlashPlayerTrust/
(for Windows there is a similar path somewhere) and create a file that lists the output path of your project, e.g.
/dev/myproject/target
/dev/anotherproject/target
In case 'target' is our output folder.
Did you set up your test sources folder right? In Project Settings under Modules, add Flex and click Flex and add Text Source Folders using the tree structure on the right hand side.
(IntelliJ 9.0.2)

FlexPMD and TextMate setup question: Creating rules

I wanted to get some assistance into how to set up new rulesets for Textmate, as I can't find the pmd.xml file that needs to be modified.
Thanks in advance
I couldn't find a default pmd.xml file anywhere, so I just used the Adobe Flex PMD Ruleset creator and then exported the default set of rules.
[edited to add]
My project was running using ANT and Hudson so I just put it in the root of that.
However, to properly test this out using TextMate I copied my project to match the following documented conditions:
"The bundle is currently experimental, as such it expects the following:
Source files to be in a saved TextMate project.
ActionScript and MXML source files to be in a directory named 'src'"
I then copied my pmd config file into the project root, opened it, and ran the FlexPMD 'Project' option.
This gave the illusion of using my file, so I renamed the file and deleted all but one rule to prove it wasn't being used.
The TextMate FlexPMD bundle documentation mentions:
To specify a custom ruleset specify it's path using the env var TM_FLEXPMD_RULESET.
So I rather than create a global variable which would affect all projects, I created a project dependent variable by:
The way to do this is currently a little secret but if you deselect everything in the project drawer, then click the info (circled I) button, a panel will appear where you can set variables.
So my variable was TM_FLEXPMD_RULESET with the value pmd_rules.xml
When I then ran the FlexPMD 'Project' option, only one rule was being run.

Resources