QT Creator executable file variable - qt-creator

I am looking for an environment variable in QT Creator that contains the path and name to the executable file located in the project build directory. Any suggestions?

It is %{CurrentProject:Name} variable. Though it does not contain the path but only executable file name. For path you can use %{buildDir} variable.
So in general it looks like this: %{buildDir}/%{CurrentProject:Name}

Related

.res files don't include to exe file, but .rs files links succesfully

I never worked with Win-specific programming and today I've decided to figure out this question. I use Cmake and Ninja and to include a resource file, I use the following line in the Cmake config:
add_executable(${PROJECT_NAME} "${CMAKE_CURRENT_SOURCE_DIR}/src/windows/test.res" ${APP_SOURCE_FILES} )
And when I open properties of my app using context menu I don't see any meta data or icon. These ones are described in the .res file, which I try to include.
But if I use non-compiled resource file everything works (.rs). How should I link a .res file with my app?
For compilling res files I use windres by msys2
It looks like I am not only winapi-beginner. I am also a cmake beginner. When a path is added to add_executable Cmake tries to compile a file with the specified path to a .obj file. But because a .res file has been compiled, cmake just does nothing. In this case, I have to add .res file to the link flags instead. Google, thank you. You're the best :)

Why can't I access the files under the app internal path (xxxx.app/Contents/MacOS/) after packaging on Qt mac?

I saved the file to the xxxx.app/Contents/MacOS/ path via qt, and after using macdeployqt to package the file, I double-clicked on the xxxx.app file to open the app, and could not read and access the file.
However, when I open the application using the terminal in the xxxx.app/Contents/MacOS/xxxx path, everything works fine.
What is the solution?
solved, in the mac directly write the name can not find the current path, you must add before the path
QCoreApplication::applicationDirPath()

The program can't start because libmwsl_solver_rtw.dll is missing?

I generated an executable from a simulink coder using the 'rsim' target build,but the executable is missing this dll. When using 'grt' target build, this dll error isn't called, the executable runs as expected.
Any ideas what is this dll and where it maybe found ?
My solution was to find the library location (matlab\R2016a\bin\win64) and added the path to Environment variables

QT Not including the correct library when running a build

I'm building a program Using Qt Creator 5.2.1 (32 bit) with Mingw. One of the dependencies of this program is the libcurl library.
QT was building the file properly, however, when running, it would throw an error 139.
After running the dependency walker on the binary, I noticed that the libcurl dll in turn depends upon another dll called "libeay32.dll".
I did the following:
Copied the my program along with all required libraries(including
libeay32.dll) externally to Qt and ran it (this was successful).
After that I tried running from within QT, but having the libeay32 library in the build before running (this was successful)
Logically, I presumed afterward, that if I put the path to the libeay32 prior to any other paths within my PATH variable, that It would pull the correct version of the lib (re: answer to question here). However this did not work, throwing the same error 139 (it's apparently not finding the library)
I know I could run and test my program by simply copying the file into my working directory, however, for information purposes, I was wondering;
Is there any way of doing this without having to copy this DLL?
My instinct would have been that fixing the Path to point to this firstly would have helped as this would ensure that the DLL is pulled used before any other occurrences that may be there in other dirs.
Note: In referring to the PATH variable, I mean both the SYSTEM path and checking for the PATH Qt uses (Qt adds a few dirs to the path)
Thanks in advance for any help.
Either you link static, or you have to ensure that your library is located in one of the following locations (http://msdn.microsoft.com/en-us/library/windows/desktop/ms682586(v=vs.85).aspx#standard_search_order_for_desktop_applications):
The directory from which the application loaded.
The current directory.
The system directory. Use the GetSystemDirectory function to get the path of this directory.
The 16-bit system directory. There is no function that obtains the path of this directory, but it is searched.
The Windows directory. Use the GetWindowsDirectory function to get the path of this directory.
The directories that are listed in the PATH environment variable. Note that this does not include the per-application path specified by the App Paths registry key. The App Paths key is not used when computing the DLL search path.

How to link library in Ada with GNAT on Fedora 17?

I try to compile unit with ada-zlib. Package ada-zlib-dev is installed. In code I write with Ada.Text_IO;. GNAT Reference Manual states that additional compiler arguments are not required if library is located in directory from ADA_INCLUDE_PATH environment variable. But it's empty. How should I set that variable to get code compiled?
UPDATE:
The code is read.adb from zlib-ada. It's provided as an example. Command line:
gnatmake read.adb
I found answer finally.
It isn't necessary to set environment variables. The .gpr files for the libraries are located in /usr/lib/gnat. You need to write such .gpr file for your project:
with "<name of lib's .gpr file related to /usr/lib/gnat";
project SUFO is
for Source_Dirs use ("src");
for Object_Dir use "obj";
for Exec_Dir use "bin";
for Main use ("src/main.adb");
end SUFO;
And run gprbuild command in project directory, where you've placed your .gpr file.

Resources