Show all compile errors in FlexBuilder? - apache-flex

Is it possible to make FlexBuilder show all compile errors in all files? FlexBuilder does not show errors in Action Script files, that are not referenced. Also very often I fix a problem just to see new problems pop up after compiling the whole project although these errors existed long before.
IntelliJ is showing all compile errors it can find and I would like to have FlexBuilder behaving the same way since IntelliJ is not mature enough to handle our complex set up. Is there a compiler switch to enable this?

The compiler can (and will) show errors only in code that you tell it to compile, and like you said, whatever is not referenced in the code you compile, will not be compiled, and thus, checked by the compiler.
So if you want to have the compiler check some part of your code, you need to tell it to compile it. I'm not sure how your projects are set up, but I'm assuming that you're compiling a bunch of smaller projects that are all using different parts of a shared codebase (or something similar.) In this case, you could either:
set up some sort of "master" project that references all of your code, compiling which would then check for errors everywhere (maybe you have this already, in which case the solution is simply to compile this regularly)
set up a job/target for compiling the AsDoc documentation for all of your code -- you could then run this regularly and at the same time you'd be keeping your API docs up to date

The following MXMLC compiler arguments might be useful:
-includes className [...]
Links one or more classes into the output SWF, regardless of whether they are required at compile time.
-include-libraries swcPath [...]
Links the entire contents of one or more SWC libraries into the output SWF, regardless of whether its classes are required at compile time.

Related

Mysterious Qt undefined interface : investigation

I am writing a typical Qt (4.8.2) app with plugins. One of the plugins includes a couple custom interfaces, by calling the Q_INTERFACE macro. Those interfaces are found in .h files visible to the project (via the .pro includes) and they all contain a macro call to Q_DECLARE_INTERFACES.
Yet upon compiling the moc file I get an undefined interface error in the main .h file of the plugin. It doesn't tell me which though, it only specifies the line of the first (I tried changing the order but it makes no difference - unless all interfaces are affected - heck, who knows, that could be the case.)
This plugin works at other people's desks. Some of the stuff in the main app is written with Qt 5 but always with macros to check for the version and include other code for earlier versions like mine. This also works at other people's desks who work with 4.8.2 for their plugins.
Where to look for the cause of that error ?
I don't know why my question got voted down, but here's the answer :
With the copy of the project I also received the moc_*.cpp files and some files called mocinclude.tmp . This was a first git add mistake.
But there is another problem : at least the latter (if not the former) does not get cleaned properly or recreated by Qmake/make clean.
A third problem : In mocinclude.tmp there were absolute file paths from the computer where the project was first created, which wasn't mine. Relative paths would have been less error-prone.
Those wrong absolute paths led to the "undefined interface" error (which is nothing less but a "file not found" error in the case of a needed interface file) when compiling the moc files.
Deleting all mocinclude.tmp (and moc files) solved my problem.
(I also made sure to tell git to not track them anymore.)

Static link sqlite in Lazarus

