Received: from malur.postgresql.org ([2a02:16a8:dc51::56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1fsBRn-0000vW-T6 for pgsql-general@arkaria.postgresql.org; Tue, 21 Aug 2018 18:32:08 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1fsBRl-0007vg-KT for pgsql-general@arkaria.postgresql.org; Tue, 21 Aug 2018 18:32:05 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1fsBRf-0007Ng-AP for pgsql-general@lists.postgresql.org; Tue, 21 Aug 2018 18:31:59 +0000 Received: from n3.nabble.com ([162.255.23.22]) by makus.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1fsBRc-0000ZJ-25 for pgsql-general@postgresql.org; Tue, 21 Aug 2018 18:31:57 +0000 Received: from n3.nabble.com (localhost [127.0.0.1]) by n3.nabble.com (Postfix) with ESMTP id ABE08EAE62E2 for ; Tue, 21 Aug 2018 11:31:54 -0700 (MST) Date: Tue, 21 Aug 2018 11:31:54 -0700 (MST) From: TalGloz To: pgsql-general@postgresql.org Message-ID: <1534876314698-0.post@n3.nabble.com> In-Reply-To: <30248.1534706191@sss.pgh.pa.us> References: <1534676183995-0.post@n3.nabble.com> <1534680422044-0.post@n3.nabble.com> <2455c526-58ab-4f2b-a9c0-f2b2890ca365@manitou-mail.org> <1534704516779-0.post@n3.nabble.com> <30248.1534706191@sss.pgh.pa.us> Subject: Re: Linker errors while creating a PostgreSQL C extension function. MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Hallo Do you or anyone know why is it trying to link with -L/usr/lib64 path and not -L/usr/local/lib as provided? After recompiling the libseal.a with the -fPIC flag and copying it manually from /usr/local/lib/ to /usr/lib64/ I get those errors: g++ -Wl,--no-undefined -shared -o seal_diff_cpp.so seal_diff_cpp.o -L/usr/pgsql-10/lib -L/usr/lib64 -Wl,--as-needed -Wl,-rpath,'/usr/pgsql-10/lib',--enable-new-dtags -L/usr/local/lib -lseal -pthread seal_diff_cpp.o: In function `seal_diff_cpp': /etc/opt/pgsql_c_functions/CPP/seal_extension/seal_diff_cpp.cpp:106: undefined reference to `pg_detoast_datum_packed' /etc/opt/pgsql_c_functions/CPP/seal_extension/seal_diff_cpp.cpp:107: undefined reference to `pg_detoast_datum_packed' /etc/opt/pgsql_c_functions/CPP/seal_extension/seal_diff_cpp.cpp:108: undefined reference to `pg_detoast_datum_packed' /etc/opt/pgsql_c_functions/CPP/seal_extension/seal_diff_cpp.cpp:112: undefined reference to `text_to_cstring' /etc/opt/pgsql_c_functions/CPP/seal_extension/seal_diff_cpp.cpp:113: undefined reference to `text_to_cstring' /etc/opt/pgsql_c_functions/CPP/seal_extension/seal_diff_cpp.cpp:114: undefined reference to `text_to_cstring' /etc/opt/pgsql_c_functions/CPP/seal_extension/seal_diff_cpp.cpp:130: undefined reference to `cstring_to_text_with_len' Did I miss something in one of my files? Best regards, Tal -- Sent from: http://www.postgresql-archive.org/PostgreSQL-general-f1843780.html