As linuxMint is based on Debian, I assume the paths and files are the same in your system
jordi@debian:/etc$ ll ld.so.conf
-rw-r--r-- 1 root root 34 Jul 29 2019 ld.so.conf
jordi@debian:/etc$ cat ld.so.conf
include /etc/ld.so.conf.d/*.conf
jordi@debian:/etc$ cd ld.so.conf.d/
jordi@debian:/etc/ld.so.conf.d$ ll
total 16
-rw-r--r-- 1 root root 38 Nov 10 2020 fakeroot-x86_64-linux-gnu.conf
-rw-r--r-- 1 root root 44 Jul 29 2019 libc.conf
-rw-r--r-- 1 root root 100 May 1 2021 x86_64-linux-gnu.conf
-rw-r--r-- 1 root root 56 Oct 2 2021 zz_i386-biarch-compat.conf
jordi@debian:/etc/ld.so.conf.d$ cat libc.conf
# libc default configuration
/usr/local/lib
Create a .conf file for opencv and add the path where the libraries are (as the content in libc.conf file)
Command to update changes done in configuration files (you will need super-user privileges).
sudo /usr/sbin/ldconfig -v
Maybe it doesn't work for you. Search how to execute commands as superuser in linuxMint
Example: command to see all the dynamic libraries whick contains the "open" word
jordi@debian:/etc/ld.so.conf.d$ /usr/sbin/ldconfig -p | grep -i open
libopensc.so.7 (libc6,x86-64) => /lib/x86_64-linux-gnu/libopensc.so.7
libopenmpt.so.0 (libc6,x86-64) => /lib/x86_64-linux-gnu/libopenmpt.so.0
libopenjp2.so.7 (libc6,x86-64) => /lib/x86_64-linux-gnu/libopenjp2.so.7
libopencore-amrwb.so.0 (libc6,x86-64) => /lib/x86_64-linux-gnu/libopencore-amrwb.so.0
libopencore-amrnb.so.0 (libc6,x86-64) => /lib/x86_64-linux-gnu/libopencore-amrnb.so.0
libopenal.so.1 (libc6,x86-64) => /lib/x86_64-linux-gnu/libopenal.so.1
libOpenNI2.so.0 (libc6,x86-64) => /lib/x86_64-linux-gnu/libOpenNI2.so.0
libOpenGL.so.0 (libc6,x86-64) => /lib/x86_64-linux-gnu/libOpenGL.so.0
libOpenGL.so (libc6,x86-64) => /lib/x86_64-linux-gnu/libOpenGL.so
libOpenCL.so.1 (libc6,x86-64) => /lib/x86_64-linux-gnu/libOpenCL.so.1
As you said yourself, your application does compile fine, so you don't have a compile time problem. You have a runtime problem. Changing the compiler configuration will do nothing, because your application is not RUN by the compiler but by your OS, Linux in your case.
Actually, your problem is not a CodeBlocks problem but a Linux problem, so technically offtopic here. If you stop beeing so ignorant you still might get some help here.
There are multiple ways to configure the Linux dynamic library loader. If you install libraries with the package manager this should not be necessary and should just work, so the first question is, how did you actually get OpenCV on your system? Second question is, is it really OpenCV that is missing or might this library itself miss something else? To answer that question, run ldd <your-application-binary-goes-here>
and post the output.