Solved mac: attempt to add "QT += sql" causes build error?
-
Hi,
You currently can't select which plugin is deployed.
You are talking about a build error. What exactly is it ?
-
this is the error i'm talking about:
@davecotter said in mac: attempt to add "QT += sql" causes build error?:
ERROR: no file at "/usr/local/mysql/lib/libmysqlclient.20.dylib"
ERROR: no file at "/usr/local/opt/libiodbc/lib/libiodbc.2.dylib"
ERROR: no file at "/Applications/Postgres.app/Contents/Versions/9.6/lib/libpq.5.dylib"perhaps this is more correctly called a "deployment error" ?
anyway, can that be suppressed? because if not, i always get this dialog, which is totally interrupting my flow: (and i note it actually does say "build error" hence my confusion)
-
Pretty strange, never saw that kind of error. All these libraries are related to the plugins and thus should not even appear in the build phase.
Can you find at which point they happen in the build process ?
-
sorry, they are not in the build phase, they are in the deploy phase. when i call "macdeployqt" that is when the errors come up. how can i suppress the (non) errors,so i don't get that dialog?
thanks for your help!! :D
-
@davecotter As workaround (not actual solution) you could put some libs at those locations mentioned in the error messages and rename them accordingly.
You also can file a change request for the macdeployqt so the devs add the possibility to define the libs you want to deploy (or don't want to deploy). -
I have gathered the libs and put them all in a folder and then passed the path to that folder into macdepolyqt via "-libpath=...", but i still get the same problem.
it's not a solution to force all developers to install these libs into their dev machines into the expected directories, just to get around this bug, and yes this is definitely a bug from what i can see. macdeployqt has no business looking for a particular Application in the user's Applications folder, to find a library, right?
does anyone have any other ideas what's wrong?
-
i'm gathering by lack of response that this may in fact be a bug?
note that adding "-verbose=0" to the macdeployqt command DOES NOT suppress the message, even though it's documented to suppress all messages. THAT certainly seems like a bug?
yes?
-
I couldn't reproduce this issue.
What version of Qt are you using ?
-
creator 4.8.2, building with 5.12.1
are you calling
macdeployqt
as part of the build (so you see its messages in the console) and doing it for the debug config?note that my post build step just calls a python script, it's the python script that calls
madceployqt
, if that changes anything. i'm also linking in boost::threads (etc) during this phase as well, if that is relevant. -
No, I'm doing it from the command line for both debug and release.
Can you share your python script ?
How exactly are you calling it ? -
my script is part of a complex post build system, so i doubt it will shed light for you but here it a very small section of it:
def qt_deploy(qtDir, buildType, bitDepth, projName, libPathDir = ""): appPath = get_app_path(qtDir, buildType, bitDepth, projName) qt_IDE_folder = paths.get_qt_IDE_folder(True) if xplat.is_mac(): # on mac, bundle has already been created, # but it must be moved into place qtDeployExe = qt_IDE_folder + 'clang_64/bin/macdeployqt' qtDestAppPath = appPath[:-1] else: qtDeployExe = qt_IDE_folder + get_win_compiler_vers() if bitDepth == 64: qtDeployExe += '_' + bitDepth qtDeployExe += '/bin/windeployqt.exe' qtDestAppPath = get_exe_path(appPath) cmd = [ qtDeployExe, qtDestAppPath] if xplat.is_mac(): # this doesn't seem to help #if (buildType == 'debug'): # cmd += ['-verbose=0'] if libPathDir != "": # this doesn't seem to help #sqlPathDir = '/Volumes/Developer/depot/kJams/Development/_source/Resources/package/mac/libsql/' #cmd += ['-libpath=' + sqlPathDir] #print libPathDir cmd += ['-libpath=' + libPathDir] else: cmd += ['--compiler-runtime', '--verbose=0'] libVers = os.path.basename(qt_IDE_folder[:-1]) print '\tCopying Qt Libraries: ' + libVers + '...' debug_print('cmd: ' + str(cmd)) if False: # to show less logging / errors xplat.pipe(cmd, False); else: # shows more errors xplat.system(cmd) pass
this is the command string that it will output:
'/Users/davec/developer/Qt/5.12.1/clang_64/bin/macdeployqt' '/Volumes/Developer/depot/kJams/Development/qt/build/mac/kJams 2 Debug.app' '-libpath=/Volumes/Developer/depot/kJams/External/boost_1_69_0/stage/lib/'
-
i suppose this is helpful too:
def system(cmdA): cmdStr = cmdA.pop(0) for subCmd in cmdA: if ' ' in subCmd: subCmd = '"' + subCmd + '"' cmdStr += ' ' + subCmd os.system(cmdStr) def pipe(cmd, print_outB = False): debug_print(str(cmd)); pipe = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE) (out, err) = pipe.communicate() ret = pipe.returncode errStr = str(err)
if i use
system()
to invoke the command, i get the errors printed directly to the console, and Qt picks them up and gives me warnings.but if i use
pipe()
, i can filter the returned errors and get around the problem. I'd rather usesystem()
. -
I'm also having these problems with macdeployqt, and I'm doing everything from the command line.
I'm using Qt 5.12.2 clang64 with MacOs 10.12.6 High Sierra. The problem is exactly the same, when I try to deploy my application I get the following errors:ERROR: no file at "/usr/local/opt/libiodbc/lib/libiodbc.2.dylib" ERROR: no file at "/Applications/Postgres.app/Contents/Versions/9.6/lib/libpq.5.dylib"
The command is the following:
Mac-mini-di-Developer:build-MyApp-Desktop_Qt_5_12_2_clang_64bit-Release developer$ /Users/developer/Qt/5.12.2/clang_64/bin/macdeployqt /Volumes/Condiviso/MyApp_MAC/build-MyApp-Desktop_Qt_5_12_2_clang_64bit-Release/MyApp_2.0.app
I managed to resolve the problem relative to the libmysqlclient.20.dylib downloading mysql with the brew command on the terminal and putting the library in the correct path, but I can't find the correct libraries for these two (if this is the right way to get it work, I suppose it is since it works with libmysqlclient.20.dylib).
Can somebody give me any suggestion please?
-
Hi,
You can use install_name_tool to modify the the plugin's linked libraries path.