I am building an application with Lazarus where I use a sqlite database to store thousands of records. Right now I am linking to the sqlite library dynamically via the sqlite3.dll.
Is it possible to link to it statically? Where can I find the Lazarus compatible lib file to do that?
Note:
I only started using Lazarus and Free Pascal a month ago so something that might look very obvious to one, might not be for me. So bear with me a bit.
Cheers
Actual static linking is difficult since the TSQLite3Connection component is inherently designed to actively load the SQLite3 DLL. In other words, it's not linking against the library when you compile the program, the component is coded to dynamically load the DLL at run time.
If you are looking to have a totally self contained program, then you can accomplish this two different ways.
Create a new TSQLite3Connection component that links statically against sqlite3 instead of loading the DLL dynamically.
Include the sqlite3.dll as a resource in your program and have your program automatically deploy it before it runs.
Solution #1 is not trivial and not for the faint of heart. I've done it, and I intended to include a link to the component, but the result isn't stable. The problem is that you have to compile a static version of sqlite3, which isn't a real problem, but you have to do it with something like gcc under MinGW and that introduces issues. Compiling with gcc under MinGW means you have to then link in libgcc.a, and because FreePascal's internal linker doesn't know how to interpret stdcall symbols properly, you also have to link against MinGW's libkernel32.a, and libmsvcrt.a. The result just isn't stable. Crashes galore.
Solution #2 should be fairly easy, but the Lazarus maintainers make it a little hard. The part where you store the dll inside the executable as a resource is easy enough to do. And so is writing it out as a temp file. The problem is that you can't tell the TSQLite3Connection component where to find it after. So it looks in the executable's folder, or in system folders. Neither of which can necessarily be written to by the executable. The only place you can guarantee that your program will be able to write to is a temp folder. So what I did is created a new version of TSQLite3Connection component call TSQLite3DynConnection, meaning you can dynamically specify where the DLL is. I made a published property called ClientLibrary where you can specify the location of the dll (it doesn't have to end in .dll, so you can use system temp filename generation routines). You can get this component at: http://icculus.org/~kfitzner/misc/sqlite3dyndll.zip. It will compile against Lazarus 1.6.2 FP 3.0.0, or FP 1.0.6 / FP 2.6.0, which are the two versions I use.
I'll update this answer if I can get the statically linked version stable.
2 Dec 2016 update: I managed to get a static version stable.

Rebuid only modules that contains warnings

For now i'm working on complicated Qt project and trying to eliminate many of warnings which appears when i'm trying to build project with using of different compilers (gcc,clang,msvc). Full rebuild of project takes up a long time.
Is there a some tool or maybe a artful approach to rebuild only modules that has warnings on previous build?
I think it might be reached by deleting (or outdating) those modules. Thus Make utility can rebuild them for me.
As the earlier comment say, only do a normal build. Anything that didn't compile last time will now compile. This of cause requires that you set a compiler flag to treat warnings as error or the compiler will create object files even though there are warnings. And the above strategy will fail.

The plugin '[path]/APlugin.dll' uses incompatible Qt library. (4.8.2) [debug]

I am trying to compile a Qt Library Project to use its DLL as a plugin of my Main Application.
I've come across this particular error and I cannot seem to get past it, no matter what I try.
I believe cluttering the question with code tags is pointless when I can just provide you with the "working issue" (for lack of better wording).
This is a link to both projects. The main application AND the plugin I am currently testing on.
(please remember to modify the path in the Application project of the dll. I am using absolute path, which will most likely never be the same one you will use. I used absolute paths to make sure the problem was unrelated to finding the file itself)
So far I've checked:
My Qt version is, indeed, 4.8.2. Built with VS2010 Command Prompt.
As far as I understood the documentation, my code (particularly the APlugin project) follows the documentation instructions word by word. There's some space for human error, but I believe I got it right. as specified here(The Lower-Level API: Extending Qt Applications)
I am able to generate other QPluginLoader::errorString() errors (for example, using an invalid path to the .dll file will return a "file not found" error). Thus diminishing the margin of error in its use.
As of today, Google results are, at best, cryptic and/or do not apply to my current context of development (I am on VS2010, Win7 N Ultimate, Qt 4.8.2)
I believe it's better that I provided projects where the issue is reproducible, instead of just cluttering the question with code, but if you think I still should copy-paste my code, let me know and I will provide it explicitely in the question.
The only thing I am able to provide so far is that, albet I don't use a .pro file, I shouldn't need it, because my application will be windows exclusive, and the vcproj file already contains that data.

Build swf using mxmlc (Ant) - Code compiles when code not changed

I am using mxmlc task to generate swf for our project.
Problem is, even when I dont change any flex code, swf compiles every time, which is comparatively lengthy process.
Does anyone know how to avoid it? Is there any solution to this?
Thanks in advance,
Miral.
Incremental compilation should be what you are looking for. It's on by default when you compile from Flash Builder but not when you compile from the command line or Ant. The gist is that, with incremental compile on, mxmlc inspects your code looking for changes and only compiles what it needs to.

Resources