I am trying to use GtkAda with GNAT Programming Studio. When I load the standard template for a simple GUI program, I get the following errors:
"gtk.ads" not found
I tried to add the following (as the mentioned file itself recommends in its comments):
with "gtkada";
or this one...
with "/usr/share/ada/adainclude/gtkada.gpr";
but I get the error message:
main.adb:1:06: identifier expected
How can I make it compile and how can I use GPS with GtkAda?
gtkada.gpris a project file (*.gpr), and your program files (*.ads, *.adb) can only import other program files, not project files. Those with statements should go in your project file.
Related
I have compiled Lua 5.3 as a 32 bit c++ DLL and exe. The DLL contains all the lua code except for lua.cpp and luac.cpp. The exe compiles lua.cpp and uses the DLL to run the lua interpreter. This works fine when running on its own from the command line. I wish to be able to run from the IDE using this DLL and exe.
If I replace /ZeroBraneStudio/bin/lua53.dll and lua53.exe with my own versions, I can run scripts (clicking the two green arrows). However, debugging does not work, giving the following error:
The procedure entry point luaL_addlstring could not be located in the dynamic link library lua53.dll.
I can see that this is happening because the debugger is making use of luasocket. \ZeroBraneStudio\bin\clibs53\socket\core.dll is dependent on lua53.dll, and is expecting it to contain lua compiled as c.
So, what is the correct solution to this - is it to compile luasocket as c++ as well?
(And, if so, does anybody have instructions/guidance for doing so? I have been unable to find anything on this.)
Thanks.
I'm not sure how exactly the DLL was compiled, but the error message likely indicates that the luaL_addlstring and other functions are not exported by it. If the symbols are exported correctly, you should be able to load luasocket and get the debugging working. See this thread for the related discussion.
Also, you don't need to replace lua53 library and executable, as you can configure the IDE to use your own copy of it using path.lua53 configuration setting as described in the documentation.
Okay, I was able to get it working. The solution was to compile luasocket as c++. I won't give full instructions on how to do this here, but some points to hopefully help anybody else with the same issue:
Got luasocket from here: https://github.com/diegonehab/luasocket
Renamed all *.c files to *.cpp
Renamed Lua52.props to Lua.props (I am using lua 5.3 but seems like it is compatible?)
Placed lua headers and lib in appropriate folders
Opened solution in Visual Studio 2012
Fixed up minor issues with project files, like the renaming of the files.
Added 'extern "C"' to declaration of luaopen_socket_core and luaopen_mime_core functions (necessary for lua to be able to load libraries).
Built solution
Copied new dlls into clibs53/socket and clibs53/mime folders.
I used Dependency Walker to help with this. If anybody wants further details in the future please leave a comment.
Trying investigate how to create "Hello world" on different languages via HaxeDevelop. I'm newbie and may be inacurate at terminology.
1) C# project. Pressing F8 gives me error:
haxe -cp src -cs D:/Programs/Projects/CsTestHaxe/bin/ -main Main
Unix.Unix_error(8, "mkdir", "D:/Programs/Projects/CsTestHaxe/bin/")
Build halted with errors (haxe.exe).
Via googling pretty much outdated info at least found solution:
haxe -main Main -cs out
And it works but ouput go to "src" location which is bad. Next googling led me to "Custom build" and using .hxml with pre-build command at project settings.
But why default template/settings not works for such simple thing as "Hello world" (used cs.system.Console)?
How default build may be fixed / probably I've installed or setup something wrong via HaxeDevelop installation?
2) C++ project. Pressing F8 gives me error:
Warning: Could not find environment variables for Visual Studio
Missing HXCPP_VARS
Error: Could not automatically setup MSVC
Error: Build failed
Build halted with errors (haxe.exe).
Using command line (similar to C# above) I can exucute C++ sources, but cant compile it.
Installed Visual Studio Community 2017. Nothing changed, same error. VS provide different own parts for installation. Should I install any specific?
Found also many threads about OpenFL workaround for C++ compilation. But I needn't OpenFL and want to use default Haxe API and tools.
Also OpenFL and C++ always mentioned with Lime. Do I need it too? Installed Lime via command line. But seems nothing changed.
3) Am I right that HaxeDevelop not yet support HashLink?
And if possible couple words about why HashLink appeared if there is Neko affiliated with Haxe?
As a result here an additional question: is it right that Haxe during compilation to target platform only "convert" .hx source to target one and then using third party (target platform) compile?
1) C# project. Pressing F8 gives me error.
This appears to be a known Haxe issue. Since it's been fixed on the dev branch, you could try a nightly build from build.haxe.org. Alternatively, you could also try manually creating the bin directory, since that seems to be what the error is about.
2) C++ project. Pressing F8 gives me error:
The latest Haxelib release of hxcpp (3.4.64) does not support Visual Studio 2017 yet. You could use a development version by installing hxcpp from GitHub, since again, it should be fixed there:
haxelib git hxcpp https://github.com/HaxeFoundation/hxcpp
The alternative is to downgrade Visual Studio.
Also OpenFL and C++ always mentioned with Lime. Do I need it too?
Yes, if you want to use OpenFL, you also need Lime, as OpenFL depends on it.
3) Am I right that HaxeDevelop not yet support HashLink?
Actually, a HashLink project template was added. But to follow the general theme of this answer, it seems it hasn't made it into an official relase yet. You can get a nightly build from here.
And if possible couple words about why HashLink appeared if there is Neko affilated with Haxe?
There is a two-part blog series on haxe.org by HashLink's author: part 1, part 2. The first part has a paragraph talking about this exact topic. Here's an excerpt:
First, let me explain the reasons for writing another virtual machine in replacement of Neko.
[...]
Back then, the Neko virtual machine was not especially designed to run Haxe and suffered from some limitations, the main one being performance.
[...]
And to your final question:
is it right that Haxe during compilation to target platform only "convert" .hx source to target one and then using third party (target platform) compile?
That is true for some targets, but it depends. For C++, C# and Java, Haxe indeeds generates source code for the target language and then invokes the target-native compiler after doing its own compilation (this step is usually called "native compilation").
However, some targets produce byte code directly (SWF and Neko), so there is no native compilation step there. Other target languages are interpreted (JS, PHP, Python and Lua), so there's no native compilation step there either. For HL it actually depends, there is HL/Jit (byte code) and HL/C, which is compiled to native C code.
You can find a comprehensive list of Haxe targets an their characteristics here.
Phew, that was a lot of questions in one. ;)
My project has an MSBuild target which runs a tool which generated some files:
<Exec Command="$(MyTool) #(Content)"
ConsoleToMSBuild="true"
IgnoreExitCode="False"
LogStandardErrorAsError="true" />
If the tool detects some error in its inputs (the #(Content) files), it outputs the error to standard error. This makes MSBuild to fail the build, and Visual Studio to show this text in the error list - all of which is great!
Now, the tool also knows the exact file&line where the error is, and I want the error list to show that, and that double-click would lead to the file. If the tool were an MSBuild Task rather than a standalone exe, I could call TaskLoggingHelper.LogError(..., file, lineNumber, ...). How can I accomplish the same with a standalone exe tools? Do I need to write a wrapper task which parses the tool's error? Is there such a task already available?
I don't know of any readily available mechanism to do this but see e.g. Viewing PowerShell's Select-String output in Visual Studio: al you need to do is make your output match what VS expects and you automatically get desired behaviour.
VS looks for messages like
<file>(<line>): error <code>: <message>
For instance msbuild, compiler, linker messages all adhere to this format. So if you have your custom tool output that format it will be shown in the Error List and you can doubleclick on it to navigate to the specified file and line.
I am trying to update my package scikits.bvp_solver (source here) and I have run into some problems with f2py generated files. The files 'bvp_solverf-f2pywrappers2.f90' and 'bvp_solverfmodule.c' which were generated in 2009 allow the package to be built in place with "python setup.py build_ext --inplace" but if I delete them and try to rebuild I get the error
scikits/bvp_solver/lib/bvp_solverf-f2pywrappers2.f90:218.48:
use guess_3_wrap__user__routines
1
Fatal Error: Can't open module file 'guess_3_wrap__user__routines.mod' for reading at (1): No such file or directory
scikits/bvp_solver/lib/bvp_solverf-f2pywrappers2.f90:11.19:
The part the adds this use statement does not appear in the old version of the file. I am having difficulty figuring out how to fix this issue. Can anyone offer advice? What are the major changes to f2py in the last two years?
I finally fixed this problem by eliminating guess_3_wrap__user__routines and moving the relevant code into python.
If you don't have the 'guess_3_wrap_user_routines.mod' file, you should recompile it before building the file that uses it. For the same problem that I had, in my command window, which is set to 'Intel Composer XE 2011 Intel(R) Visual Studio 2010' I typed 'gfortran', which is my Fortran compiler, and the Fortran file, so in your case 'use guess_3_wrap_user_routines.f' (or the extension is something like '.f90') and run that. That should recompile the 'use guess_3_wrap_user_routines.f' again to get the '.mod' file.
I have looked at build result for a simple hello world console app to see command line for compilation. Why is it so complex ? How can I then automate things if it is such complex ?
If you intend to automate builds of Xcode projects, use xcodebuild(1).
Your xcodeproj file contains all of the settings that you would need to specify on the command line if you were to call gcc directly. If you run xcodebuild all you need to do is specify your xcodeproj file, the target, the configuration, and the SDK to use. Everything else is done automatically.
Run "man xcodebuild" for more information.
XCode specifies an immense number of command line options for the compiler and linker with fully qualified path names. When working at the command line you'll frequently use defaults instead of specifying all the options the IDE does. Make or some other build tool is your friend for automation.