Related
I am trying to use SimpleSAMLphp in AWS ubuntu instance but for some reason I can make it run correctly. I am using AWS-LoadBalancer for https, I do not know if it affect the configuration.
config.php
$config = array(
'baseurlpath' => 'simplesaml/',
'certdir' => 'cert/',
'loggingdir' => 'log/',
'datadir' => 'data/',
'tempdir' => '/tmp/simplesaml',
'technicalcontact_name' => 'David Pacheco',
'technicalcontact_email' => 'dpacheco#lumstons.com',
'timezone' => 'America/Mexico_City',
'secretsalt' => '6ogT+0kPWJAO6FbKThWcI1spujbVVdmFEsPVRiPKEWw=',
'auth.adminpassword' => 'david',
'admin.protectindexpage' => false,
'admin.protectmetadata' => false,
'admin.checkforupdates' => true,
'trusted.url.domains' => array(),
'trusted.url.regex' => false,
'enable.http_post' => false,
'debug' => array(
'saml' => false,
'backtraces' => true,
'validatexml' => false,
),
'showerrors' => true,
'errorreporting' => true,
'logging.level' => SimpleSAML\Logger::NOTICE,
'logging.handler' => 'syslog',
'logging.facility' => defined('LOG_LOCAL5') ? constant('LOG_LOCAL5') : LOG_USER,
'logging.processname' => 'simplesamlphp',
'logging.logfile' => 'simplesamlphp.log',
'statistics.out' => array(
),
'proxy' => null,
'database.dsn' => 'mysql:host=localhost;dbname=saml',
'database.username' => 'simplesamlphp',
'database.password' => 'secret',
'database.options' => array(),
'database.prefix' => '',
'database.persistent' => false,
'database.slaves' => array(
),
'enable.saml20-idp' => false,
'enable.shib13-idp' => false,
'enable.adfs-idp' => false,
'enable.wsfed-sp' => false,
'enable.authmemcookie' => false,
'default-wsfed-idp' => 'urn:federation:pingfederate:localhost',
'shib13.signresponse' => true,
'session.duration' => 8 * (60 * 60),
'session.datastore.timeout' => (4 * 60 * 60),
'session.state.timeout' => (60 * 60),
'session.cookie.name' => 'SimpleSAMLSessionID',
'session.cookie.lifetime' => 0,
'session.cookie.path' => '/',
'session.cookie.domain' => null,
'session.cookie.secure' => false,
'session.phpsession.cookiename' => 'SimpleSAML',
'session.phpsession.savepath' => null,
'session.phpsession.httponly' => true,
'session.authtoken.cookiename' => 'SimpleSAMLAuthToken',
'session.rememberme.enable' => false,
'session.rememberme.checked' => false,
'session.rememberme.lifetime' => (14 * 86400),
'memcache_store.servers' => array(
array(
array('hostname' => 'localhost'),
),
),
'memcache_store.prefix' => '',
'memcache_store.expires' => 36 * (60 * 60),
'language' => array(
'priorities' => array(
'no' => array('nb', 'nn', 'en', 'se'),
'nb' => array('no', 'nn', 'en', 'se'),
'nn' => array('no', 'nb', 'en', 'se'),
'se' => array('nb', 'no', 'nn', 'en'),
),
),
'language.available' => array(
'en', 'no', 'nn', 'se', 'da', 'de', 'sv', 'fi', 'es', 'ca', 'fr', 'it', 'nl', 'lb',
'cs', 'sl', 'lt', 'hr', 'hu', 'pl', 'pt', 'pt-br', 'tr', 'ja', 'zh', 'zh-tw', 'ru',
'et', 'he', 'id', 'sr', 'lv', 'ro', 'eu', 'el', 'af'
),
'language.rtl' => array('ar', 'dv', 'fa', 'ur', 'he'),
'language.default' => 'en',
'language.parameter.name' => 'language',
'language.parameter.setcookie' => true,
'language.cookie.name' => 'language',
'language.cookie.domain' => null,
'language.cookie.path' => '/',
'language.cookie.secure' => false,
'language.cookie.httponly' => false,
'language.cookie.lifetime' => (60 * 60 * 24 * 900),
'language.i18n.backend' => 'SimpleSAMLphp',
'attributes.extradictionary' => null,
'theme.use' => 'default',
'template.auto_reload' => false,
'production' => true,
'idpdisco.enableremember' => true,
'idpdisco.rememberchecked' => true,
'idpdisco.validate' => true,
'idpdisco.extDiscoveryStorage' => null,
'idpdisco.layout' => 'dropdown',
'authproc.idp' => array(
30 => 'core:LanguageAdaptor',
45 => array(
'class' => 'core:StatisticsWithAttribute',
'attributename' => 'realm',
'type' => 'saml20-idp-SSO',
),
50 => 'core:AttributeLimit',
99 => 'core:LanguageAdaptor',
),
'authproc.sp' => array(
90 => 'core:LanguageAdaptor',
),
'metadata.sources' => array(
array('type' => 'flatfile'),
),
'metadata.sign.enable' => false,
'metadata.sign.privatekey' => null,
'metadata.sign.privatekey_pass' => null,
'metadata.sign.certificate' => null,
'metadata.sign.algorithm' => null,
'store.type' => 'phpsession',
'store.sql.dsn' => 'sqlite:/path/to/sqlitedatabase.sq3',
'store.sql.username' => null,
'store.sql.password' => null,
'store.sql.prefix' => 'SimpleSAMLphp',
'store.redis.host' => 'localhost',
'store.redis.port' => 6379,
'store.redis.prefix' => 'SimpleSAMLphp',
);
Apache 2 site config:
<VirtualHost *:80>
ServerName saml.veptec.mx
DocumentRoot /var/www/html
Alias /simplesaml /var/simplesamlphp/www
<Directory /var/simplesamlphp/www>
Require all granted
</Directory>
</VirtualHost>
The https://saml.dominian.com/simplesaml is redirected to https://saml.dominian.com/simplesaml/module.php/core/frontpage_welcome.php but that file return HTTP ERROR 500, I try to track down the error and I fond out that is problem with the config file.
Any ideas?
I found the answer, the location it was not initializing. It was a bug.
In the ./lib/SimpleSAML/Locale/Localization.php file I only call this method:
$this->setupTranslator();
in the end of the constructor and it works correctly.
I made a simple C++ project using Qt, the goal is to extract some connected components from images and save them into proper folders.
I only use one .cpp file and opencv to do so.
But when I run my program I get this error: Symbol lookup error: undefined symbol: _ZN2cv6imreadERKSsi
To be honest I don't understand what's going on. I tried to look on some thread where people had the same issue but nothing worked so far.
I checked with ldd -d -r ./ExctractCC and everything seems to be ok:
linux-vdso.so.1 => (0x00007fffa23c4000)
libopencv_core.so.2.4 => /usr/lib/x86_64-linux-gnu/libopencv_core.so.2.4 (0x00007f3c5522c000)
libopencv_highgui.so.2.4 => /usr/lib/x86_64-linux-gnu/libopencv_highgui.so.2.4 (0x00007f3c54fe3000)
libopencv_imgproc.so.2.4 => /usr/lib/x86_64-linux-gnu/libopencv_imgproc.so.2.4 (0x00007f3c54b57000)
libstdc++.so.6 => /usr/lib/x86_64-linux-gnu/libstdc++.so.6 (0x00007f3c547d5000)
libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007f3c544cc000)
libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007f3c542b5000)
libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f3c53eeb000)
libz.so.1 => /lib/x86_64-linux-gnu/libz.so.1 (0x00007f3c53cd1000)
libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007f3c53ab3000)
librt.so.1 => /lib/x86_64-linux-gnu/librt.so.1 (0x00007f3c538ab000)
libGL.so.1 => /usr/lib/x86_64-linux-gnu/mesa/libGL.so.1 (0x00007f3c53637000)
libtbb.so.2 => /usr/lib/x86_64-linux-gnu/libtbb.so.2 (0x00007f3c533f9000)
libjpeg.so.8 => /usr/lib/x86_64-linux-gnu/libjpeg.so.8 (0x00007f3c531a0000)
libpng12.so.0 => /lib/x86_64-linux-gnu/libpng12.so.0 (0x00007f3c52f7b000)
libtiff.so.5 => /usr/lib/x86_64-linux-gnu/libtiff.so.5 (0x00007f3c52d06000)
libjasper.so.1 => /usr/lib/x86_64-linux-gnu/libjasper.so.1 (0x00007f3c52ab1000)
libIlmImf-2_2.so.22 => /usr/lib/x86_64-linux-gnu/libIlmImf-2_2.so.22 (0x00007f3c525e3000)
libHalf.so.12 => /usr/lib/x86_64-linux-gnu/libHalf.so.12 (0x00007f3c5239f000)
libgtk-x11-2.0.so.0 => /usr/lib/x86_64-linux-gnu/libgtk-x11-2.0.so.0 (0x00007f3c51d54000)
libgdk-x11-2.0.so.0 => /usr/lib/x86_64-linux-gnu/libgdk-x11-2.0.so.0 (0x00007f3c51a9f000)
libgobject-2.0.so.0 => /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0 (0x00007f3c5184b000)
libglib-2.0.so.0 => /lib/x86_64-linux-gnu/libglib-2.0.so.0 (0x00007f3c5153a000)
libgtkglext-x11-1.0.so.0 => /usr/lib/x86_64-linux-gnu/libgtkglext-x11-1.0.so.0 (0x00007f3c51336000)
libgdkglext-x11-1.0.so.0 => /usr/lib/x86_64-linux-gnu/libgdkglext-x11-1.0.so.0 (0x00007f3c510d1000)
libdc1394.so.22 => /usr/lib/x86_64-linux-gnu/libdc1394.so.22 (0x00007f3c50e5b000)
libv4l1.so.0 => /usr/lib/x86_64-linux-gnu/libv4l1.so.0 (0x00007f3c50c55000)
libavcodec-ffmpeg.so.56 => /usr/lib/x86_64-linux-gnu/libavcodec-ffmpeg.so.56 (0x00007f3c4f828000)
libavformat-ffmpeg.so.56 => /usr/lib/x86_64-linux-gnu/libavformat-ffmpeg.so.56 (0x00007f3c4f42a000)
libavutil-ffmpeg.so.54 => /usr/lib/x86_64-linux-gnu/libavutil-ffmpeg.so.54 (0x00007f3c4f1bb000)
libswscale-ffmpeg.so.3 => /usr/lib/x86_64-linux-gnu/libswscale-ffmpeg.so.3 (0x00007f3c4ef2b000) /lib64/ld-linux-x86-64.so.2 (0x000055b4ab2ea000)
libexpat.so.1 => /lib/x86_64-linux-gnu/libexpat.so.1 (0x00007f3c4ed02000)
libxcb-dri3.so.0 => /usr/lib/x86_64-linux-gnu/libxcb-dri3.so.0 (0x00007f3c4eafe000)
libxcb-present.so.0 => /usr/lib/x86_64-linux-gnu/libxcb-present.so.0 (0x00007f3c4e8fb000)
libxcb-sync.so.1 => /usr/lib/x86_64-linux-gnu/libxcb-sync.so.1 (0x00007f3c4e6f4000)
libxshmfence.so.1 => /usr/lib/x86_64-linux-gnu/libxshmfence.so.1 (0x00007f3c4e4f0000)
libglapi.so.0 => /usr/lib/x86_64-linux-gnu/libglapi.so.0 (0x00007f3c4e2c1000)
libXext.so.6 => /usr/lib/x86_64-linux-gnu/libXext.so.6 (0x00007f3c4e0af000)
libXdamage.so.1 => /usr/lib/x86_64-linux-gnu/libXdamage.so.1 (0x00007f3c4deab000)
libXfixes.so.3 => /usr/lib/x86_64-linux-gnu/libXfixes.so.3 (0x00007f3c4dca5000)
libX11-xcb.so.1 => /usr/lib/x86_64-linux-gnu/libX11-xcb.so.1 (0x00007f3c4daa3000)
libX11.so.6 => /usr/lib/x86_64-linux-gnu/libX11.so.6 (0x00007f3c4d768000)
libxcb-glx.so.0 => /usr/lib/x86_64-linux-gnu/libxcb-glx.so.0 (0x00007f3c4d54f000)
libxcb-dri2.so.0 => /usr/lib/x86_64-linux-gnu/libxcb-dri2.so.0 (0x00007f3c4d34a000)
libxcb.so.1 => /usr/lib/x86_64-linux-gnu/libxcb.so.1 (0x00007f3c4d127000)
libXxf86vm.so.1 => /usr/lib/x86_64-linux-gnu/libXxf86vm.so.1 (0x00007f3c4cf21000)
libdrm.so.2 => /usr/lib/x86_64-linux-gnu/libdrm.so.2 (0x00007f3c4cd12000)
libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007f3c4cb0d000)
liblzma.so.5 => /lib/x86_64-linux-gnu/liblzma.so.5 (0x00007f3c4c8eb000)
libjbig.so.0 => /usr/lib/x86_64-linux-gnu/libjbig.so.0 (0x00007f3c4c6dc000)
libIex-2_2.so.12 => /usr/lib/x86_64-linux-gnu/libIex-2_2.so.12 (0x00007f3c4c4be000)
libIlmThread-2_2.so.12 => /usr/lib/x86_64-linux-gnu/libIlmThread-2_2.so.12 (0x00007f3c4c2b7000)
libgmodule-2.0.so.0 => /usr/lib/x86_64-linux-gnu/libgmodule-2.0.so.0 (0x00007f3c4c0b2000)
libpangocairo-1.0.so.0 => /usr/lib/x86_64-linux-gnu/libpangocairo-1.0.so.0 (0x00007f3c4bea5000)
libatk-1.0.so.0 => /usr/lib/x86_64-linux-gnu/libatk-1.0.so.0 (0x00007f3c4bc80000)
libcairo.so.2 => /usr/lib/x86_64-linux-gnu/libcairo.so.2 (0x00007f3c4b96b000)
libgdk_pixbuf-2.0.so.0 => /usr/lib/x86_64-linux-gnu/libgdk_pixbuf-2.0.so.0 (0x00007f3c4b749000)
libgio-2.0.so.0 => /usr/lib/x86_64-linux-gnu/libgio-2.0.so.0 (0x00007f3c4b3c1000)
libpangoft2-1.0.so.0 => /usr/lib/x86_64-linux-gnu/libpangoft2-1.0.so.0 (0x00007f3c4b1aa000)
libpango-1.0.so.0 => /usr/lib/x86_64-linux-gnu/libpango-1.0.so.0 (0x00007f3c4af5e000)
libfontconfig.so.1 => /usr/lib/x86_64-linux-gnu/libfontconfig.so.1 (0x00007f3c4ad1b000)
libXrender.so.1 => /usr/lib/x86_64-linux-gnu/libXrender.so.1 (0x00007f3c4ab10000)
libXinerama.so.1 => /usr/lib/x86_64-linux-gnu/libXinerama.so.1 (0x00007f3c4a90d000)
libXi.so.6 => /usr/lib/x86_64-linux-gnu/libXi.so.6 (0x00007f3c4a6fc000)
libXrandr.so.2 => /usr/lib/x86_64-linux-gnu/libXrandr.so.2 (0x00007f3c4a4f1000)
libXcursor.so.1 => /usr/lib/x86_64-linux-gnu/libXcursor.so.1 (0x00007f3c4a2e7000)
libXcomposite.so.1 => /usr/lib/x86_64-linux-gnu/libXcomposite.so.1 (0x00007f3c4a0e4000)
libffi.so.6 => /usr/lib/x86_64-linux-gnu/libffi.so.6 (0x00007f3c49edb000)
libpcre.so.3 => /lib/x86_64-linux-gnu/libpcre.so.3 (0x00007f3c49c6b000)
libGLU.so.1 => /usr/lib/x86_64-linux-gnu/libGLU.so.1 (0x00007f3c499fb000)
libXmu.so.6 => /usr/lib/x86_64-linux-gnu/libXmu.so.6 (0x00007f3c497e2000)
libpangox-1.0.so.0 => /usr/lib/x86_64-linux-gnu/libpangox-1.0.so.0 (0x00007f3c495c2000)
libraw1394.so.11 => /usr/lib/x86_64-linux-gnu/libraw1394.so.11 (0x00007f3c493b2000)
libusb-1.0.so.0 => /lib/x86_64-linux-gnu/libusb-1.0.so.0 (0x00007f3c4919a000)
libv4l2.so.0 => /usr/lib/x86_64-linux-gnu/libv4l2.so.0 (0x00007f3c48f8c000)
libswresample-ffmpeg.so.1 => /usr/lib/x86_64-linux-gnu/libswresample-ffmpeg.so.1 (0x00007f3c48d6e000)
libva.so.1 => /usr/lib/x86_64-linux-gnu/libva.so.1 (0x00007f3c48b52000)
libzvbi.so.0 => /usr/lib/x86_64-linux-gnu/libzvbi.so.0 (0x00007f3c488c7000)
libxvidcore.so.4 => /usr/lib/x86_64-linux-gnu/libxvidcore.so.4 (0x00007f3c485b2000)
libx265.so.79 => /usr/lib/x86_64-linux-gnu/libx265.so.79 (0x00007f3c47993000)
libx264.so.148 => /usr/lib/x86_64-linux-gnu/libx264.so.148 (0x00007f3c475ef000)
libwebp.so.5 => /usr/lib/x86_64-linux-gnu/libwebp.so.5 (0x00007f3c47392000)
libwavpack.so.1 => /usr/lib/x86_64-linux-gnu/libwavpack.so.1 (0x00007f3c47169000)
libvpx.so.3 => /usr/lib/x86_64-linux-gnu/libvpx.so.3 (0x00007f3c46d45000)
libvorbisenc.so.2 => /usr/lib/x86_64-linux-gnu/libvorbisenc.so.2 (0x00007f3c46a9b000)
libvorbis.so.0 => /usr/lib/x86_64-linux-gnu/libvorbis.so.0 (0x00007f3c4686f000)
libtwolame.so.0 => /usr/lib/x86_64-linux-gnu/libtwolame.so.0 (0x00007f3c4664c000)
libtheoraenc.so.1 => /usr/lib/x86_64-linux-gnu/libtheoraenc.so.1 (0x00007f3c4640c000)
libtheoradec.so.1 => /usr/lib/x86_64-linux-gnu/libtheoradec.so.1 (0x00007f3c461f2000)
libspeex.so.1 => /usr/lib/x86_64-linux-gnu/libspeex.so.1 (0x00007f3c45fd9000)
libsnappy.so.1 => /usr/lib/x86_64-linux-gnu/libsnappy.so.1 (0x00007f3c45dd0000)
libshine.so.3 => /usr/lib/x86_64-linux-gnu/libshine.so.3 (0x00007f3c45bc3000)
libschroedinger-1.0.so.0 => /usr/lib/x86_64-linux-gnu/libschroedinger-1.0.so.0 (0x00007f3c458ee000)
libopus.so.0 => /usr/lib/x86_64-linux-gnu/libopus.so.0 (0x00007f3c456a3000)
libopenjpeg.so.5 => /usr/lib/x86_64-linux-gnu/libopenjpeg.so.5 (0x00007f3c45480000)
libmp3lame.so.0 => /usr/lib/x86_64-linux-gnu/libmp3lame.so.0 (0x00007f3c4520b000)
libgsm.so.1 => /usr/lib/x86_64-linux-gnu/libgsm.so.1 (0x00007f3c44ffc000)
libcrystalhd.so.3 => /usr/lib/x86_64-linux-gnu/libcrystalhd.so.3 (0x00007f3c44de1000)
libssh-gcrypt.so.4 => /usr/lib/x86_64-linux-gnu/libssh-gcrypt.so.4 (0x00007f3c44b97000)
librtmp.so.1 => /usr/lib/x86_64-linux-gnu/librtmp.so.1 (0x00007f3c4497b000)
libmodplug.so.1 => /usr/lib/x86_64-linux-gnu/libmodplug.so.1 (0x00007f3c445f0000)
libgme.so.0 => /usr/lib/x86_64-linux-gnu/libgme.so.0 (0x00007f3c443a1000)
libbluray.so.1 => /usr/lib/x86_64-linux-gnu/libbluray.so.1 (0x00007f3c44158000)
libgnutls.so.30 => /usr/lib/x86_64-linux-gnu/libgnutls.so.30 (0x00007f3c43e28000)
libbz2.so.1.0 => /lib/x86_64-linux-gnu/libbz2.so.1.0 (0x00007f3c43c17000)
libXau.so.6 => /usr/lib/x86_64-linux-gnu/libXau.so.6 (0x00007f3c43a13000)
libXdmcp.so.6 => /usr/lib/x86_64-linux-gnu/libXdmcp.so.6 (0x00007f3c4380c000)
libfreetype.so.6 => /usr/lib/x86_64-linux-gnu/libfreetype.so.6 (0x00007f3c43562000)
libpixman-1.so.0 => /usr/lib/x86_64-linux-gnu/libpixman-1.so.0 (0x00007f3c432b9000)
libxcb-shm.so.0 => /usr/lib/x86_64-linux-gnu/libxcb-shm.so.0 (0x00007f3c430b5000)
libxcb-render.so.0 => /usr/lib/x86_64-linux-gnu/libxcb-render.so.0 (0x00007f3c42eab000)
libselinux.so.1 => /lib/x86_64-linux-gnu/libselinux.so.1 (0x00007f3c42c88000)
libresolv.so.2 => /lib/x86_64-linux-gnu/libresolv.so.2 (0x00007f3c42a6d000)
libharfbuzz.so.0 => /usr/lib/x86_64-linux-gnu/libharfbuzz.so.0 (0x00007f3c4280f000)
libthai.so.0 => /usr/lib/x86_64-linux-gnu/libthai.so.0 (0x00007f3c42605000)
libXt.so.6 => /usr/lib/x86_64-linux-gnu/libXt.so.6 (0x00007f3c4239c000)
libudev.so.1 => /lib/x86_64-linux-gnu/libudev.so.1 (0x00007f3c4237b000)
libv4lconvert.so.0 => /usr/lib/x86_64-linux-gnu/libv4lconvert.so.0 (0x00007f3c42101000)
libsoxr.so.0 => /usr/lib/x86_64-linux-gnu/libsoxr.so.0 (0x00007f3c41e9c000)
libnuma.so.1 => /usr/lib/x86_64-linux-gnu/libnuma.so.1 (0x00007f3c41c90000)
libogg.so.0 => /usr/lib/x86_64-linux-gnu/libogg.so.0 (0x00007f3c41a87000)
liborc-0.4.so.0 => /usr/lib/x86_64-linux-gnu/liborc-0.4.so.0 (0x00007f3c41806000)
libgcrypt.so.20 => /lib/x86_64-linux-gnu/libgcrypt.so.20 (0x00007f3c41525000)
libgssapi_krb5.so.2 => /usr/lib/x86_64-linux-gnu/libgssapi_krb5.so.2 (0x00007f3c412da000)
libhogweed.so.4 => /usr/lib/x86_64-linux-gnu/libhogweed.so.4 (0x00007f3c410a7000)
libnettle.so.6 => /usr/lib/x86_64-linux-gnu/libnettle.so.6 (0x00007f3c40e71000)
libgmp.so.10 => /usr/lib/x86_64-linux-gnu/libgmp.so.10 (0x00007f3c40bf0000)
libxml2.so.2 => /usr/lib/x86_64-linux-gnu/libxml2.so.2 (0x00007f3c40835000)
libp11-kit.so.0 => /usr/lib/x86_64-linux-gnu/libp11-kit.so.0 (0x00007f3c405d0000)
libidn.so.11 => /usr/lib/x86_64-linux-gnu/libidn.so.11 (0x00007f3c4039d000)
libtasn1.so.6 => /usr/lib/x86_64-linux-gnu/libtasn1.so.6 (0x00007f3c4018a000)
libgraphite2.so.3 => /usr/lib/x86_64-linux-gnu/libgraphite2.so.3 (0x00007f3c3ff64000)
libdatrie.so.1 => /usr/lib/x86_64-linux-gnu/libdatrie.so.1 (0x00007f3c3fd5c000)
libSM.so.6 => /usr/lib/x86_64-linux-gnu/libSM.so.6 (0x00007f3c3fb53000)
libICE.so.6 => /usr/lib/x86_64-linux-gnu/libICE.so.6 (0x00007f3c3f939000)
libgomp.so.1 => /usr/lib/x86_64-linux-gnu/libgomp.so.1 (0x00007f3c3f717000)
libgpg-error.so.0 => /lib/x86_64-linux-gnu/libgpg-error.so.0 (0x00007f3c3f502000)
libkrb5.so.3 => /usr/lib/x86_64-linux-gnu/libkrb5.so.3 (0x00007f3c3f230000)
libk5crypto.so.3 => /usr/lib/x86_64-linux-gnu/libk5crypto.so.3 (0x00007f3c3f000000)
libcom_err.so.2 => /lib/x86_64-linux-gnu/libcom_err.so.2 (0x00007f3c3edfc000)
libkrb5support.so.0 => /usr/lib/x86_64-linux-gnu/libkrb5support.so.0 (0x00007f3c3ebf1000)
libicuuc.so.55 => /usr/lib/x86_64-linux-gnu/libicuuc.so.55 (0x00007f3c3e85c000)
libuuid.so.1 => /lib/x86_64-linux-gnu/libuuid.so.1 (0x00007f3c3e657000)
libkeyutils.so.1 => /lib/x86_64-linux-gnu/libkeyutils.so.1 (0x00007f3c3e453000)
libicudata.so.55 => /usr/lib/x86_64-linux-gnu/libicudata.so.55 (0x00007f3c3c99b000)
undefined symbol:
_ZN2cv7imwriteERKSsRKNS_11_InputArrayERKSt6vectorIiSaIiEE (./ExctractCC) undefined symbol: _ZN2cv6imreadERKSsi (./ExctractCC)
Except for the two undefined symbol at the end.
It seems to be linked with opencv as I can read Imread, but reinstall opencv 2.4 didn't work.
I got the same error with another project which used to work perfectly before I upgrade my Ubuntu from 14.04 to 16.04, the other change I made is to download g++4.9.
I'm not sure if there is a missing library I should install, a compiler issue or something else.
If someone have a hint?
Edit: Here's my code:
#include <iostream>
#include <sys/types.h>
#include <sys/stat.h>
#include <vector>
#include <fstream>
#include <iostream>
#include <algorithm>
#include <math.h>
#include <opencv2/highgui/highgui.hpp>
#include <opencv2/core/core.hpp>
#include <opencv2/imgproc/imgproc.hpp>
#include <opencv/cv.h>
#include <main.h>
#include <processImage.h>
#include <boost/lexical_cast.hpp>
#include <boost/algorithm/string.hpp>
using namespace std;
int main()
{
int maxHeight = 2500;
int normHeight = 2000;
int rectangleWidth = round((float)normHeight/200.0);
std::string list_images_train="data/list_images_train";
if(rectangleWidth <3)
{
rectangleWidth = 3;
}
//int numLines = countNumberOfLinesInFIle(list_images_train);
std::vector<std::string> filenames;
std::ifstream fid1(list_images_train.c_str(), std::ios::in);
std::string name;
int x=1;
while(std::getline(fid1,name))
{
filenames.push_back(name);
x+=1;
}
fid1.close();
int n=filenames.size();
for(int x=0;x<n;x++)
{
std::string folder="/home/kamel/TRAVAIL/Romain/build-ExctractCC-Desktop-Debug/"+filenames[x];
int statut=mkdir(folder.c_str(),S_IRWXU | S_IRWXG | S_IROTH | S_IXOTH);
std::string imageName="data/"+ filenames[x]+".png";
std::string gtFile="data/"+ filenames[x] + ".gt";
//The error occurs here:
cv::Mat imgTest=(cv::imread(imageName.c_str(), CV_LOAD_IMAGE_GRAYSCALE));
double min,max;
imgTest.convertTo(imgTest,CV_64F);
cv::minMaxLoc(imgTest,&min,&max);
imgTest=(255*((imgTest - min)/(max-min)));
imgTest.convertTo(imgTest,CV_8U);
int height=imgTest.rows;
int width=imgTest.cols;
int evaluate=1;
if (gtFile.empty())
{
evaluate=0;
}
double ratio1= (float)maxHeight/ (float)height;
cv::resize(imgTest,imgTest,cv::Size(),ratio1,ratio1,cv::INTER_LANCZOS4);
height=imgTest.rows;
width=imgTest.cols;
cv::Mat binImg;
(cv::GaussianBlur(imgTest,imgTest,cv::Size(7,7),0,0));
imgTest.convertTo(imgTest,CV_8U);
double thrsh= cv::threshold(imgTest,binImg,0,255,CV_THRESH_BINARY_INV |CV_THRESH_OTSU);
std::vector<std::string> vars;
boost::split(vars,imageName, boost::is_any_of("/"),boost::token_compress_on);
cv::Mat binImg0= binImg.clone();
double ratio2= float(normHeight)/float(height);
if(imgTest.cols==0){
std::cout<<"Error reading file"<<std::endl;
}
cv::resize(imgTest,imgTest,cv::Size(),ratio2,ratio2,cv::INTER_LANCZOS4);
height=binImg.rows;
width=binImg.cols;
binImg/=255;
cv::resize(binImg,binImg,cv::Size(),ratio2,ratio2,cv::INTER_LANCZOS4);
cv::Mat imgcontour=binImg.clone();
std::vector<cv::Vec4i> hierarchy;
std::vector<std::vector<cv::Point> > CC;
cv::findContours(imgcontour, CC,hierarchy, CV_RETR_CCOMP, CV_CHAIN_APPROX_SIMPLE, cv::Point(0,0));
int sizeCC=CC.size();
for(int i=0;i<sizeCC;i++)
{
cv::Mat pointsf;
cv::Mat(CC[i]).convertTo(pointsf, CV_32F);
cv::Rect box=cv::boundingRect(pointsf);
cv::Mat tmpimg=binImg.colRange(box.x,box.x+box.width).rowRange(box.y,box.y + box.height);
std::ostringstream name;
name << folder << "/CC"<<i << ".png";
cv::imwrite(name.str(),tmpimg);
}
}
return 0;
}
I am writing a simple Qt5 application inside OMNET++ environment. I linked the program with Qt5Widgets, Qt5Gui, Qt5Core and pthread. The code is compiled and built successfully but I can not run it using opp_run. I am creating a shared library libVENTOS.so from my project and ldd output shows that all shared libraries are available on my machine. So I guess opp_run can not load some of the Qt5 libraries. How can I solve this problem ?
$ ldd ./libVENTOS.so
linux-vdso.so.1 => (0x00007ffc968ad000)
libboost_system.so.1.54.0 => /usr/lib/x86_64-linux-gnu/libboost_system.so.1.54.0 (0x00007f2580f48000)
libboost_filesystem.so.1.54.0 => /usr/lib/x86_64-linux-gnu/libboost_filesystem.so.1.54.0 (0x00007f2580d32000)
libboost_serialization.so.1.54.0 => /usr/lib/x86_64-linux-gnu/libboost_serialization.so.1.54.0 (0x00007f2580ac7000)
libpcap.so.0.8 => /usr/lib/x86_64-linux-gnu/libpcap.so.0.8 (0x00007f2580889000)
libusb-1.0.so.0 => /usr/local/lib/libusb-1.0.so.0 (0x00007f2580671000)
libbluetooth.so.3 => /usr/lib/x86_64-linux-gnu/libbluetooth.so.3 (0x00007f258044f000)
libsnmp++.so.33 => /usr/local/lib/libsnmp++.so.33 (0x00007f25801e1000)
libcurl-gnutls.so.4 => /usr/lib/x86_64-linux-gnu/libcurl-gnutls.so.4 (0x00007f257ff7f000)
libshark_debug.so.0 => /usr/local/lib/libshark_debug.so.0 (0x00007f257f42e000)
liblapack_atlas.so.3 => /usr/lib/liblapack_atlas.so.3 (0x00007f257f1d4000)
libssh.so.4 => /usr/lib/x86_64-linux-gnu/libssh.so.4 (0x00007f257ef8e000)
libQt5Widgets.so.5 => /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5 (0x00007f257e765000)
libQt5Gui.so.5 => /usr/lib/x86_64-linux-gnu/libQt5Gui.so.5 (0x00007f257e118000)
libQt5Core.so.5 => /usr/lib/x86_64-linux-gnu/libQt5Core.so.5 (0x00007f257da72000)
liboppenvird.so => /home/mani/Desktop/omnetpp-5.0/lib/liboppenvird.so (0x00007f257d6e6000)
liboppsimd.so => /home/mani/Desktop/omnetpp-5.0/lib/liboppsimd.so (0x00007f257d0d5000)
libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007f257ced1000)
libstdc++.so.6 => /usr/lib/x86_64-linux-gnu/libstdc++.so.6 (0x00007f257cbcd000)
libosg.so.99 => /usr/lib/libosg.so.99 (0x00007f257c6fd000)
libosgGA.so.99 => /usr/lib/libosgGA.so.99 (0x00007f257c483000)
libosgViewer.so.99 => /usr/lib/libosgViewer.so.99 (0x00007f257c1b1000)
libosgQt.so.99 => /usr/lib/libosgQt.so.99 (0x00007f257bf91000)
libOpenThreads.so.14 => /usr/lib/libOpenThreads.so.14 (0x00007f257bd89000)
libosgEarth.so.2 => /usr/lib/libosgEarth.so.2 (0x00007f257b956000)
libosgEarthUtil.so.2 => /usr/lib/libosgEarthUtil.so.2 (0x00007f257b53d000)
libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007f257b237000)
libgomp.so.1 => /usr/lib/x86_64-linux-gnu/libgomp.so.1 (0x00007f257b028000)
libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007f257ae12000)
libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007f257abf4000)
libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f257a82f000)
libudev.so.1 => /lib/x86_64-linux-gnu/libudev.so.1 (0x00007f257a61e000)
libcrypto.so.1.0.0 => /lib/x86_64-linux-gnu/libcrypto.so.1.0.0 (0x00007f257a242000)
libidn.so.11 => /usr/lib/x86_64-linux-gnu/libidn.so.11 (0x00007f257a00f000)
librtmp.so.0 => /usr/lib/x86_64-linux-gnu/librtmp.so.0 (0x00007f2579df5000)
libgcrypt.so.11 => /lib/x86_64-linux-gnu/libgcrypt.so.11 (0x00007f2579b75000)
libgnutls.so.26 => /usr/lib/x86_64-linux-gnu/libgnutls.so.26 (0x00007f25798b7000)
libgssapi_krb5.so.2 => /usr/lib/x86_64-linux-gnu/libgssapi_krb5.so.2 (0x00007f2579670000)
liblber-2.4.so.2 => /usr/lib/x86_64-linux-gnu/liblber-2.4.so.2 (0x00007f2579461000)
libldap_r-2.4.so.2 => /usr/lib/x86_64-linux-gnu/libldap_r-2.4.so.2 (0x00007f2579210000)
libz.so.1 => /lib/x86_64-linux-gnu/libz.so.1 (0x00007f2578ff7000)
liblapack.so.3 => /usr/lib/liblapack.so.3 (0x00007f257885b000)
libcblas.so.3 => /usr/lib/libcblas.so.3 (0x00007f257863a000)
libf77blas.so.3 => /usr/lib/libf77blas.so.3 (0x00007f257841a000)
libatlas.so.3 => /usr/lib/libatlas.so.3 (0x00007f2577e87000)
libgfortran.so.3 => /usr/lib/x86_64-linux-gnu/libgfortran.so.3 (0x00007f2577b6d000)
librt.so.1 => /lib/x86_64-linux-gnu/librt.so.1 (0x00007f2577965000)
/lib64/ld-linux-x86-64.so.2 (0x00007f2581df3000)
libgobject-2.0.so.0 => /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0 (0x00007f2577714000)
libglib-2.0.so.0 => /lib/x86_64-linux-gnu/libglib-2.0.so.0 (0x00007f257740c000)
libX11.so.6 => /usr/lib/x86_64-linux-gnu/libX11.so.6 (0x00007f25770d7000)
libpng12.so.0 => /lib/x86_64-linux-gnu/libpng12.so.0 (0x00007f2576eb1000)
libharfbuzz.so.0 => /usr/lib/x86_64-linux-gnu/libharfbuzz.so.0 (0x00007f2576c5c000)
libGL.so.1 => /usr/lib/x86_64-linux-gnu/mesa/libGL.so.1 (0x00007f25769f6000)
libicui18n.so.52 => /usr/lib/x86_64-linux-gnu/libicui18n.so.52 (0x00007f25765ef000)
libicuuc.so.52 => /usr/lib/x86_64-linux-gnu/libicuuc.so.52 (0x00007f2576276000)
liboppnedxmld.so => /home/mani/Desktop/omnetpp-5.0/lib/liboppnedxmld.so (0x00007f2575f12000)
liboppcommond.so => /home/mani/Desktop/omnetpp-5.0/lib/liboppcommond.so (0x00007f2575c7e000)
libmpi_cxx.so.1 => /usr/lib/libmpi_cxx.so.1 (0x00007f2575a64000)
libmpi.so.1 => /usr/lib/libmpi.so.1 (0x00007f25756e3000)
libosgDB.so.99 => /usr/lib/libosgDB.so.99 (0x00007f25753e6000)
libosgUtil.so.99 => /usr/lib/libosgUtil.so.99 (0x00007f2575023000)
libosgText.so.99 => /usr/lib/libosgText.so.99 (0x00007f2574dca000)
libQtCore.so.4 => /usr/lib/x86_64-linux-gnu/libQtCore.so.4 (0x00007f25748e5000)
libQtGui.so.4 => /usr/lib/x86_64-linux-gnu/libQtGui.so.4 (0x00007f2573c32000)
libQtOpenGL.so.4 => /usr/lib/x86_64-linux-gnu/libQtOpenGL.so.4 (0x00007f2573934000)
libosgTerrain.so.99 => /usr/lib/libosgTerrain.so.99 (0x00007f25736fc000)
libosgShadow.so.99 => /usr/lib/libosgShadow.so.99 (0x00007f2573466000)
libgdal.so.1 => /usr/lib/libgdal.so.1 (0x00007f257270f000)
libosgManipulator.so.99 => /usr/lib/libosgManipulator.so.99 (0x00007f25724c9000)
libosgEarthFeatures.so.2 => /usr/lib/libosgEarthFeatures.so.2 (0x00007f2572212000)
libosgEarthSymbology.so.2 => /usr/lib/libosgEarthSymbology.so.2 (0x00007f2571f5f000)
libosgEarthAnnotation.so.2 => /usr/lib/libosgEarthAnnotation.so.2 (0x00007f2571cc6000)
libosgSim.so.99 => /usr/lib/libosgSim.so.99 (0x00007f2571a31000)
libcgmanager.so.0 => /lib/x86_64-linux-gnu/libcgmanager.so.0 (0x00007f2571816000)
libnih.so.1 => /lib/x86_64-linux-gnu/libnih.so.1 (0x00007f25715fe000)
libnih-dbus.so.1 => /lib/x86_64-linux-gnu/libnih-dbus.so.1 (0x00007f25713f4000)
libdbus-1.so.3 => /lib/x86_64-linux-gnu/libdbus-1.so.3 (0x00007f25711af000)
libgpg-error.so.0 => /lib/x86_64-linux-gnu/libgpg-error.so.0 (0x00007f2570faa000)
libtasn1.so.6 => /usr/lib/x86_64-linux-gnu/libtasn1.so.6 (0x00007f2570d96000)
libp11-kit.so.0 => /usr/lib/x86_64-linux-gnu/libp11-kit.so.0 (0x00007f2570b54000)
libkrb5.so.3 => /usr/lib/x86_64-linux-gnu/libkrb5.so.3 (0x00007f2570889000)
libk5crypto.so.3 => /usr/lib/x86_64-linux-gnu/libk5crypto.so.3 (0x00007f257065a000)
libcom_err.so.2 => /lib/x86_64-linux-gnu/libcom_err.so.2 (0x00007f2570456000)
libkrb5support.so.0 => /usr/lib/x86_64-linux-gnu/libkrb5support.so.0 (0x00007f257024b000)
libresolv.so.2 => /lib/x86_64-linux-gnu/libresolv.so.2 (0x00007f2570030000)
libsasl2.so.2 => /usr/lib/x86_64-linux-gnu/libsasl2.so.2 (0x00007f256fe15000)
libgssapi.so.3 => /usr/lib/x86_64-linux-gnu/libgssapi.so.3 (0x00007f256fbd7000)
libblas.so.3 => /usr/lib/libblas.so.3 (0x00007f256f60b000)
libquadmath.so.0 => /usr/lib/x86_64-linux-gnu/libquadmath.so.0 (0x00007f256f3cf000)
libffi.so.6 => /usr/lib/x86_64-linux-gnu/libffi.so.6 (0x00007f256f1c7000)
libpcre.so.3 => /lib/x86_64-linux-gnu/libpcre.so.3 (0x00007f256ef89000)
libxcb.so.1 => /usr/lib/x86_64-linux-gnu/libxcb.so.1 (0x00007f256ed6a000)
libfreetype.so.6 => /usr/lib/x86_64-linux-gnu/libfreetype.so.6 (0x00007f256eac7000)
libgraphite2.so.3 => /usr/lib/x86_64-linux-gnu/libgraphite2.so.3 (0x00007f256e8a1000)
libglapi.so.0 => /usr/lib/x86_64-linux-gnu/libglapi.so.0 (0x00007f256e67a000)
libXext.so.6 => /usr/lib/x86_64-linux-gnu/libXext.so.6 (0x00007f256e468000)
libXdamage.so.1 => /usr/lib/x86_64-linux-gnu/libXdamage.so.1 (0x00007f256e265000)
libXfixes.so.3 => /usr/lib/x86_64-linux-gnu/libXfixes.so.3 (0x00007f256e05f000)
libX11-xcb.so.1 => /usr/lib/x86_64-linux-gnu/libX11-xcb.so.1 (0x00007f256de5d000)
libxcb-glx.so.0 => /usr/lib/x86_64-linux-gnu/libxcb-glx.so.0 (0x00007f256dc46000)
libxcb-dri2.so.0 => /usr/lib/x86_64-linux-gnu/libxcb-dri2.so.0 (0x00007f256da41000)
libxcb-dri3.so.0 => /usr/lib/x86_64-linux-gnu/libxcb-dri3.so.0 (0x00007f256d83e000)
libxcb-present.so.0 => /usr/lib/x86_64-linux-gnu/libxcb-present.so.0 (0x00007f256d63b000)
libxcb-sync.so.1 => /usr/lib/x86_64-linux-gnu/libxcb-sync.so.1 (0x00007f256d435000)
libxshmfence.so.1 => /usr/lib/x86_64-linux-gnu/libxshmfence.so.1 (0x00007f256d233000)
libXxf86vm.so.1 => /usr/lib/x86_64-linux-gnu/libXxf86vm.so.1 (0x00007f256d02d000)
libdrm.so.2 => /usr/lib/x86_64-linux-gnu/libdrm.so.2 (0x00007f256ce20000)
libicudata.so.52 => /usr/lib/x86_64-linux-gnu/libicudata.so.52 (0x00007f256b5b3000)
libxml2.so.2 => /usr/lib/x86_64-linux-gnu/libxml2.so.2 (0x00007f256b24c000)
libutil.so.1 => /lib/x86_64-linux-gnu/libutil.so.1 (0x00007f256b049000)
libhwloc.so.5 => /usr/lib/x86_64-linux-gnu/libhwloc.so.5 (0x00007f256ae09000)
libltdl.so.7 => /usr/lib/x86_64-linux-gnu/libltdl.so.7 (0x00007f256abff000)
libfontconfig.so.1 => /usr/lib/x86_64-linux-gnu/libfontconfig.so.1 (0x00007f256a9c3000)
libaudio.so.2 => /usr/lib/x86_64-linux-gnu/libaudio.so.2 (0x00007f256a7ab000)
libSM.so.6 => /usr/lib/x86_64-linux-gnu/libSM.so.6 (0x00007f256a5a3000)
libICE.so.6 => /usr/lib/x86_64-linux-gnu/libICE.so.6 (0x00007f256a387000)
libXi.so.6 => /usr/lib/x86_64-linux-gnu/libXi.so.6 (0x00007f256a177000)
libXrender.so.1 => /usr/lib/x86_64-linux-gnu/libXrender.so.1 (0x00007f2569f6d000)
libarmadillo.so.4 => /usr/lib/libarmadillo.so.4 (0x00007f2569d66000)
libproj.so.0 => /usr/lib/libproj.so.0 (0x00007f2569b14000)
libpoppler.so.44 => /usr/lib/x86_64-linux-gnu/libpoppler.so.44 (0x00007f25696b8000)
libfreexl.so.1 => /usr/lib/x86_64-linux-gnu/libfreexl.so.1 (0x00007f25694ae000)
libgeos_c.so.1 => /usr/lib/libgeos_c.so.1 (0x00007f256928a000)
libwebp.so.5 => /usr/lib/x86_64-linux-gnu/libwebp.so.5 (0x00007f2569032000)
libepsilon.so.1 => /usr/lib/x86_64-linux-gnu/libepsilon.so.1 (0x00007f2568e1a000)
libodbc.so.1 => /usr/lib/x86_64-linux-gnu/libodbc.so.1 (0x00007f2568bb3000)
libodbcinst.so.1 => /usr/lib/x86_64-linux-gnu/libodbcinst.so.1 (0x00007f25689a1000)
libkmldom.so.0 => /usr/lib/x86_64-linux-gnu/libkmldom.so.0 (0x00007f25686f8000)
libkmlbase.so.0 => /usr/lib/x86_64-linux-gnu/libkmlbase.so.0 (0x00007f25684e2000)
libkmlengine.so.0 => /usr/lib/x86_64-linux-gnu/libkmlengine.so.0 (0x00007f25682ae000)
libexpat.so.1 => /lib/x86_64-linux-gnu/libexpat.so.1 (0x00007f2568084000)
libxerces-c-3.1.so => /usr/lib/x86_64-linux-gnu/libxerces-c-3.1.so (0x00007f2567afc000)
libjasper.so.1 => /usr/lib/x86_64-linux-gnu/libjasper.so.1 (0x00007f25678a5000)
libnetcdf.so.7 => /usr/lib/libnetcdf.so.7 (0x00007f2567568000)
libhdf5.so.7 => /usr/lib/x86_64-linux-gnu/libhdf5.so.7 (0x00007f25670cc000)
libmfhdfalt.so.0 => /usr/lib/libmfhdfalt.so.0 (0x00007f2566e9b000)
libdfalt.so.0 => /usr/lib/libdfalt.so.0 (0x00007f2566bb5000)
libogdi.so.3.2 => /usr/lib/libogdi.so.3.2 (0x00007f2566994000)
libgif.so.4 => /usr/lib/x86_64-linux-gnu/libgif.so.4 (0x00007f256678b000)
libjpeg.so.8 => /usr/lib/x86_64-linux-gnu/libjpeg.so.8 (0x00007f2566536000)
libpq.so.5 => /usr/lib/libpq.so.5 (0x00007f2566307000)
liblzma.so.5 => /lib/x86_64-linux-gnu/liblzma.so.5 (0x00007f25660e5000)
libdapclient.so.3 => /usr/lib/x86_64-linux-gnu/libdapclient.so.3 (0x00007f2565eae000)
libdap.so.11 => /usr/lib/x86_64-linux-gnu/libdap.so.11 (0x00007f2565bc8000)
libspatialite.so.5 => /usr/lib/x86_64-linux-gnu/libspatialite.so.5 (0x00007f25655cc000)
libmysqlclient.so.18 => /usr/lib/x86_64-linux-gnu/libmysqlclient.so.18 (0x00007f2565094000)
libkeyutils.so.1 => /lib/x86_64-linux-gnu/libkeyutils.so.1 (0x00007f2564e90000)
libheimntlm.so.0 => /usr/lib/x86_64-linux-gnu/libheimntlm.so.0 (0x00007f2564c87000)
libkrb5.so.26 => /usr/lib/x86_64-linux-gnu/libkrb5.so.26 (0x00007f25649ff000)
libasn1.so.8 => /usr/lib/x86_64-linux-gnu/libasn1.so.8 (0x00007f256475e000)
libhcrypto.so.4 => /usr/lib/x86_64-linux-gnu/libhcrypto.so.4 (0x00007f256452b000)
libroken.so.18 => /usr/lib/x86_64-linux-gnu/libroken.so.18 (0x00007f2564316000)
libXau.so.6 => /usr/lib/x86_64-linux-gnu/libXau.so.6 (0x00007f2564112000)
libXdmcp.so.6 => /usr/lib/x86_64-linux-gnu/libXdmcp.so.6 (0x00007f2563f0c000)
libnuma.so.1 => /usr/lib/x86_64-linux-gnu/libnuma.so.1 (0x00007f2563d01000)
libXt.so.6 => /usr/lib/x86_64-linux-gnu/libXt.so.6 (0x00007f2563a9b000)
libuuid.so.1 => /lib/x86_64-linux-gnu/libuuid.so.1 (0x00007f2563896000)
libarpack.so.2 => /usr/lib/libarpack.so.2 (0x00007f2563648000)
liblcms2.so.2 => /usr/lib/x86_64-linux-gnu/liblcms2.so.2 (0x00007f25633f3000)
libtiff.so.5 => /usr/lib/x86_64-linux-gnu/libtiff.so.5 (0x00007f2563181000)
libgeos-3.4.2.so => /usr/lib/libgeos-3.4.2.so (0x00007f2562dfd000)
liburiparser.so.1 => /usr/lib/liburiparser.so.1 (0x00007f2562be3000)
libminizip.so.0 => /usr/lib/x86_64-linux-gnu/libminizip.so.0 (0x00007f25629db000)
libhdf5_hl.so.7 => /usr/lib/x86_64-linux-gnu/libhdf5_hl.so.7 (0x00007f25627ab000)
libssl.so.1.0.0 => /lib/x86_64-linux-gnu/libssl.so.1.0.0 (0x00007f256254c000)
libsqlite3.so.0 => /usr/lib/x86_64-linux-gnu/libsqlite3.so.0 (0x00007f2562293000)
libwind.so.0 => /usr/lib/x86_64-linux-gnu/libwind.so.0 (0x00007f256206a000)
libheimbase.so.1 => /usr/lib/x86_64-linux-gnu/libheimbase.so.1 (0x00007f2561e5c000)
libhx509.so.5 => /usr/lib/x86_64-linux-gnu/libhx509.so.5 (0x00007f2561c13000)
libcrypt.so.1 => /lib/x86_64-linux-gnu/libcrypt.so.1 (0x00007f25619da000)
libjbig.so.0 => /usr/lib/x86_64-linux-gnu/libjbig.so.0 (0x00007f25617cc000)
Update: Reverting back my code to use Qt4 solved the problem and I can run my application flawlessly. So I guess the error was due to mixing Qt4 and Qt5 libraries. Omnet++ is using Qt4 and my C++ code is using Qt5. Is there any way to use Qt5 library in OMNET 5?
Go to the directory where your omnetpp.ini is located and type:
opp_run -l ../src/VENTOS
where ../src/ is relative path to the directory which contains libVENTOS.so.
Each connected member of my site has its database.
Here is the doctrine config for "user_1":
return array(
'doctrine' => array(
'connection' => array(
'orm_default' => array(
'driverClass' => 'Doctrine\DBAL\Driver\PDOMySql\Driver',
'params' => array(
'host' => 'localhost',
'port' => '3306',
'user' => 'user_1',
'password' => 'psswd_user_1',
'dbname' => 'database_user_1',
'charset' => 'utf8',
'driverOptions' => array (1002 => 'SET NAMES utf8'),
)),),),);
Is there a way to replace :
'user_1', 'psswd_user_1' and 'database_user_1'
with
'user_x', 'psswd_user_x' and 'database_user_x' for user_x ?
I don't know how to do that !
I'd like to avoid copying the same code for each user ...
Thank you for help
The proper way to do this might be to inject the configuration that you need when the connection is created. I couldn't find any event that you could hook into to do that, so you have to find the right service manager key to override.
With a little bit of source code digging, I found that these options are sent to a DoctrineORMModule\Options\DBALConnection instance and that this instance is created by DoctrineORMModule\Service\DBALConnectionFactory
You need to override this factory with something like this:
<?php
namespace MyModule\Service;
use DoctrineORMModule\Service\DBALConnectionFactory;
use Zend\ServiceManager\ServiceLocatorInterface;
class MyDBALConnectionFactory extends DBALConnectionFactory
{
public function getOptions(ServiceLocatorInterface $sl, $key, $name = null)
{
$options = parent::getOptions($sl, $key, $name);
// override for everyone that needs a DBALConnection
if ($this->getOptionClass() === 'DoctrineORMModule\Options\DBALConnection') {
// set custom parameters here
// maybe fetch the current user with $sl->get('...')
$params = [/* ... */];
$options->setParams($params);
}
return $options;
}
}
And then you just tell the service manager about it:
<?php
return [
...
'doctrine' => [
'doctrine_factories' => [
'connection' => 'MyModule\Service\DBALConnectionFactory',
]
]
...
];
Thanks to Alejandro Celaya.
1st link and 2d link
I hope it will be useful.
I know it's not perfect but I can't do better ! I'd like critical.
in config/autoload/doctrine.local.php:
'doctrine' => array(
'connection' => array(
'orm_default' => array(
'driverClass' => 'Doctrine\DBAL\Driver\PDOMySql\Driver',
'params' => array(
'host' => 'localhost',
'port' => '3306',
'user' => 'root',
'password' => '',
'dbname' => 'gestion_toto_default',
'charset' => 'utf8',
'driverOptions' => array(1002 => 'SET NAMES utf8'),
)
),
'orm_toto_users' => array(
'driverClass' => 'Doctrine\DBAL\Driver\PDOMySql\Driver',
'params' => array(
'host' => 'localhost',
'port' => '3306',
'user' => 'root',
'password' => '',
//gestion_toto_users has 2 tables : users and db_users
'dbname' => 'gestion_toto_users',
'driverOptions' => array(1002 => 'SET NAMES utf8'),
)
),
'dynamic_orm' => array(
'driverClass' =>'Doctrine\DBAL\Driver\PDOMySql\Driver',
'params' => array(
'host' => 'localhost',
'port' => '3306',
'user' => '',
'password' => '',
'dbname' => '',
'driverOptions' => array(1002 => 'SET NAMES utf8'),
),
),
),
'driver' => array(
'orm_toto_users' => array(
'class' => 'Doctrine\ORM\Mapping\Driver\DriverChain',
'drivers' => array(
__NAMESPACE__ . '\Entity' => __NAMESPACE__ . '_driver'
)
),
'dynamic_orm' => array(
'drivers' => array(
__NAMESPACE__ . '\Entity' => __NAMESPACE__ . '_driver'
)
),
),
'entitymanager' => array(
'orm_toto_users' => array(
'connection' => 'orm_toto_users',
'configuration' => 'orm_default'
),
'dynamic_orm' => array(
'connection' => 'dynamic_orm',
),
),
'eventmanager' => array(
'orm_toto_users' => array()
),
'sql_logger_collector' => array(
'orm_toto_users' => array(),
),
'entity_resolver' => array(
'orm_toto_users' => array()
),),
module.config.php :
'doctrine' => array(
'driver' => array(
__NAMESPACE__ . '_driver' => array(
'class' => 'Doctrine\ORM\Mapping\Driver\AnnotationDriver',
'cache' => 'array',
'paths' => array(
__DIR__ . '/../src/' . __NAMESPACE__ . '/Entity'
),
),
'orm_default' => array(
'drivers' => array(
__NAMESPACE__ . '\Entity' => __NAMESPACE__ . '_driver'
)
),
),
'authentication' => array(
'orm_default' => array(
'object_manager' => 'doctrine.entitymanager.orm_toto_users',
'identity_class' => 'MyModule\Entity\User',
'identity_property' => 'identifiant',
'credential_property' => 'password',
'credential_callable' => function(\MyModule\Entity\User $user, $passwordGiven) {
$bcrypt = new \Zend\Crypt\Password\Bcrypt();
return $bcrypt->verify($psswdGiven, $user->getPsswd()) && $user->getIsactif();
},
),
),
),
in Xcontroller :
public function getEntityManager()
{
if (null === $this->em) {
$this->em = $this->getServiceLocator()->get('dynamic_entity_manager');
}
return $this->em;
}
in userController :
public function getEntityManager()
{
if (null === $this->em) {
$this->em = $this->getServiceLocator()->get('doctrine.entitymanager.orm_toto_users');
}
return $this->em;
}
in DynamicEMFactory.php:
class DynamicEMFactory implements FactoryInterface {
public function createService(ServiceLocatorInterface $serviceLocator)
{
// Get current user
$authService = $serviceLocator->get('Zend\Authentication\AuthenticationService');
if (! $authService->hasIdentity()) {
throw new \RuntimeException(
'It is not possible to create a dynamic entity manager before a user has logged in'
);
}
$user = $authService->getIdentity();
$db_User = $user->getUser_db()->getDbuser();
$db_Psswd = $user->getUser_db()->getDbpsswd();
$db_Name = $user->getUser_db()->getDbname();
// Update connection config
$globalConfig = $serviceLocator->get('config');
$globalConfig['doctrine']['connection']['dynamic_orm']['params']['user'] = $db_User;
$globalConfig['doctrine']['connection']['dynamic_orm']['params']['password'] = $db_Psswd;
$globalConfig['doctrine']['connection']['dynamic_orm']['params']['dbname'] = $db_Name;
$isAllowOverride = $serviceLocator->getAllowOverride();
$serviceLocator->setAllowOverride(true);
$serviceLocator->setService('config', $globalConfig);
$serviceLocator->setAllowOverride($isAllowOverride);
return $serviceLocator->get('doctrine.entitymanager.dynamic_orm');
}
}
in module.config :
'service_manager' => array(
'factories' => array(
'dynamic_entity_manager' => 'XXX\Service\Factory\DynamicEMFactory',
in onBootstrap (to change appearence):
$authService = $serviceManager->get('Zend\Authentication\AuthenticationService');
if ($authService->getIdentity()) {
$em = $serviceManager->get('dynamic_entity_manager');
} else {
$em = $serviceManager->get('doctrine.entitymanager.orm_default');
}
$viewModel = $e->getApplication()->getMvcEvent()->getViewModel();
$query = $serviceManager->get('param_user');
$tab = $query->getReponse($em);
$nom_theme = $tab['something']));
$viewModel->nom_theme = $nom_theme;//to layout
$cmd = 'runInstances';
$result = $client->$cmd(array(
'ImageId' => selectAMI($_POST['dc'], $_POST['os']),
'MinCount' => 1,
'MaxCount' => 1,
'InstanceType' => $_POST['itype'],
'KeyName' => $_POST['key'],
'SecurityGroups' => array($securityGroupName),
'BlockDeviceMappings' => array(
'DeviceName' => '/dev/sda1',
array(
'Ebs' => array(
'SnapshotId' => 'snap-2337bd2a',
'VolumeSize' => $disksize,
'DeleteOnTermination' => true,
'VolumeType' => 'gp2',
'Encrypted' => false
)
)
)
));
What is wrong with this, it does not work and I get no error?
Your BlockDeviceMappings part is not structured correctly.
You have DeviceName outside the second array structure, where it should be inside.
Try this:
$cmd = 'runInstances';
$result = $client->$cmd(array(
'ImageId' => selectAMI($_POST['dc'], $_POST['os']),
'MinCount' => 1,
'MaxCount' => 1,
'InstanceType' => $_POST['itype'],
'KeyName' => $_POST['key'],
'SecurityGroups' => array($securityGroupName),
'BlockDeviceMappings' => array(
array(
'DeviceName' => '/dev/sda1',
'Ebs' => array(
'SnapshotId' => 'snap-2337bd2a',
'VolumeSize' => $disksize,
'DeleteOnTermination' => true,
'VolumeType' => 'gp2',
'Encrypted' => false
)
)
)
));