I have a problem compiling mod_perl2 for strawberry5.30 and apache2.2 on Windows.
Version Details:
Running:
perl -v
prints the following version information:
This is perl 5, version 30, subversion 0 (v5.30.0) built for MSWin32-x86-multi-thread-64int
Strawberry and apache are 32bit version.
The issue:
When I run nmake in the mod_perl directory it returns the following error:
C:\Users\KWS\Downloads\mod_perl-2.0.11>nmake
Narzędzie do konserwacji programów firmy Microsoft (R) 14.23.28106.4
Copyright (C) Microsoft Corporation. Wszelkie prawa zastrzeżone.
cd "src/modules/perl" && gmake
gcc -IC:/Users/KWS/Downloads/mod_perl-2.0.11/src/modules/perl -IC:/Users/KWS/Downloads/mod_perl-2.0.11/xs -IC:\Apache2.2\include -I"C:\Apache2.2\include" -IC:\Apache2.2\include -s -O2 -DWIN32 -D__USE_MINGW_ANSI_STDIO -DPERL_TEXTMODE_SCRIPTS -DPERL_IMPLICIT_CONTEXT -DPERL_IMPLICIT_SYS -DUSE_PERLIO -fwrapv -fno-strict-aliasing -mms-bitfields -I"C:\strawberry\perl\lib\CORE" -DMOD_PERL -DMP_COMPAT_1X -fgnu89-inline -s -O2 \
-c mod_perl.c && C:\strawberry\perl\bin\perl.exe -MExtUtils::Command -e mv -- mod_perl.o mod_perl.lo
In file included from C:\Apache2.2\include/httpd.h:43,
from modperl_apache_includes.h:27,
from mod_perl.h:20,
from mod_perl.c:17:
C:\Apache2.2\include/ap_config.h:234:10: fatal error: ap_config_auto.h: No such file or directory
#include "ap_config_auto.h"
^~~~~~~~~~~~~~~~~~
compilation terminated.
gmake: *** [Makefile:124: mod_perl.lo] Error 1
NMAKE : fatal error U1077: „cd”: kod powrotu „0x2”
Stop.
I read that the ap_config_auto is for unix system and it shouldn't be on Windows.
EDIT:
I started to correct Makefile and I fixed the problemm by removing one condition, but I have next problem that i can't solve:
cd "src/modules/perl" && gmake
C:/strawberry/perl/bin/perl.exe -MExtUtils::Command -e rm_f -- mod_perl.so
g++ -mdll -s -L"C:\strawberry\perl\lib\CORE" -L"C:\strawberry\c\lib" \
C:/Apache2.2/lib/libapr-1.lib C:/Apache2.2/lib/libaprutil-1.lib C:/Apache2.2/lib/libhttpd.lib \
mod_perl.lo modperl_interp.lo modperl_tipool.lo modperl_log.lo modperl_config.lo modperl_cmd.lo modperl_options.lo modperl_callback.lo modperl_handler.lo modperl_gtop.lo modperl_util.lo modperl_io.lo modperl_io_apache.lo modperl_filter.lo modperl_bucket.lo modperl_mgv.lo modperl_pcw.lo modperl_global.lo modperl_env.lo modperl_cgi.lo modperl_perl.lo modperl_perl_global.lo modperl_perl_pp.lo modperl_sys.lo modperl_module.lo modperl_svptr_table.lo modperl_const.lo modperl_constants.lo modperl_apache_compat.lo modperl_error.lo modperl_debug.lo modperl_common_util.lo modperl_common_log.lo modperl_hooks.lo modperl_directives.lo modperl_flags.lo modperl_xsinit.lo modperl_exports.lo "C:\strawberry\perl\lib\CORE\libperl530.a" "C:\strawberry\c\i686-w64-mingw32\lib\libmoldname.a" "C:\strawberry\c\i686-w64-mingw32\lib\libkernel32.a" "C:\strawberry\c\i686-w64-mingw32\lib\libuser32.a" "C:\strawberry\c\i686-w64-mingw32\lib\libgdi32.a" "C:\strawberry\c\i686-w64-mingw32\lib\libwinspool.a" "C:\strawberry\c\i686-w64-mingw32\lib\libcomdlg32.a" "C:\strawberry\c\i686-w64-mingw32\lib\libadvapi32.a" "C:\strawberry\c\i686-w64-mingw32\lib\libshell32.a" "C:\strawberry\c\i686-w64-mingw32\lib\libole32.a" "C:\strawberry\c\i686-w64-mingw32\lib\liboleaut32.a" "C:\strawberry\c\i686-w64-mingw32\lib\libnetapi32.a" "C:\strawberry\c\i686-w64-mingw32\lib\libuuid.a" "C:\strawberry\c\i686-w64-mingw32\lib\libws2_32.a" "C:\strawberry\c\i686-w64-mingw32\lib\libmpr.a" "C:\strawberry\c\i686-w64-mingw32\lib\libwinmm.a" "C:\strawberry\c\i686-w64-mingw32\lib\libversion.a" "C:\strawberry\c\i686-w64-mingw32\lib\libodbc32.a" "C:\strawberry\c\i686-w64-mingw32\lib\libodbccp32.a" "C:\strawberry\c\i686-w64-mingw32\lib\libcomctl32.a" \
-def:C:/Users/KWS/mod_perl/xs/modperl.def -out:mod_perl.so
C:/strawberry/c/bin/../lib/gcc/i686-w64-mingw32/8.3.0/../../../../i686-w64-mingw32/bin/ld.exe: mod_perl.lo:mod_perl.c:(.text+0x1e7): undefined reference to `_imp__apr_dynamic_fn_register'
C:/strawberry/c/bin/../lib/gcc/i686-w64-mingw32/8.3.0/../../../../i686-w64-mingw32/bin/ld.exe: mod_perl.lo:mod_perl.c:(.text+0x20e): undefined reference to `_imp__ap_server_config_defines'
C:/strawberry/c/bin/../lib/gcc/i686-w64-mingw32/8.3.0/../../../../i686-w64-mingw32/bin/ld.exe: mod_perl.lo:mod_perl.c:(.text+0x21b): undefined reference to `_imp__apr_array_push#4'
C:/strawberry/c/bin/../lib/gcc/i686-w64-mingw32/8.3.0/../../../../i686-w64-mingw32/bin/ld.exe: mod_perl.lo:mod_perl.c:(.text+0x231): undefined reference to `_imp__apr_pstrdup#8'
C:/strawberry/c/bin/../lib/gcc/i686-w64-mingw32/8.3.0/../../../../i686-w64-mingw32/bin/ld.exe: mod_perl.lo:mod_perl.c:(.text+0x25b): undefined reference to `_imp__ap_hook_pre_config#16'
C:/strawberry/c/bin/../lib/gcc/i686-w64-mingw32/8.3.0/../../../../i686-w64-mingw32/bin/ld.exe: mod_perl.lo:mod_perl.c:(.text+0x283): undefined reference to `_imp__ap_hook_open_logs#16'
C:/strawberry/c/bin/../lib/gcc/i686-w64-mingw32/8.3.0/../../../../i686-w64-mingw32/bin/ld.exe: mod_perl.lo:mod_perl.c:(.text+0x2ab): undefined reference to `_imp__ap_hook_post_config#16'
C:/strawberry/c/bin/../lib/gcc/i686-w64-mingw32/8.3.0/../../../../i686-w64-mingw32/bin/ld.exe: mod_perl.lo:mod_perl.c:(.text+0x2b1): undefined reference to `_imp__ap_hook_handler#16'
C:/strawberry/c/bin/../lib/gcc/i686-w64-mingw32/8.3.0/../../../../i686-w64-mingw32/bin/ld.exe: mod_perl.lo:mod_perl.c:(.text+0x2ff): undefined reference to `_imp__ap_hook_insert_filter#16'
C:/strawberry/c/bin/../lib/gcc/i686-w64-mingw32/8.3.0/../../../../i686-w64-mingw32/bin/ld.exe: mod_perl.lo:mod_perl.c:(.text+0x34d): undefined reference to `_imp__ap_register_output_filter#16'
C:/strawberry/c/bin/../lib/gcc/i686-w64-mingw32/8.3.0/../../../../i686-w64-mingw32/bin/ld.exe: mod_perl.lo:mod_perl.c:(.text+0x377): undefined reference to `_imp__ap_register_input_filter#16'
...
C:/strawberry/c/bin/../lib/gcc/i686-w64-mingw32/8.3.0/../../../../i686-w64-mingw32/bin/ld.exe: modperl_module.lo:modperl_module.c:(.text+0x2db2): undefined reference to `_imp__apr_hash_set#16'
C:/strawberry/c/bin/../lib/gcc/i686-w64-mingw32/8.3.0/../../../../i686-w64-mingw32/bin/ld.exe: modperl_module.lo:modperl_module.c:(.text+0x2e6d): undefined reference to `_imp__apr_hash_make#4'
C:/strawberry/c/bin/../lib/gcc/i686-w64-mingw32/8.3.0/../../../../i686-w64-mingw32/bin/ld.exe: modperl_module.lo:modperl_module.c:(.text+0x2efa): undefined reference to `_imp__apr_hash_get#12'
C:/strawberry/c/bin/../lib/gcc/i686-w64-mingw32/8.3.0/../../../../i686-w64-mingw32/bin/ld.exe: modperl_error.lo:modperl_error.c:(.text+0x65): undefined reference to `_imp__apr_strerror#12'
C:/strawberry/c/bin/../lib/gcc/i686-w64-mingw32/8.3.0/../../../../i686-w64-mingw32/bin/ld.exe: modperl_debug.lo:modperl_debug.c:(.text+0x27): undefined reference to `_imp__apr_psprintf'
C:/strawberry/c/bin/../lib/gcc/i686-w64-mingw32/8.3.0/../../../../i686-w64-mingw32/bin/ld.exe: modperl_common_util.lo:modperl_common_util.c:(.text+0x336): undefined reference to `_imp__apr_palloc#8'
C:/strawberry/c/bin/../lib/gcc/i686-w64-mingw32/8.3.0/../../../../i686-w64-mingw32/bin/ld.exe: modperl_common_log.lo:modperl_common_log.c:(.text+0x67): undefined reference to `_imp__apr_os_thread_current#0'
C:/strawberry/c/bin/../lib/gcc/i686-w64-mingw32/8.3.0/../../../../i686-w64-mingw32/bin/ld.exe: modperl_common_log.lo:modperl_common_log.c:(.text+0x8d): undefined reference to `_imp__apr_file_printf'
C:/strawberry/c/bin/../lib/gcc/i686-w64-mingw32/8.3.0/../../../../i686-w64-mingw32/bin/ld.exe: modperl_common_log.lo:modperl_common_log.c:(.text+0xe3): undefined reference to `_imp__apr_vsnprintf#16'
C:/strawberry/c/bin/../lib/gcc/i686-w64-mingw32/8.3.0/../../../../i686-w64-mingw32/bin/ld.exe: modperl_common_log.lo:modperl_common_log.c:(.text+0x104): undefined reference to `_imp__apr_file_write#12'
C:/strawberry/c/bin/../lib/gcc/i686-w64-mingw32/8.3.0/../../../../i686-w64-mingw32/bin/ld.exe: modperl_common_log.lo:modperl_common_log.c:(.text+0x14a): undefined reference to `_imp__apr_file_printf'
C:/strawberry/c/bin/../lib/gcc/i686-w64-mingw32/8.3.0/../../../../i686-w64-mingw32/bin/ld.exe: modperl_hooks.lo:modperl_hooks.c:(.text+0x314): undefined reference to `_imp__ap_hook_process_connection#16'
C:/strawberry/c/bin/../lib/gcc/i686-w64-mingw32/8.3.0/../../../../i686-w64-mingw32/bin/ld.exe: modperl_hooks.lo:modperl_hooks.c:(.text+0x33c): undefined reference to `_imp__ap_hook_open_logs#16'
C:/strawberry/c/bin/../lib/gcc/i686-w64-mingw32/8.3.0/../../../../i686-w64-mingw32/bin/ld.exe: modperl_hooks.lo:modperl_hooks.c:(.text+0x364): undefined reference to `_imp__ap_hook_post_config#16'
C:/strawberry/c/bin/../lib/gcc/i686-w64-mingw32/8.3.0/../../../../i686-w64-mingw32/bin/ld.exe: modperl_hooks.lo:modperl_hooks.c:(.text+0x38c): undefined reference to `_imp__ap_hook_header_parser#16'
C:/strawberry/c/bin/../lib/gcc/i686-w64-mingw32/8.3.0/../../../../i686-w64-mingw32/bin/ld.exe: modperl_hooks.lo:modperl_hooks.c:(.text+0x3b4): undefined reference to `_imp__ap_hook_access_checker#16'
C:/strawberry/c/bin/../lib/gcc/i686-w64-mingw32/8.3.0/../../../../i686-w64-mingw32/bin/ld.exe: modperl_hooks.lo:modperl_hooks.c:(.text+0x47c): undefined reference to `_imp__ap_hook_log_transaction#16'
C:/strawberry/c/bin/../lib/gcc/i686-w64-mingw32/8.3.0/../../../../i686-w64-mingw32/bin/ld.exe: modperl_hooks.lo:modperl_hooks.c:(.text+0x4a4): undefined reference to `_imp__ap_hook_post_read_request#16'
C:/strawberry/c/bin/../lib/gcc/i686-w64-mingw32/8.3.0/../../../../i686-w64-mingw32/bin/ld.exe: modperl_hooks.lo:modperl_hooks.c:(.text+0x4cc): undefined reference to `_imp__ap_hook_translate_name#16'
C:/strawberry/c/bin/../lib/gcc/i686-w64-mingw32/8.3.0/../../../../i686-w64-mingw32/bin/ld.exe: modperl_hooks.lo:modperl_hooks.c:(.text+0x4f4): undefined reference to `_imp__ap_hook_map_to_storage#16'
C:/strawberry/c/bin/../lib/gcc/i686-w64-mingw32/8.3.0/../../../../i686-w64-mingw32/bin/ld.exe: modperl_hooks.lo:modperl_hooks.c:(.text+0x51c): undefined reference to `_imp__ap_hook_pre_connection#16'
C:/strawberry/c/bin/../lib/gcc/i686-w64-mingw32/8.3.0/../../../../i686-w64-mingw32/bin/ld.exe: modperl_hooks.lo:modperl_hooks.c:(.text+0x544): undefined reference to `_imp__ap_hook_child_init#16'
C:/strawberry/c/bin/../lib/gcc/i686-w64-mingw32/8.3.0/../../../../i686-w64-mingw32/bin/ld.exe: modperl_directives.lo:modperl_directives.c:(.text+0x6c): undefined reference to `_imp__apr_pstrcat'
C:/strawberry/c/bin/../lib/gcc/i686-w64-mingw32/8.3.0/../../../../i686-w64-mingw32/bin/ld.exe: modperl_directives.lo:modperl_directives.c:(.text+0x9c): undefined reference to `_imp__apr_pstrcat'
C:/strawberry/c/bin/../lib/gcc/i686-w64-mingw32/8.3.0/../../../../i686-w64-mingw32/bin/ld.exe: modperl_directives.lo:modperl_directives.c:(.text+0x11c): undefined reference to `_imp__apr_pstrcat'
C:/strawberry/c/bin/../lib/gcc/i686-w64-mingw32/8.3.0/../../../../i686-w64-mingw32/bin/ld.exe: modperl_directives.lo:modperl_directives.c:(.text+0x14c): undefined reference to `_imp__apr_pstrcat'
C:/strawberry/c/bin/../lib/gcc/i686-w64-mingw32/8.3.0/../../../../i686-w64-mingw32/bin/ld.exe: modperl_directives.lo:modperl_directives.c:(.text+0x1cc): undefined reference to `_imp__apr_pstrcat'
C:/strawberry/c/bin/../lib/gcc/i686-w64-mingw32/8.3.0/../../../../i686-w64-mingw32/bin/ld.exe: modperl_directives.lo:modperl_directives.c:(.text+0x1fc): more undefined references to `_imp__apr_pstrcat' follow
collect2.exe: error: ld returned 1 exit status
gmake: *** [Makefile:166: mod_perl.so] Error 1
NMAKE : fatal error U1077: „cd”: kod powrotu „0x2”
Stop.
Related
First I downloaded git via git clone https://gitlab.freedesktop.org/gstreamer/gst-template.git command
And shell $ cd gst-template/gst-plugin/src
Completed entering the shell $ ../tools/make_element MyFilter command
And I did meson build in /gst-template, then ninja -C build, so the log came out as below.
ninja: Entering directory `build/'
[1/4] Compiling C object gst-plugin/libgstplugin.so.p/src_gstplugin.c.o
FAILED: gst-plugin/libgstplugin.so.p/src_gstplugin.c.o
cc -Igst-plugin/libgstplugin.so.p -Igst-plugin -I../gst-plugin -I/usr/include/gstreamer-1.0 -I/usr/include/glib-2.0 -I/usr/lib/aarch64-linux-gnu/glib-2.0/include - fdiagnostics-color=always -pipe -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -g -fPIC -pthread -DHAVE_CONFIG_H -MD -MQ gst- plugin/libgstplugin.so.p/src_gstplugin.c.o -MF gst-plugin/libgstplugin.so.p/src_gstplugin.c.o.d -o gst-plugin/libgstplugin.so.p/src_gstplugin.c.o -c ../gst- plugin/src/gstplugin.c
../gst-plugin/src/gstplugin.c:102:45: error: expected ‘)’ before string constant
GST_ELEMENT_REGISTER_DEFINE (myfirstplugin, "myfirstplugin", GST_RANK_NONE,
^~~~~~~~~~
../gst-plugin/src/gstplugin.c: In function ‘plugin_init’:
../gst-plugin/src/gstplugin.c:266:10: warning: implicit declaration of function ‘GST_ELEMENT_REGISTER’; did you mean ‘GST_ELEMENT_CAST’? [-Wimplicit- function-declaration]
return GST_ELEMENT_REGISTER (myfirstplugin, plugin);
^~~~~~~~~
GST_ELEMENT_CAST
../gst-plugin/src/gstplugin.c:266:32: error: ‘myfirstplugin’ undeclared (first use in this function); did you mean ‘GstPlugin’?
return GST_ELEMENT_REGISTER (myfirstplugin, plugin);
^~~~~~~~~~~~~
GstPlugin
../gst-plugin/src/gstplugin.c:266:32: note: each undeclared identifier is reported only once for each function it appears in
../gst-plugin/src/gstplugin.c:267:1: warning: control reaches end of non-void function [-Wreturn-type]
}
^
[2/4] Compiling C object gst-plugin/libgstaudiofilterexample.so.p/src_gstaudiofilter.c.o
FAILED: gst-plugin/libgstaudiofilterexample.so.p/src_gstaudiofilter.c.o
cc -Igst-plugin/libgstaudiofilterexample.so.p -Igst-plugin -I../gst-plugin -I/usr/include/gstreamer-1.0 -I/usr/include/glib-2.0 -I/usr/lib/aarch64-linux-gnu/glib- 2.0/include -I/usr/include/orc-0.4 -fdiagnostics-color=always -pipe -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -g -fPIC -pthread -DHAVE_CONFIG_H -MD -MQ gst-plugin/libgstaudiofilterexample.so.p/src_gstaudiofilter.c.o -MF gst-plugin/libgstaudiofilterexample.so.p/src_gstaudiofilter.c.o.d -o gst- plugin/libgstaudiofilterexample.so.p/src_gstaudiofilter.c.o -c ../gst-plugin/src/gstaudiofilter.c
../gst-plugin/src/gstaudiofilter.c:99:51: error: expected ‘)’ before string constant
GST_ELEMENT_REGISTER_DEFINE (audiofiltertemplate, "audiofiltertemplate",
^~~~~~~~~~~~~~
../gst-plugin/src/gstaudiofilter.c: In function ‘plugin_init’:
../gst-plugin/src/gstaudiofilter.c:311:10: warning: implicit declaration of function ‘GST_ELEMENT_REGISTER’; did you mean ‘GST_ELEMENT_CAST’? [-Wimplicit- function-declaration]
return GST_ELEMENT_REGISTER (audiofiltertemplate, plugin);
^~~~~~~~~
GST_ELEMENT_CAST
../gst-plugin/src/gstaudiofilter.c:311:32: error: ‘audiofiltertemplate’ undeclared (first use in this function); did you mean ‘GstAudioFilterTemplate’?
return GST_ELEMENT_REGISTER (audiofiltertemplate, plugin);
^~~~~~~~~~~~
GstAudioFilterTemplate
../gst-plugin/src/gstaudiofilter.c:311:32: note: each undeclared identifier is reported only once for each function it appears in
../gst-plugin/src/gstaudiofilter.c:312:1: warning: control reaches end of non-void function [-Wreturn-type]
}
^
ninja: build stopped: subcommand failed.
The installed gstreamer version doesn't match to the cloned version from the git repository.
Use gst-launch-1.0 --version to determine which version you have installed.
You need at least 1.18 to use the gst-plugin example.
I'm currently trying to develop a C++ cross-platform project in VSCode which should include the Poco library which I downloaded using vcpkg. I then followed this tutorial: https://www.codeproject.com/Articles/252566/Learning-Poco-GET-with-HTTP but I cannot resolve the undefined references errors that also the article shows.
Here is my main (httpGet.cpp) (which I copied from the link above):
#include <Poco/Net/HTTPClientSession.h>
#include <Poco/Net/HTTPRequest.h>
#include <Poco/Net/HTTPResponse.h>
#include <Poco/StreamCopier.h>
#include <Poco/Path.h>
#include <Poco/URI.h>
#include <Poco/Exception.h>
#include <iostream>
#include <string>
using namespace Poco::Net;
using namespace Poco;
using namespace std;
int main(int argc, char **argv)
{
if (argc != 2)
{
cout << "Usage: " << argv[0] << " <uri>" << endl;
cout << " fetches the resource identified by <uri> and print it" << endl;
return -1;
}
try
{
// prepare session
URI uri(argv[1]);
HTTPClientSession session(uri.getHost(), uri.getPort());
// prepare path
string path(uri.getPathAndQuery());
if (path.empty()) path = "/";
// send request
HTTPRequest req(HTTPRequest::HTTP_GET, path, HTTPMessage::HTTP_1_1);
session.sendRequest(req);
// get response
HTTPResponse res;
cout << res.getStatus() << " " << res.getReason() << endl;
// print response
istream &is = session.receiveResponse(res);
StreamCopier::copyStream(is, cout);
}
catch (Exception &ex)
{
cerr << ex.displayText() << endl;
return -1;
}
return 0;
}
Here is my CMakeLists.txt:
cmake_minimum_required(VERSION 3.16)
set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(PocoNet_DIR "C:/vcpkg/installed/x64-windows/share/poco")
set(PocoFoundation_DIR "C:/vcpkg/installed/x64-windows/share/poco")
set(VCPKG_TARGET_TRIPLET "x64-windows"
CACHE STRING "")
set(CMAKE_TOOLCHAIN_FILE "C:/vcpkg/scripts/buildsystems/vcpkg.cmake"
CACHE STRING "")
project(TryPOCO)
find_package(Poco CONFIG REQUIRED Net)
find_package(PocoNet REQUIRED)
include_directories("C:/vcpkg/installed/x64-windows/include")
link_directories("C:/vcpkg/installed/x64-windows/lib")
add_executable(${PROJECT_NAME} httpGet.cpp)
target_link_libraries(${PROJECT_NAME} PRIVATE PocoNet)
And here is the error I get:
[build] CMakeFiles\TryPOCO.dir/objects.a(httpGet.cpp.obj): In function `main':
[build] C:/TesiMag/ProveVSCode/TryPOCO/httpGet.cpp:27: undefined reference to `Poco::URI::URI(char const*)'
[build] C:/TesiMag/ProveVSCode/TryPOCO/httpGet.cpp:28: undefined reference to `Poco::URI::getPort() const'
[build] C:/TesiMag/ProveVSCode/TryPOCO/httpGet.cpp:28: undefined reference to `Poco::Net::HTTPClientSession::HTTPClientSession(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, unsigned short)'
[build] C:/TesiMag/ProveVSCode/TryPOCO/httpGet.cpp:31: undefined reference to `Poco::URI::getPathAndQuery[abi:cxx11]() const'
[build] C:/TesiMag/ProveVSCode/TryPOCO/httpGet.cpp:35: undefined reference to `Poco::Net::HTTPRequest::HTTPRequest(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'
[build] C:/TesiMag/ProveVSCode/TryPOCO/httpGet.cpp:36: undefined reference to `Poco::Net::HTTPClientSession::sendRequest(Poco::Net::HTTPRequest&)'
[build] C:/TesiMag/ProveVSCode/TryPOCO/httpGet.cpp:39: undefined reference to `Poco::Net::HTTPResponse::HTTPResponse()'
[build] C:/TesiMag/ProveVSCode/TryPOCO/httpGet.cpp:43: undefined reference to `Poco::Net::HTTPClientSession::receiveResponse(Poco::Net::HTTPResponse&)'
[build] C:/TesiMag/ProveVSCode/TryPOCO/httpGet.cpp:44: undefined reference to `Poco::StreamCopier::copyStream(std::istream&, std::ostream&, unsigned long long)'
[build] C:/TesiMag/ProveVSCode/TryPOCO/httpGet.cpp:39: undefined reference to `Poco::Net::HTTPResponse::~HTTPResponse()'
[build] C:/TesiMag/ProveVSCode/TryPOCO/httpGet.cpp:35: undefined reference to `Poco::Net::HTTPRequest::~HTTPRequest()'
[build] C:/TesiMag/ProveVSCode/TryPOCO/httpGet.cpp:28: undefined reference to `Poco::Net::HTTPClientSession::~HTTPClientSession()'
[build] C:/TesiMag/ProveVSCode/TryPOCO/httpGet.cpp:27: undefined reference to `Poco::URI::~URI()'
[build] C:/TesiMag/ProveVSCode/TryPOCO/httpGet.cpp:39: undefined reference to `Poco::Net::HTTPResponse::~HTTPResponse()'
[build] C:/TesiMag/ProveVSCode/TryPOCO/httpGet.cpp:35: undefined reference to `Poco::Net::HTTPRequest::~HTTPRequest()'
[build] C:/TesiMag/ProveVSCode/TryPOCO/httpGet.cpp:28: undefined reference to `Poco::Net::HTTPClientSession::~HTTPClientSession()'
[build] C:/TesiMag/ProveVSCode/TryPOCO/httpGet.cpp:27: undefined reference to `Poco::URI::~URI()'
[build] C:/TesiMag/ProveVSCode/TryPOCO/httpGet.cpp:48: undefined reference to `Poco::Exception::displayText[abi:cxx11]() const'
[build] CMakeFiles\TryPOCO.dir/objects.a(httpGet.cpp.obj): In function `Poco::Net::Impl::IPv4SocketAddressImpl::host() const':
[build] C:/vcpkg/installed/x64-windows/include/Poco/Net/SocketAddressImpl.h:81: undefined reference to `Poco::Net::IPAddress::IPAddress(void const*, int)'
[build] CMakeFiles\TryPOCO.dir/objects.a(httpGet.cpp.obj): In function `Poco::Net::Impl::IPv6SocketAddressImpl::host() const':
[build] C:/vcpkg/installed/x64-windows/include/Poco/Net/SocketAddressImpl.h:143: undefined reference to `Poco::Net::IPAddress::IPAddress(void const*, int, unsigned int)'
[build] CMakeFiles\TryPOCO.dir/objects.a(httpGet.cpp.obj):httpGet.cpp:(.rdata$_ZTVN4Poco3Net4Impl21IPv6SocketAddressImplE[_ZTVN4Poco3Net4Impl21IPv6SocketAddressImplE]+0x50): undefined reference to `Poco::Net::Impl::IPv6SocketAddressImpl::toString[abi:cxx11]() const'
[build] CMakeFiles\TryPOCO.dir/objects.a(httpGet.cpp.obj): In function `Poco::Net::Impl::IPv6SocketAddressImpl::~IPv6SocketAddressImpl()':
[build] C:/vcpkg/installed/x64-windows/include/Poco/Net/SocketAddressImpl.h:118: undefined reference to `Poco::Net::Impl::SocketAddressImpl::~SocketAddressImpl()'
[build] CMakeFiles\TryPOCO.dir/objects.a(httpGet.cpp.obj):httpGet.cpp:(.rdata$_ZTVN4Poco3Net4Impl21IPv4SocketAddressImplE[_ZTVN4Poco3Net4Impl21IPv4SocketAddressImplE]+0x50): undefined reference to `Poco::Net::Impl::IPv4SocketAddressImpl::toString[abi:cxx11]() const'
[build] CMakeFiles\TryPOCO.dir/objects.a(httpGet.cpp.obj): In function `Poco::Net::Impl::IPv4SocketAddressImpl::~IPv4SocketAddressImpl()':
[build] C:/vcpkg/installed/x64-windows/include/Poco/Net/SocketAddressImpl.h:56: undefined reference to `Poco::Net::Impl::SocketAddressImpl::~SocketAddressImpl()'
[build] CMakeFiles\TryPOCO.dir/objects.a(httpGet.cpp.obj):httpGet.cpp:(.rdata$.refptr._ZN4Poco3Net11HTTPRequest8HTTP_GETB5cxx11E[.refptr._ZN4Poco3Net11HTTPRequest8HTTP_GETB5cxx11E]+0x0): undefined reference to `Poco::Net::HTTPRequest::HTTP_GET[abi:cxx11]'
[build] CMakeFiles\TryPOCO.dir/objects.a(httpGet.cpp.obj):httpGet.cpp:(.rdata$.refptr._ZN4Poco3Net11HTTPMessage8HTTP_1_1B5cxx11E[.refptr._ZN4Poco3Net11HTTPMessage8HTTP_1_1B5cxx11E]+0x0): undefined reference to `Poco::Net::HTTPMessage::HTTP_1_1[abi:cxx11]'
[build] collect2.exe: error: ld returned 1 exit status
[build] mingw32-make.exe[2]: *** [CMakeFiles\TryPOCO.dir\build.make:86: TryPOCO.exe] Error 1
[build] mingw32-make.exe[1]: *** [CMakeFiles\Makefile2:75: CMakeFiles/TryPOCO.dir/all] Error 2
[build] mingw32-make.exe: *** [Makefile:83: all] Error 2
[build] Compilazione terminata con codice di uscita 2
The compiler I am using is g++ (x86_64-posix-seh-rev0, Built by MinGW-W64 project) 8.1.0.
I suppose it's a linker error, but I am new to CMake so I don't really know if there are any other libraries that I should add to target_link_libraries or somewhere else in the CMakeLists.txt.
Also I don't know if the CMakeLists.txt is written in a good manner since it's the first time ever I use CMake.
Thank you in advance for your answers.
I think you need a find_library in CMakeLists.txt.
See https://cmake.org/cmake/help/cmake2.6docs.html#command:find_library
I'm trying to build the C driver with Kerberos support, from
mongo-c-driver-1.10.3.tar.gz. I'm on Ubuntu 16.04, 64-bit Intel, with gcc
5.4.0. I run CMake like::
$ cmake -DENABLE_AUTOMATIC_INIT_AND_CLEANUP=OFF ..
...
-- Build files have been written to: /home/glt/tools/new_mongo/mongo-c-driver-1.10.3/cmake-build
looks like cmake succussfully, but when i excute 'make', i failed.
$ make
Scanning dependencies of target bson_static
...
[ 39%] Building C object src/libmongoc/CMakeFiles/mongoc_shared.dir/src/mongoc/mongoc-openssl.c.o
/home/glt/tools/new_mongo/mongo-c-driver-1.10.3/src/libmongoc/src/mongoc/mongoc-openssl.c: In function ¡®_mongoc_openssl_check_cert¡¯:
/home/glt/tools/new_mongo/mongo-c-driver-1.10.3/src/libmongoc/src/mongoc/mongoc-openssl.c:314:16: warning: ¡®ASN1_STRING_data¡¯ is deprecated [-Wdeprecated-declarations]
check = (const char *) ASN1_STRING_get0_data (name->d.ia5);
^
In file included from /home/glt/miniconda3/include/openssl/e_os2.h:13:0,
from /home/glt/miniconda3/include/openssl/bio.h:13,
from /home/glt/tools/new_mongo/mongo-c-driver-1.10.3/src/libmongoc/src/mongoc/mongoc-openssl.c:23:
/home/glt/miniconda3/include/openssl/asn1.h:554:35: note: declared here
DEPRECATEDIN_1_1_0(unsigned char *ASN1_STRING_data(ASN1_STRING *x))
^
/home/glt/miniconda3/include/openssl/opensslconf.h:115:37: note: in definition of macro ¡®DECLARE_DEPRECATED¡¯
# define DECLARE_DEPRECATED(f) f __attribute__ ((deprecated));
^
/home/glt/miniconda3/include/openssl/asn1.h:554:1: note: in expansion of macro ¡®DEPRECATEDIN_1_1_0¡¯
DEPRECATEDIN_1_1_0(unsigned char *ASN1_STRING_data(ASN1_STRING *x))
^
[ 39%] Building C object src/libmongoc/CMakeFiles/mongoc_shared.dir/src/mongoc/mongoc-cluster-sasl.c.o
[ 39%] Building C object src/libmongoc/CMakeFiles/mongoc_shared.dir/src/mongoc/mongoc-sasl.c.o
[ 39%] Building C object src/libmongoc/CMakeFiles/mongoc_shared.dir/src/mongoc/mongoc-cluster-cyrus.c.o
[ 40%] Building C object src/libmongoc/CMakeFiles/mongoc_shared.dir/src/mongoc/mongoc-cyrus.c.o
[ 40%] Linking C shared library libmongoc-1.0.so
[ 40%] Built target mongoc_shared
Scanning dependencies of target example-client
[ 40%] Building C object src/libmongoc/CMakeFiles/example-client.dir/examples/example-client.c.o
[ 40%] Linking C executable example-client
libmongoc-1.0.so.0.0.0: undefined reference to `OPENSSL_sk_num'
libmongoc-1.0.so.0.0.0: undefined reference to `BIO_meth_set_gets'
libmongoc-1.0.so.0.0.0: undefined reference to `BIO_meth_set_puts'
libmongoc-1.0.so.0.0.0: undefined reference to `__cxa_begin_catch'
libmongoc-1.0.so.0.0.0: undefined reference to `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::resize(unsigned long)'
libmongoc-1.0.so.0.0.0: undefined reference to `BIO_set_data'
libmongoc-1.0.so.0.0.0: undefined reference to `operator delete[](void*)'
libmongoc-1.0.so.0.0.0: undefined reference to `operator new(unsigned long)'
libmongoc-1.0.so.0.0.0: undefined reference to `BIO_set_init'
libmongoc-1.0.so.0.0.0: undefined reference to `OPENSSL_init_ssl'
libmongoc-1.0.so.0.0.0: undefined reference to `TLS_method'
libmongoc-1.0.so.0.0.0: undefined reference to `std::__throw_length_error(char const*)'
libmongoc-1.0.so.0.0.0: undefined reference to `operator delete(void*)'
libmongoc-1.0.so.0.0.0: undefined reference to `BIO_meth_free'
libmongoc-1.0.so.0.0.0: undefined reference to `operator new[](unsigned long)'
libmongoc-1.0.so.0.0.0: undefined reference to `__cxa_pure_virtual'
libmongoc-1.0.so.0.0.0: undefined reference to `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::begin()'
libmongoc-1.0.so.0.0.0: undefined reference to `__gxx_personality_v0'
libmongoc-1.0.so.0.0.0: undefined reference to `OPENSSL_sk_value'
libmongoc-1.0.so.0.0.0: undefined reference to `BIO_meth_set_destroy'
libmongoc-1.0.so.0.0.0: undefined reference to `BIO_meth_set_write'
libmongoc-1.0.so.0.0.0: undefined reference to `std::__throw_bad_alloc()'
libmongoc-1.0.so.0.0.0: undefined reference to `BIO_meth_set_read'
libmongoc-1.0.so.0.0.0: undefined reference to `OPENSSL_init_crypto'
libmongoc-1.0.so.0.0.0: undefined reference to `SSL_CTX_set_options'
libmongoc-1.0.so.0.0.0: undefined reference to `__cxa_end_catch'
libmongoc-1.0.so.0.0.0: undefined reference to `EVP_MD_CTX_free'
libmongoc-1.0.so.0.0.0: undefined reference to `vtable for __cxxabiv1::__class_type_info'
libmongoc-1.0.so.0.0.0: undefined reference to `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::empty() const'
libmongoc-1.0.so.0.0.0: undefined reference to `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::max_size() const'
libmongoc-1.0.so.0.0.0: undefined reference to `BIO_get_data'
libmongoc-1.0.so.0.0.0: undefined reference to `BIO_meth_new'
libmongoc-1.0.so.0.0.0: undefined reference to `EVP_MD_CTX_new'
libmongoc-1.0.so.0.0.0: undefined reference to `BIO_meth_set_create'
libmongoc-1.0.so.0.0.0: undefined reference to `__cxa_rethrow'
libmongoc-1.0.so.0.0.0: undefined reference to `BIO_meth_set_ctrl'
libmongoc-1.0.so.0.0.0: undefined reference to `vtable for __cxxabiv1::__si_class_type_info'
collect2: error: ld returned 1 exit status
src/libmongoc/CMakeFiles/example-client.dir/build.make:103: recipe for target 'src/libmongoc/example-client' failed
make[2]: *** [src/libmongoc/example-client] Error 1
CMakeFiles/Makefile2:707: recipe for target 'src/libmongoc/CMakeFiles/example-client.dir/all' failed
make[1]: *** [src/libmongoc/CMakeFiles/example-client.dir/all] Error 2
Makefile:149: recipe for target 'all' failed
make: *** [all] Error 2
I am going to install libmongoc, but I am getting an error libmongoc-1.0.so.0.0.0: undefined reference to during the process.
Can you tell me what I need to install? Thanks!
I am running Windows7 and Strawberry Perl 5.26.0.1
I try to install:
cpan Math::Random::MTwist
"C:\Perl64\strawberry\perl\bin\perl.exe" -MExtUtils::Mksymlists \
-e "Mksymlists('NAME'=>\"Math::Random::MTwist\", 'DLBASE' => 'MTwist', 'DL_FUNCS' => { }, 'FUNCLIST' => [], 'IMPORTS' => { }, 'DL_VARS' => []);"
g++ MTwist.def -o blib\arch\auto\Math\Random\MTwist\MTwist.xs.dll -mdll -s -L"C:\Perl64\STRAWB~1\perl\lib\CORE" -L"C:\Perl64\STRAWB~1\c\lib" MTwist.o "C:\Perl64\STRAWB~1\perl\lib\CORE\libperl526.a" -lmoldname -lkernel32 -luser32 -lgdi32 -lwinspool -lcomdlg32 -ladvapi32 -lshell32 -lole32 -loleaut32 -lnetapi32 -luuid -lws2_32 -lmpr -lwinmm -lversion -lodbc32 -lodbccp32 -lcomctl32 -Wl,--enable-auto-image-base
MTwist.o:MTwist.c:(.text+0x15): undefined reference to `_imp__Perl_get_context'
MTwist.o:MTwist.c:(.text+0x59): undefined reference to `_imp__Perl_sv_2pv_flags'
...
MTwist.o:MTwist.c:(.text+0x6ce2): undefined reference to `_imp__Perl_xs_boot_epilog'
collect2: ld returned 1 exit status
gmake: *** [Makefile:490: blib\arch\auto\Math\Random\MTwist\MTwist.xs.dll] Error 1
-> FAIL Installing Math::Random::MTwist failed. See C:\Users\mschmidt\.cpanm\work\1500562766.20452\build.log for details. Retry with --force to force install it.
Any ideas what goes wrong?
I want to convert shpfile to osm file
so I will running the 【osm2shp】
but when I make it
the error show:
osm.c:(.text+0x82c): undefined reference to `xmlAddChild'
osm.c:(.text+0x869): undefined reference to `xmlAddChild'
osm.c:(.text+0x95c): undefined reference to `xmlAddChild'
osm.o:osm.c:(.text+0x992): more undefined references to `xmlAddChild' follow
osm.o: In function `createXmlDoc':
osm.c:(.text+0xafc): undefined reference to `xmlNewDoc'
osm.c:(.text+0xb0f): undefined reference to `xmlNewNode'
osm.c:(.text+0xb31): undefined reference to `xmlNewProp'
osm.c:(.text+0xb44): undefined reference to `xmlDocSetRootElement'
shp2osm.o: In function `main':
shp2osm.c:(.text+0x40d): undefined reference to `xmlSaveFormatFileEnc'
shp2osm.c:(.text+0x419): undefined reference to `xmlFreeDoc'
collect2: error: ld returned 1 exit status
make: *** [shp2osm] Error 1
I guess it connect the libxml2,but I don't know how to solve thisproblem
here is detail :
jin#ubuntu:~/Desktop/osmutils-master$ make
gcc -c -Wall `xml2-config --cflags --libs` -lproj transform.c
gcc -c -Wall `xml2-config --cflags --libs` -lproj ruleset.c
gcc -c -Wall `xml2-config --cflags --libs` -lproj osm.c
osm.c: In function ‘tagElement’:
osm.c:80:8: warning: variable ‘key’ set but not used [-Wunused-but-set-variable]
char *key;
^
gcc -c -Wall `xml2-config --cflags --libs` -lproj shape.c
gcc -c -Wall `xml2-config --cflags --libs` -lproj shp2osm.c
gcc -Wall `xml2-config --cflags --libs` -lproj -o shp2osm dbfopen.o shpopen.o keyvals.o transform.o ruleset.o osm.o shape.o shp2osm.o
transform.o: In function `sridIsValid':
transform.c:(.text+0x4c): undefined reference to `pj_init_plus'
transform.c:(.text+0x69): undefined reference to `pj_init_plus'
transform.o: In function `transformPoint':
transform.c:(.text+0xe7): undefined reference to `pj_transform'
osm.o: In function `tagElement':
osm.c:(.text+0x285): undefined reference to `xmlNewNode'
osm.c:(.text+0x2b1): undefined reference to `xmlNewProp'
osm.c:(.text+0x2d9): undefined reference to `xmlNewProp'
osm.o: In function `nodeElement':
osm.c:(.text+0x33b): undefined reference to `xmlNewNode'
osm.c:(.text+0x365): undefined reference to `xmlNewProp'
osm.c:(.text+0x393): undefined reference to `xmlNewProp'
osm.c:(.text+0x3c1): undefined reference to `xmlNewProp'
osm.o: In function `nodeRef':
osm.c:(.text+0x3de): undefined reference to `xmlNewNode'
osm.c:(.text+0x408): undefined reference to `xmlNewProp'
osm.o: In function `wayElement':
osm.c:(.text+0x428): undefined reference to `xmlNewNode'
osm.c:(.text+0x452): undefined reference to `xmlNewProp'
osm.o: In function `buildNodes':
osm.c:(.text+0x606): undefined reference to `xmlAddChild'
osm.c:(.text+0x63c): undefined reference to `xmlAddChild'
osm.o: In function `parseLine':
osm.c:(.text+0x82c): undefined reference to `xmlAddChild'
osm.c:(.text+0x869): undefined reference to `xmlAddChild'
osm.c:(.text+0x95c): undefined reference to `xmlAddChild'
osm.o:osm.c:(.text+0x992): more undefined references to `xmlAddChild' follow
osm.o: In function `createXmlDoc':
osm.c:(.text+0xafc): undefined reference to `xmlNewDoc'
osm.c:(.text+0xb0f): undefined reference to `xmlNewNode'
osm.c:(.text+0xb31): undefined reference to `xmlNewProp'
osm.c:(.text+0xb44): undefined reference to `xmlDocSetRootElement'
shp2osm.o: In function `main':
shp2osm.c:(.text+0x40d): undefined reference to `xmlSaveFormatFileEnc'
shp2osm.c:(.text+0x419): undefined reference to `xmlFreeDoc'
collect2: error: ld returned 1 exit status
make: *** [shp2osm] Error 1
This is essentially a duplicate of Error while linking libxml2. The order of arguments in the link command is wrong. Libraries must go after object files. You should open an issue, probably here on GitHub.