I built spatialite library then gdal library with spatialite support. Also built mapserver which depends on gdal with success. There was no problem with linking.
When I try to execute a gdal utility I get:
$ ogrinfo.exe
/usr/local/bin/ogrinfo.exe: error while loading shared libraries: cyggdal-1.dll: cannot open shared object file: No such file or directory
But everything seems fine:
$ ldd /usr/local/bin/ogrinfo.exe
ntdll.dll => /cygdrive/c/WINDOWS/system32/ntdll.dll (0x7c900000)
kernel32.dll => /cygdrive/c/WINDOWS/system32/kernel32.dll (0x7c800000)
cyggdal-1.dll => /usr/local/bin/cyggdal-1.dll (0x710c0000)
cygcurl-4.dll => /usr/bin/cygcurl-4.dll (0x63d80000)
cyggcc_s-1.dll => /usr/bin/cyggcc_s-1.dll (0x67f00000)
cygwin1.dll => /usr/bin/cygwin1.dll (0x61000000)
ADVAPI32.DLL => /cygdrive/c/WINDOWS/system32/ADVAPI32.DLL (0x77dd0000)
RPCRT4.dll => /cygdrive/c/WINDOWS/system32/RPCRT4.dll (0x77e70000)
Secur32.dll => /cygdrive/c/WINDOWS/system32/Secur32.dll (0x77fe0000)
cygcrypto-0.9.8.dll => /usr/bin/cygcrypto-0.9.8.dll (0x6ba40000)
cygidn-11.dll => /usr/bin/cygidn-11.dll (0x6c200000)
cygiconv-2.dll => /usr/bin/cygiconv-2.dll (0x674c0000)
cygintl-8.dll => /usr/bin/cygintl-8.dll (0x6f5c0000)
cygssh2-1.dll => /usr/bin/cygssh2-1.dll (0x69ec0000)
cygz.dll => /usr/bin/cygz.dll (0x692c0000)
cygssl-0.9.8.dll => /usr/bin/cygssl-0.9.8.dll (0x63400000)
cygexpat-1.dll => /usr/bin/cygexpat-1.dll (0x66ec0000)
cyggeos_c-1.dll => /usr/bin/cyggeos_c-1.dll (0x70180000)
cyggeos-3-1-1.dll => /usr/bin/cyggeos-3-1-1.dll (0x4e0000)
cygjpeg-7.dll => /usr/bin/cygjpeg-7.dll (0x66e00000)
cygpng12.dll => /usr/bin/cygpng12.dll (0x6f200000)
If I copy the cyggdal-1.dll to the current folder:
$ ogrinfo.exe
/usr/local/bin/ogrinfo.exe: error while loading shared libraries: ?: cannot open shared object file: No such file or directory
So what is a '?' library?
$ ldd cyggdal-1.dll
ntdll.dll => /cygdrive/c/WINDOWS/system32/ntdll.dll (0x7c900000)
kernel32.dll => /cygdrive/c/WINDOWS/system32/kernel32.dll (0x7c800000)
??? => ??? (0x710c0000)
??? => ??? (0x63d80000)
??? => ??? (0x67f00000)
??? => ??? (0x61000000)
??? => ??? (0x77dd0000)
??? => ??? (0x77e70000)
??? => ??? (0x77fe0000)
??? => ??? (0x6ba40000)
??? => ??? (0x6c200000)
??? => ??? (0x674c0000)
??? => ??? (0x6f5c0000)
??? => ??? (0x69ec0000)
??? => ??? (0x692c0000)
??? => ??? (0x63400000)
??? => ??? (0x66ec0000)
??? => ??? (0x70180000)
??? => ??? (0x4b0000)
??? => ??? (0x66e00000)
??? => ??? (0x6f200000)
What are these "???" ? How to solve this problem?
I used cmd to execute the utility and it showed a popup with the name of missing dll.
Related
I have been provided with .so file.
ldd libTodoAPI.so
linux-vdso.so.1 => (0x00007ffc766b8000)
libcrypto.so.1.0.0 => /lib/x86_64-linux-gnu/libcrypto.so.1.0.0 (0x00007fead8e3f000)
libsqlite3.so => /usr/lib/libsqlite3.so (0x00007fead8b6a000)
libQt5Network.so.5 => /usr/lib/libQt5Network.so.5 (0x00007fead8804000)
libQt5Script.so.5 => /usr/lib/libQt5Script.so.5 (0x00007fead838b000)
libQt5Core.so.5 => /usr/lib/libQt5Core.so.5 (0x00007fead7c4f000)
libstdc++.so.6 => /usr/lib/x86_64-linux-gnu/libstdc++.so.6 (0x00007fead78cd000)
libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007fead76b7000)
libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007fead72ed000)
libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007fead70e9000)
libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007fead6ecc000)
libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007fead6bc3000)
libicui18n.so.53 => /usr/lib/libicui18n.so.53 (0x00007fead6777000)
libicuuc.so.53 => /usr/lib/libicuuc.so.53 (0x00007fead63ec000)
libgthread-2.0.so.0 => /usr/lib/x86_64-linux-gnu/libgthread-2.0.so.0 (0x00007fead61ea000)
librt.so.1 => /lib/x86_64-linux-gnu/librt.so.1 (0x00007fead5fe2000)
libglib-2.0.so.0 => /lib/x86_64-linux-gnu/libglib-2.0.so.0 (0x00007fead5cd1000)
/lib64/ld-linux-x86-64.so.2 (0x00007fead949a000)
libicudata.so.53 => /usr/lib/libicudata.so.53 (0x00007fead4649000)
libpcre.so.3 => /lib/x86_64-linux-gnu/libpcre.so.3 (0x00007fead43d9000)
and with header
#ifndef TODO_API_H
#define TODO_API_H
#include <string>
using namespace std;
namespace todoarea {
class TodoAPI{
public:
static string checkDoer();
static string getInformation();
static string callTask(string funcName, string param);
static string Done(string param);
static string returnStatus(string param);
static string Close();
};
}
#endif //TODO_API_H
I am trying to create a program to call from this shared object and having problem.
//load.cpp
#include <iostream>
#include "TodoAPI.h"
using namespace todoarea;
int main(int argc, char **argv)
{
// TodoAPI* myTodo = new TodoAPI();
// myTodo>checkDoer();
// TodoAPI m;
string data = TodoAPI::checkDoer();
string a = TodoAPI::getInformation();
}
When I try to compile it
g++ load.cpp -lTodoAPI
/tmp/ccs1hwWP.o: In function `main':
load.cpp:(.text+0x27): undefined reference to `todoarea::TodoAPI::checkDoer[abi:cxx11]()'
load.cpp:(.text+0x33): undefined reference to `todoarea::TodoAPI::getInformation[abi:cxx11]()'
collect2: error: ld returned 1 exit status
If I try to see the so file
nm -s libTodoAPI.so
nm: libTodoAPI.so: no symbols
Also
nm -DC libTodoAPI.so | grep todoarea
000000000000a63a T todoarea::TodoAPI::Done(std::string)
000000000000a098 T todoarea::TodoAPI::callTask(std::string, std::string)
0000000000009e9c T todoarea::TodoAPI::getInformation()
000000000000a398 T todoarea::TodoAPI::returnStatus(std::string)
0000000000009ca0 T todoarea::TodoAPI::checkDoer()
000000000000a8dc T todoarea::TodoAPI::Close()
It has lots of functions (mostly seems like Qt) listed when I try nm with -D option.
Question: How can I use this library to create app in linux? What am I doing wrong? I tried to call functions dynamically but failed. Any help would be appreciated.
You are falling foul of an ABI break between the GCC release with libTodoAPI.so
was built and the one with which you are compiling your code. See Dual ABI Troubleshooting
Troubleshooting
If you get linker errors about undefined references to symbols that involve types in the
std::__cxx11 namespace or the tag [abi:cxx11] then it probably indicates that you are
trying to link together object files that were compiled with different values for the
_GLIBCXX_USE_CXX11_ABI macro. This commonly happens when linking to a third-party library that
was compiled with an older version of GCC. If the third-party library cannot be rebuilt
with the new ABI then you will need to recompile your code with the old ABI.
I was trying to create a new file in my module, but every time I am getting an error for my file resource, saying:
File paths must be fully qualified, not '/the/path/that/I/have/given'.
What are the possible reasons for that error?
class fresh_start {
file { 'source_file.rb':
ensure => 'file',
source => 'puppet:///modules/fresh_start/source_file.rb',
path => '/etc/puppetlabs/code/environments/production/modules/fresh_start/destination_file.rb',
owner => 'root',
group => 'root',
mode => '0755', # Use 0700 if it is sensitive
notify => Exec['run_my_ruby']
}
exec { 'run_my_ruby':
command => 'ruby etc/puppetlabs/code/environments/production/modules/fresh_start/source_file.rb > /etc/puppetlabs/code/environments/production/modules/fresh_start/output.txt',
refreshonly => true,
}
}
I have also tried to put the file path in a variable and use that variable as the path attribute's value, but I got the same error.
This happens when you attempt to run code with Unix paths on Windows. Check out the Puppet source code here and here.
Using a debugger, we can see that Unix-style paths are rejected on a Windows platform:
[1] pry(main)> slash = '[\\\\/]'
=> "[\\\\/]"
[2] pry(main)> label = '[^\\\\/]+'
=> "[^\\\\/]+"
[3] pry(main)> AbsolutePathWindows = %r!^(?:(?:[A-Z]:#{slash})|(?:#{slash}#{slash}#{label}#{slash}#{label})|(?:#{slash}#{slash}\?#{slash}#{label}))!io
=> /^(?:(?:[A-Z]:[\\\/])|(?:[\\\/][\\\/][^\\\/]+[\\\/][^\\\/]+)|(?:[\\\/][\\\/]\?[\\\/][^\\\/]+))/i
[4] pry(main)> path = '/foo/bar'
=> "/foo/bar"
[5] pry(main)> path =~ AbsolutePathWindows
=> nil
I am having issues with puppet modules, and this modules should replace /etc/ssh/sshd_config file based on Redhat version. So the issue is, after applying the code, puppet deleted the file, instead of replacing it.
someone please suggest any wrong with my code.
here is the my puppet manifest file;
class os_vul_ssh {
case $::operatingsystemmajrelease {
'6':{$sshconfigfile = 'sshd_config.rhel6'}
'7':{$sshconfigfile = 'sshd_config.rhel7'}
}
package { "openssh-server":
ensure => installed,
}
service { 'sshd':
ensure => "running",
enable => true,
require => Package["openssh-server"],
}
file { "/etc/ssh/sshd_config":
owner => root,
group => root,
mode => '0644',
source => "puppet:///modules/os_vul/${::sshconfigfile}",
require => Package["openssh-server"],
notify => Service["sshd"],
}
}
file { "/etc/ssh/sshd_config":
ensure => file, <----- this is missing
owner => root,
group => root,
mode => '0644',
source => "puppet:///modules/os_vul/${::sshconfigfile}",
require => Package["openssh-server"],
notify => Service["sshd"],
}
Might be more going on here, but this is the first issue that jumps out at me.
By the way, you can cleanup your code with this:
file { "/etc/ssh/sshd_config":
ensure => file,
owner => root,
group => root,
mode => '0644',
source => "puppet:///modules/os_vul/sshd_config.rhel${::operatingsystemmajrelease}",
require => Package["openssh-server"],
notify => Service["sshd"],
}
and if you are using Facter 3 then consider changing your fact to:
$facts['operatingsystemmajrelease']
and note that your sshconfigfile is a local variable and should be included in your file resource as a local variable $sshconfigfile and not global $::sshconfigfile.
I've recently started to read about Asterisk and I really liked the idea of using the GoSub() function, but for some unknown to me reason I it seems that it is not installed:
Im using Asterisk 11.5.1
Below is my extensions.conf file:
[default]
exten => _.,1,Hangup()
[internal]
exten => 101,1,Noop(Going to internal contex exten:${EXTEN})
same => n,GoSub(sub-logger,start,1())
same => Dial(SIP/stefan)
exten => 102,1,Noop(Going to internal contex exten:${EXTEN})
same => n,GoSub(sub-logger,start,1())
same => n,Dial(SIP/nasko)
exten => 103,1,Noop(Na babati fyr4iloto)
exten => _9.,1,Dial(SIP/${EXTEN:1}#planet-phone)
exten => _.,1,Hangup()
[external]
exten => _.,1,Hangup()
[sub-logger]
exten => start,1,Noop(inside the subroutine)
;same => n,Noop(Channel : ${CHANNEL})
;same => n,Noop(Context : ${CONTEXT})
;same => n,Noop(Extensions : ${EXTEN})
;same => n,Noop(Date/time call : ${DATETIME})
same => n,Return()
When I register and try to call 101 or 102 I receive the following in the console:
== Using SIP RTP CoS mark 5
-- Executing [101#internal:1] NoOp("SIP/nasko-00000033", "Going to internal contex exten:101") in new stack
[Sep 22 19:47:41] WARNING[18071][C-00000025]: pbx.c:4621 pbx_extension_helper:No application 'GoSub' for extension (internal, 101, 2)
== Spawn extension (internal, 101, 2) exited non-zero on 'SIP/nasko-00000033'
-- Executing [h#internal:1] Hangup("SIP/nasko-00000033", "") in new stack
== Spawn extension (internal, h, 1) exited non-zero on 'SIP/nasko-00000033'
I searched a lot on in google but I wasnt able to find any explanation for this problem.
If someone has any idea please share it here!
THanks!
Did you load the app_stack module?
Maybe you want to add autoload on in modules.conf
I am getting this error when applying my Puppet manifest:
Error: Could not apply complete catalog: Found 1 dependency cycle:
(Exec[pip install requirements] => File[change venv permissions] => File[enforce MinGW compiler] => Exec[pip install requirements])
Try the '--graph' option and opening the resulting '.dot' file in OmniGraffle or GraphViz
Here is my Puppet manifest (the relevant part) and I don't see any dependency cycle there. Any ideas?
exec {'create virtualenv':
command => "$install_dir/Scripts/virtualenv.exe venv",
cwd => $project_dir,
require => Exec['install virtualenv'],
}
file { "fix Mingw32CCompiler":
path => "C:/Python27/Lib/distutils/cygwinccompiler.py",
content => template($cygwinc_template),
ensure => present,
require => Exec['create virtualenv'],
}
file { "enforce MinGW compiler":
path => "$project_dir/venv/Lib/distutils/distutils.cfg",
owner => $user,
content => $mingw,
ensure => present,
require => File['fix Mingw32CCompiler'],
}
exec {'pip install requirements':
timeout => 1200,
command => "$project_dir/venv/Scripts/pip.exe install -r $project_dir/requirements.txt",
require => File['enforce MinGW compiler'],
}
file {'change venv permissions':
path => "$project_dir/venv",
recurse => true,
owner => $user,
mode => 0770,
require => Exec['pip install requirements'],
}
In puppet files have an implicit require for any parent directories that are declared.
Effectively:
File['change venv permissions'] -> File['enforce MinGW compiler']
So the parent requires the exec, the exec requires the child, and the child requires the parent, creating a loop.
What was your last change (that's probably the moment you added the cycle).
Try the suggestion to generate the graph. Post the generated dot file as gist so that we can investigate further.
Take a look at Debugging cycle or missing dependency.