I want to write a information schema plugin for mysql,and first Im trying to compile the example plugins and have some errors.
The CmakeList.txt is this:
MYSQL_ADD_PLUGIN(daemon_example daemon_example.cc
MODULE_ONLY TEST_ONLY MODULE_OUTPUT_NAME "libdaemon_example")
INSTALL(FILES daemon_example.ini DESTINATION ${INSTALL_PLUGINDIR} COMPONENT Test)
It is said Unknown Cmake command "MYSQL_ADD_PLUGIN",
Selecting Windows SDK version 10.0.16299.0 to target Windows 6.1.7601.
The C compiler identification is MSVC 19.11.25547.0
The CXX compiler identification is MSVC 19.11.25547.0
Check for working C compiler: E:/visual studio/VC/Tools/MSVC/14.11.25503/bin/Hostx86/x86/cl.exe
Check for working C compiler: E:/visual studio/VC/Tools/MSVC/14.11.25503/bin/Hostx86/x86/cl.exe -- works
Detecting C compiler ABI info
Detecting C compiler ABI info - done
Check for working CXX compiler: E:/visual studio/VC/Tools/MSVC/14.11.25503/bin/Hostx86/x86/cl.exe
Check for working CXX compiler: E:/visual studio/VC/Tools/MSVC/14.11.25503/bin/Hostx86/x86/cl.exe -- works
Detecting CXX compiler ABI info
Detecting CXX compiler ABI info - done
Detecting CXX compile features
Detecting CXX compile features - done
CMake Error at CMakeLists.txt:16 (MYSQL_ADD_PLUGIN):
Unknown CMake command "MYSQL_ADD_PLUGIN".
CMake Warning (dev) in CMakeLists.txt:
No cmake_minimum_required command is present. A line of code such as
cmake_minimum_required(VERSION 3.11)
should be added at the top of the file. The version specified may be lower
if you wish to support older CMake versions for this project. For more
information run "cmake --help-policy CMP0000".
This warning is for project developers. Use -Wno-dev to suppress it.
Configuring incomplete, errors occurred!
See also "C:/Program Files/CMake/bin/CMakeFiles/CMakeOutput.log".
I found this function is in mysql-server\cmake file,
MACRO(MYSQL_ADD_PLUGIN)
MYSQL_PARSE_ARGUMENTS(ARG
"LINK_LIBRARIES;DEPENDENCIES;MODULE_OUTPUT_NAME;STATIC_OUTPUT_NAME"
"STORAGE_ENGINE;STATIC_ONLY;MODULE_ONLY;CLIENT_ONLY;MANDATORY;DEFAULT;DISABLED;NOT_FOR_EMBEDDED;RECOMPILE_FOR_EMBEDDED;TEST_ONLY"
${ARGN}
)
I wonder how to fix it and make the compile success?
error image
Related
I am attempting to compile the MySQL Connector CPP version 8.0.20.
Source code from https://github.com/mysql/mysql-connector-cpp. (Downloaded 2020-May-24)
Following instructions at https://forums.mysql.com/read.php?117,426293,426927.
Step 3 of compiling produced the following command output:
e:\cpp\Lib\MySQL>cmake -G "MinGW Makefiles"
CMake Warning:
No source or binary directory provided. Both will be assumed to be the
same as the current working directory, but note that this warning will
become a fatal error in future CMake releases.
-- The C compiler identification is GNU 8.1.0
-- The CXX compiler identification is GNU 8.1.0
-- Check for working C compiler: E:/Apps/mingw-w64/mingw64/bin/gcc.exe
-- Check for working C compiler: E:/Apps/mingw-w64/mingw64/bin/gcc.exe -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: E:/Apps/mingw-w64/mingw64/bin/g++.exe
-- Check for working CXX compiler: E:/Apps/mingw-w64/mingw64/bin/g++.exe -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
Building version 8.0.20
-- Check if the system is big endian
-- Searching 16 bit integer
-- Looking for sys/types.h
-- Looking for sys/types.h - found
-- Looking for stdint.h
-- Looking for stdint.h - found
-- Looking for stddef.h
-- Looking for stddef.h - found
-- Check size of unsigned short
-- Check size of unsigned short - done
-- Using unsigned short
-- Check if the system is big endian - little endian
-- BIG_ENDIAN: 0
Building on system: Windows-10.0.18362 (AMD64)
Using cmake generator: MinGW Makefiles
Using toolset:
Building 64bit code
Building shared connector library
Configuring CDK as part of MySQL_CONCPP project
-- Looking for SSL library.
CMake Error at cdk/cmake/DepFindSSL.cmake:79 (message):
Cannot find appropriate system libraries for SSL. Make sure you've
specified a supported SSL version. Consult the documentation for WITH_SSL
alternatives
Call Stack (most recent call first):
cdk/cmake/DepFindSSL.cmake:346 (main)
cdk/cmake/dependency.cmake:42 (include)
cdk/CMakeLists.txt:96 (find_dependency)
-- Setting up Protobuf.
==== Configuring Protobuf build using cmake generator: MinGW Makefiles
-- The C compiler identification is GNU 8.1.0
-- The CXX compiler identification is GNU 8.1.0
-- Check for working C compiler: E:/Apps/mingw-w64/mingw64/bin/gcc.exe
-- Check for working C compiler: E:/Apps/mingw-w64/mingw64/bin/gcc.exe -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: E:/Apps/mingw-w64/mingw64/bin/g++.exe
-- Check for working CXX compiler: E:/Apps/mingw-w64/mingw64/bin/g++.exe -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Check if the system is big endian
-- Searching 16 bit integer
-- Looking for sys/types.h
-- Looking for sys/types.h - found
-- Looking for stdint.h
-- Looking for stdint.h - found
-- Looking for stddef.h
-- Looking for stddef.h - found
-- Check size of unsigned short
-- Check size of unsigned short - done
-- Using unsigned short
-- Check if the system is big endian - little endian
-- BIG_ENDIAN: 0
-- Looking for pthread.h
-- Looking for pthread.h - found
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Success
-- Found Threads: TRUE
Using pthreads for protobuf code
-- Configuring done
-- Generating done
-- Build files have been written to: E:/cpp/Lib/MySQL/cdk/protobuf
==== Protobuf build configured.
Processor Count: 8
-- Setting up RapidJSON.
Skipping second declaration of config option: THROW_AS_ASSERT (found in: E:/cpp/Lib/MySQL/cdk/CMakeLists.txt)
-- Performing Test HAVE_STATIC_ASSERT
-- Performing Test HAVE_STATIC_ASSERT - Success
-- Performing Test HAVE_IS_SAME
-- Performing Test HAVE_IS_SAME - Failed
-- Check size of off64_t
-- Check size of off64_t - done
-- Looking for fseeko
-- Looking for fseeko - found
-- Looking for unistd.h
-- Looking for unistd.h - found
-- ZSTD_LEGACY_SUPPORT not defined!
-- Performing Test HAVE_SHARED_PTR
-- Performing Test HAVE_SHARED_PTR - Success
-- Performing Test HAVE_SYSTEM_ERROR
-- Performing Test HAVE_SYSTEM_ERROR - Success
-- Check size of wchar_t
-- Check size of wchar_t - done
-- Looking for sys/endian.h
-- Looking for sys/endian.h - not found
-- Looking for sys/byteorder.h
-- Looking for sys/byteorder.h - not found
Wrote configuration header: E:/cpp/Lib/MySQL/cdk/include/mysql/cdk/config.h
Preparing to merge SHARED library: connector (xapi;devapi)
Connector library name: mysqlcppconn8-2
Building version 8.0.20
Generating INFO_SRC
Generating INFO_BIN
Install location: C:/Users/jvines/MySQL/MySQL Connector C++
Connector libraries will be installed at: lib64
Project configuration options:
: BUILD_STATIC: OFF
Build static version of connector library
: WITH_SSL: system
Either 'system' to use system-wide OpenSSL library, or custom OpenSSL location. (default : system)
: WITH_JDBC: OFF
Whether to build a variant of connector library which implements legacy JDBC API
-- Configuring incomplete, errors occurred!
See also "E:/cpp/Lib/MySQL/CMakeFiles/CMakeOutput.log".
See also "E:/cpp/Lib/MySQL/CMakeFiles/CMakeError.log".
Links to log files:
CMakeOutput.log
CMakeError.log
All files in the /CMakeTmp directory, referenced in CMakeError.log, have been deleted by the script so I can't analyze them.
Main question:
How do I fix this to finally produce the desired build files so I can move on to the next step?
Additional questions:
Where does the referenced src.cxx, and, by extension, the src.cxx.obj, file come from?
How do I eliminate the SSL error, as shown in the command output? Re:
-- Looking for SSL library.
CMake Error at cdk/cmake/DepFindSSL.cmake:79 (message):
Cannot find appropriate system libraries for SSL. Make sure you've
specified a supported SSL version. Consult the documentation for WITH_SSL
alternatives
UPDATE #1
Now using MSYS2 with MinGW-w64. The missing SSL error is eliminated.
New error at the Make step:
e:\cpp\Lib\MySQL\src> make
MAKE Version 5.41 Copyright (c) 1987, 2014 Embarcadero Technologies, Inc.
Error makefile 11: Colon expected
*** 1 errors during make ***
make command replaced with mingw32-make produced new errors. This post is getting long, Please follow the link for the full text of the output.
New command output.
There is no mysql_ps_resultset.cpp to edit, as referenced in Step 4.
I am currently working on a library that interacts with a REST API. This API responds with a JSON object, which I'm parsing with json-glib-1.0. As some of the members of the object might not exist I wanted to use the get_x_member_with_default function of the Json.Object class.
Even though both the Vala and the C compiler see the functions the linker gives me several errors:
Undefined symbols for architecture x86_64:
"_json_object_get_boolean_member_with_default", referenced from:
_discord_message_construct in message-f5c60f.o
"_json_object_get_int_member_with_default", referenced from:
_discord_message_construct in message-f5c60f.o
"_json_object_get_string_member_with_default", referenced from:
_discord_message_construct in message-f5c60f.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
To reproduce this you can try this code:
void main() {
string json = "{\"one\": 1337}";
Json.Parser parser = new Json.Parser();
parser.load_from_data(json, -1);
int64 val = parser.get_root().get_object().get_int_member_with_default("one", 666);
stdout.printf(#"$val\n");
}
and compile it with this command: valac --pkg json-glib-1.0 file.vala.
This gives me
Undefined symbols for architecture x86_64:
"_json_object_get_int_member_with_default", referenced from:
__vala_main in json2-ec99c2.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
This is obviously not a library; when compiling my library I only generate the C code and compile and link everything with the output of pkg-config --cflags --libs json-glib-1.0. Is there anything I have to link additionally?
You need to install a newer version of json-glib, or more likely, not use that symbol. The Vala documentation for the symbol shows this is since version 1.6 of the library. This information is taken from the C source for the library and the symbol was added with this commit. The problem is the latest stable release appears to be 1.4.4 - see the source repository tags. So it looks like you have to build your own development version with the latest symbols or not use get_int_member_with_default ().
I got my Free Pascal code here -
program HelloWorld;
uses crt;
begin
writeln('Hello, World!');
readkey;
end.
and saved it into helloworld.pas. When I compile it with fpc, everything goes right and the compiling succeeds. So I tried fp, the IDE that comes with fpc and also uses this very compiler. But here, IDE internal compiling fails. Main error message:
helloworld.pas(2,6) Fatal: Can't find unit crt used by HelloWorld
-- The C compiler identification is GNU 6.1.1
-- The CXX compiler identification is GNU 6.1.1
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
CMake Error at /usr/share/cmake-3.6/Modules/FindPackageHandleStandardArgs.cmake:148 (message):
Could NOT find PkgConfig (missing: PKG_CONFIG_EXECUTABLE)
Call Stack (most recent call first):
/usr/share/cmake-3.6/Modules/FindPackageHandleStandardArgs.cmake:388 (_FPHSA_FAILURE_MESSAGE)
/usr/share/cmake-3.6/Modules/FindPkgConfig.cmake:49 (find_package_handle_standard_args)
CMakeLists.txt:37 (find_package)
-- Configuring incomplete, errors occurred!
See also "/root/Descargas/programas/mysql-workbench-community-6.3.7-src/wb-build/CMakeFiles/CMakeOutput.log".
I get this output error after typing cmake [-DCMAKE_INSTALL_PREFIX=/usr] ..
I am building a project using Opencv 3.1 and wxwidgets 3.1. The code I use:
[wxOpenCv Demo1]
I try to add a write frame object, using the function cv::imwrite().
(I changed the c calls to c++ eg: cvQueryFrame( m_pCapture ) to m_pCapture >> m_CurFrame;)
I get this error:
Undefined symbols for architecture x86_64:
"cv::imwrite(cv::String const&, cv::_InputArray const&,
std::vector > const&)", referenced from:
CCamera::SaveFrame() in camera.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Without wxwidgets the opencv functions work fine. So its seems that it has to do with the combination of wxwidgets and opencv.
This works fine with wxwidgets and Opencv:
cv::imshow("tmp",m_CurFrame);
cv::waitKey(4);
// cv::imwrite(Tmp , m_CurFrame);
If I uncomment the last line, I get the error.
OS X: 10 Yosemite and I use the default compiler (Apple LLVM 7.0)
I have no idea what to do about this!
solved the problem (and more) by recompiling wxwidgets 3.1.0 and Opencv 3.1. I used these links to get it going.
Small guide to compiling wxWidgets, Opencv against C++ 11:
Compile wxwidgets 3.1.0: I followed the install.txt for OSX. And tweaked the ../configure call with help from this
I added: --enable-debug and changed the macosx version
../configure --disable-shared --enable-debug --enable-unicode --with-cocoa --with-macosx-version-min=10.7 --with-macosx-sdk=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.10.sdk CXXFLAGS="-std=c++0x -stdlib=libc++" CPPFLAGS="-stdlib=libc++" LIBS=-lc++
Then with the help of this page I build a xcode project. Tweaking a few things:
(wxcocoa.xcodeproj and minimal.xcodeproj, and a all new projects)
Add to the Header Search Path: $(WXROOT)/build/osx (to find wx.xcconfig)
base SDK: latest OS X (10.11)
C language dialect: GNU 11(not sure if this is right)
C++ language dialect: GNU++11 [-std=gnu++11]
C++ Standard Library: libc++ (LLVM C++ standard library with C++ 11 support)
placed the WXROOT under “preference->locations->Source Trees. Not important, but seems to be a better location (restart xcode)
in wxcocoa.xcconfig I changed: MACOSX_DEPLOYMENT_TARGET = 10.10
Somehow I have to change the name of the created library from libwx_osx_cocoa_static.a to: lwx_osx_cocoa_static.a (why, I do not know)
I use GNU++ 11 and thus libc++ to be able to use new functionality like “future"
I then added OpenCV to my newly created wxXcode project:
Compile OpenCV following this: (search the web for: howto-install-build-and-use-opencv-macosx-10-10)
Make sure that the SDK is the right version (here was my biggest problem), matching the build of wxWidgets
The compiler settings same as for wxWidgets (see above)
(added:) To do this I added some lines to the CMakeLists.txt in the (Opencv-master folder). Below the line: # OpenCV compiler and linker options
(I found this trick here: search the web for: OpenCV with C++11 on OS X 10.8
message("Setting up Xcode for C++11 with libc++.")
set(CMAKE_XCODE_ATTRIBUTE_CLANG_CXX_LANGUAGE_STANDARD "c++0x")
set(CMAKE_XCODE_ATTRIBUTE_CLANG_CXX_LIBRARY "libc++")
Then follow this page to update the newly created wxWidgets xcode project (search the web for: howto-setup-xcode-6-1-to-work-with-opencv-libraries)
This should do the trick! I can now combine wxWidgets, OpenCV and the libc++
(multithreading, “future")
I hope this helps.
Please let me know if you found out more!