The MySql and Oracle Database plug-in drivers are compiled on Mac, but unfortunately they cannot be loaded in the program or connect to the database. In the environment
The MySql and Oracle Database plug-in drivers are compiled on Mac, but unfortunately they cannot be loaded in the program or connect to the database. In the environment
The MySql and Oracle Database plug-in drivers are compiled on Mac, but unfortunately they cannot be loaded in the program or connect to the database. Set QT_DEBUG_PLUGINS = 1 in the environment variable. After the program is started, Qt will report some debugging information for loading the plug-in. It can be seen that this is caused by incompatibility of the plug-in, that is, the Build Key issue mentioned in this document. It is mentioned in this document that you may need to clear the plug-in cache. It should be in a file defined by QSettings, but I did not find it. Instead, delete and reinstall the QtSDK, start from scratch, and finally succeed. The detailed process is recorded below for future reference.
1. First install QtSDK 1.2 and install it in ~ /In the QtSDK directory, select the source code 4.8.0 for installation; otherwise, the plug-in cannot be compiled later;
2. download the dynamic database connecting MySql and Oracle databases. You can download it from the official website. Pay attention to the appropriate version for your system. Here is the Max OSX 10.7.3 64bit1_mysqldownload mysql-connector-c-6.0.2-osx10.5-x86-64bit.tar.gz, in oracle, The instantclient basic package and the instantclient SDK package are required.
3. decompress the downloaded database document to a local directory, and record the file directory. Decompress MySql ~ The/bin/mysql directory contains the include and lib sub-directories. Extract the two oracle packages ~ /Bin/oracle Directory, which contains the library files and sdk directories;
4. After the preparation is complete, compile and generate the Qt library. First, execute the command (the last three lines are a command, which is displayed by a long branch)
In the above command, the prefix is the definition of the compiled installation directory, the default is installed to the/usr/local/Trolltech/Qt-4.8.0 directory, here I will define the installation to the QtSDK directory, so as to avoid subsequent configuration of the version in QtCreator, or use install_name_tools to modify the dynamic library name and other operations. After a period of time (several minutes), The makefile file in the entire source directory is generated. The system should display
The above [xxxx] should be your system login user name, the same below.
5. the compilation process starts below. It should be very simple. Just execute the make command directly under the directory just now, but here there will be errors when compiling to the QtWebkit library, therefore, we will skip this library and continue to compile the subsequent library. The error is:
I don't know why, but I don't understand it.
5. You can see through the Makefile file that scripttools and plugins (this is the main purpose) are behind Webkit, and each library is compiled one by one using commands.
Cd src/scripttools; make; cd .. /plugins; make; cd .. /imports; make; cd .. /tools; make; cd .. /translations; make; cd .. /..
Make install
Because it is not necessary, the examples and demos directories are not compiled at last.
The compilation is successful. In addition, you need to add the lib directory of mysql and the lib directory of oracle to the environment variable DYLD_LIBRARY_PATH when running the program. Otherwise, the database plug-in driver cannot be loaded.