Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1rr5t7-00FeZM-TS for pgsql-hackers@arkaria.postgresql.org; Mon, 01 Apr 2024 00:51:02 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1rr5t6-00E2pN-QA for pgsql-hackers@arkaria.postgresql.org; Mon, 01 Apr 2024 00:51:00 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1rr5q0-00Dywz-OP for pgsql-hackers@lists.postgresql.org; Mon, 01 Apr 2024 00:47:48 +0000 Received: from mail-ed1-x534.google.com ([2a00:1450:4864:20::534]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1rr5px-007Whq-34 for pgsql-hackers@lists.postgresql.org; Mon, 01 Apr 2024 00:47:47 +0000 Received: by mail-ed1-x534.google.com with SMTP id 4fb4d7f45d1cf-56845954ffeso4975031a12.2 for ; Sun, 31 Mar 2024 17:47:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1711932464; x=1712537264; darn=lists.postgresql.org; h=to:subject:message-id:date:from:mime-version:from:to:cc:subject :date:message-id:reply-to; bh=ivKI+AqaidYybF0WNS+JXuTOeVv7He1xh+IMTpsQUpc=; b=TdfbDRVA8XOmq4Zn1wC69UdRALkRkNzP3kbVMM8sfE2RpbmjSV1xdGKAfkd+tdz1/o QYfW46zrhK8MNSz7hwLFLk90KXPr5YDBNC++7YKZDBRyiMc8RUUIgV0c9R7mNqGBrm2g IC9ugHkqgc+97qYCBLw4xZbU2H7r+qDrKRso9/5O68quhrsKO0daVcEMFBwbudvff7H6 c13O+C92eNWy13/MR+NszX+dYWafIN3vx6ZAfxdbQn6J6kGOd1kQhdbdC4NUPfMKuhtI mLju0t1sdqZX2iBiDnH1BpiJLu1lJCKupYqzVyEatwiB8+9gq9xvpz9VrzQh3V/+68hm yZdQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1711932464; x=1712537264; h=to:subject:message-id:date:from:mime-version:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=ivKI+AqaidYybF0WNS+JXuTOeVv7He1xh+IMTpsQUpc=; b=oXUQmoUWyuCZRvHBjtyFr5qlb3NK+VYlK9czBK/xnTA1w17wa62PMdscjZMfJHydz4 4FqFkRWmrAIv0mMjZh2b8BjLoSz1NT3L5gb1KKL/PVhSs/Wwz4oCdG2pY+Tk4LnU+Wj4 HSTMVAjKxABoruHg8WVqdyw140aLBS2WJeGw/ZCJwYqLDXTkfsZEV3pPn3UQrqJHz0o0 QPlAxQ/2elAH92HjuyqloBAqg4tI0tkkF42pQm3urFSDbxBNWJ0HKk4Sjh5WS+IfDtkb TLrgKQ3hJiV3xfk8+lW8vrjfy3+anX9HP95hJlqdNH5ovcNaWJo+DrwYY//Q0Zs/TnI3 389A== X-Gm-Message-State: AOJu0Yy8Mwiqx8nABdICVBhc2huuqzK+p2NhtQzZmAo7YgUxUgFm/LsV YGIiSayGcfXbd7ixdUGbbL51zHS+gRiDchUZZcsTsAmbyatKePvkrQlpEYGXPRnXGeQlsBb/T8q 11hJivG/AtZQtJ6l79qKAAs1tdjlhg5aTzlrQuQ== X-Google-Smtp-Source: AGHT+IGzzFz3Jt1dASmJFf8+gp51xauXdUYPF8lZPDzvpshoxAzNUE3+pKv7XKBy90FvCXKbvoNRE+hTQCyHL1CBKpM= X-Received: by 2002:a17:907:1b21:b0:a4e:3715:7f4a with SMTP id mp33-20020a1709071b2100b00a4e37157f4amr6153485ejc.71.1711932464442; Sun, 31 Mar 2024 17:47:44 -0700 (PDT) MIME-Version: 1.0 From: Tony Wayne Date: Mon, 1 Apr 2024 06:17:33 +0530 Message-ID: Subject: Cant link libpq with a pg extension using cmake To: pgsql-hackers@lists.postgresql.org Content-Type: multipart/alternative; boundary="0000000000006c361f0614fe56a0" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --0000000000006c361f0614fe56a0 Content-Type: text/plain; charset="UTF-8" i am getting linking issues when trying to link libpq with my pg extension and i am using pg's libpq ,so libpq is built along with pg,so i did this in my extension's cmakelists.txt file (GLOB storage_SRC CONFIGURE_DEPENDS "*.cpp" ) add_library(storage OBJECT ${storage_SRC}) target_link_libraries(storage PRIVATE pq) btw included all required include dirs in my toplevel cmakelists.txt then i got undefined symbol: pqsecure_write but don't know why if i give the pg_config --libdir/libpq.a path in target_link_libraries instead of lib name then it links but walreceiver process cant start and i get FATAL: could not connect to the primary server: libpq is incorrectly linked to backend functions --0000000000006c361f0614fe56a0 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
i am getting linking issues when trying to link libpq with my pg = extension and i am using pg's libpq ,so libpq is built along with pg,so= i did this in my extension's cmakelists.txt

file (GLOB storage_SRC CONFIGURE_DEPENDS "*.cpp" )
add_li= brary(storage OBJECT ${storage_SRC})
target_link_libraries(storage PRIV= ATE pq)=C2=A0

btw included all required inclu= de dirs in my toplevel cmakelists.txt

then i = got undefined symbol: pqsecure_write but don't know why if i give the p= g_config --libdir/libpq.a path in target_link_libraries instead of lib name= =C2=A0then it links but walreceiver process cant start and i get FATAL: cou= ld not connect to the primary server: libpq is incorrectly linked to backen= d functions
--0000000000006c361f0614fe56a0--