VS ERROR: libconfig.obj : error LNK2019: unresolved external symbol _S_ISDIR referenced in function _config_read_file - libconfig

Download libconfig from http://www.hyperrealm.com/libconfig/libconfig_manual.html.
But there is error on windows.
libconfig.obj : error LNK2019: unresolved external symbol _S_ISDIR referenced in function _config_read_file

S_ISDIR is defined in ,which is in linux system.so, if use it in function _config_read_file", you should define S_ISDIR in libconfig like this.
#define S_ISDIR(m) (((m) & 0170000) == (0040000))

Related

Flutter problem: Error when building for Web

Fairly new to Flutter, decided to build for Web and got these following errors:
Launching lib\main.dart on Edge in debug mode...
lib\main.dart:1
: Error: Error when reading '../../../AppData/Local/Pub/Cache/hosted/pub.dartlang.org/firebase_core-1.24.0/lib/src/internals.dart': The system cannot find the file specified.
../…/src/internals.dart:1
export 'package:firebase_core/src/internals.dart' hide guard;
^
: Error: Error when reading '../../../AppData/Local/Pub/Cache/hosted/pub.dartlang.org/firebase_core-1.24.0/lib/src/internals.dart': The system cannot find the file specified.
../…/src/internals.dart:5
import 'package:firebase_core/src/internals.dart' as internals;
^
: Error: Error when reading '../../../AppData/Local/Pub/Cache/hosted/pub.dartlang.org/firebase_core-1.24.0/lib/src/internals.dart': The system cannot find the file specified.
../…/src/internals.dart:2
export 'package:firebase_core/src/internals.dart' hide guardWebExceptions;
^
: Error: Error when reading '../../../AppData/Local/Pub/Cache/hosted/pub.dartlang.org/firebase_core-1.24.0/lib/src/internals.dart': The system cannot find the file specified.
../…/src/internals.dart:6
import 'package:firebase_core/src/internals.dart' as internals;
^
: Error: Method not found: 'guard'.
../…/src/internals.dart:10
return internals.guard(
^^^^^
: Error: Method not found: 'guardWebExceptions'.
../…/src/internals.dart:11
return internals.guardWebExceptions(
^^^^^^^^^^^^^^^^^^
Failed to compile application.
Exited (sigterm)
I tried upgrading packages, but no luck. Any idea what might be causing this issue?

Align.so; symbol lookup error; undefined symbol

I am running a perl script on a web server. I am getting the error in the httpd error log file:
/usr/bin/perl: symbol lookup error:
/usr/local/lib64/perl5/auto/Bio/Ext/Align/Align.so:
undefined symbol:
bp_sw_read_Blast_file_CompMat, referer: http://XX/model_select.pl
[Line breaks added for readability]
I checked some of the forums and did this:
cpanp -i /usr/local/lib64/perl5/auto/Bio/Ext/Align/Align.so
ERROR '/usr/local/lib64/perl5/auto/Bio/Ext/Align/Align.so' does not contain an author part
ERROR Cannot find '/usr/local/lib64/perl5/auto/Bio/Ext/Align/Align.so' in the module tree
No such module: /usr/local/lib64/perl5/auto/Bio/Ext/Align/Align.so
No modules found to operate on!
Nothing done
I checked, Align.so exists in the path shown in the error message
Can someone please help me solve the problem. Thanks much ! :-)

Building a statically linked executable with Swift on Ubuntu

I'm trying to build an statically linked executable from a swift source on Ubuntu.
Calling
swift build -Xswiftc -static-stdlib
as suggested in Compile Swift script with static Swift core library
returns this error:
/usr/bin/ld.gold: error: cannot find -lFoundation
Some educated guesses:
Researching this hasn't led me very far, I know it means the library can't be found. Maybe it isn't in the compiler's path ?
Full error message:
user#user-VirtualBox:/path/to/project$ swift build -Xswiftc -static-stdlib
Compile Swift Module 'projectName' (4 sources)
Linking ./.build/debug/projectName
/usr/bin/ld.gold: error: cannot find -lFoundation
/usr/bin/ld.gold: error: cannot find -lFoundation
/usr/bin/ld.gold: error: cannot find -lFoundation
/usr/bin/ld.gold: error: cannot find -lFoundation
/path/to/project/Sources/SomeClass_1.swift:67: error: undefined reference to '_TMaC10Foundation17JSONSerialization'
/path/to/project/Sources/SomeClass_1.swift:67: error: undefined reference to '_TFVC10Foundation17JSONSerialization14WritingOptionsau13prettyPrintedS1_'
/path/to/project/Sources/SomeClass_1.swift:68: error: undefined reference to '_TMaC10Foundation8NSString'
/path/to/project/Sources/SomeClass_1.swift:68: error: undefined reference to '_TFVE10FoundationSS8Encodingau4utf8S0_'
/path/to/project/Sources/SomeClass_1.swift:68: error: undefined reference to '_TFC10Foundation8NSStringCfT4dataVS_4Data8encodingSu_GSqS0__'
/path/to/project/Sources/SomeClass_1.swift:69: error: undefined reference to '_TWPC10Foundation8NSObjects9EquatableS_'
/path/to/project/Sources/SomeClass_1.swift:72: error: undefined reference to '_TFC10Foundation8NSStringCfT13stringLiteralVs12StaticString_S0_'
/path/to/project/Sources/SomeClass_1.swift:76: error: undefined reference to '_TMaC10Foundation8NSString'
/path/to/project/Sources/SomeClass_1.swift:76: error: undefined reference to '_TFC10Foundation8NSStringCfT13stringLiteralVs12StaticString_S0_'
/path/to/project/Sources/SomeClass_2.swift:73: error: undefined reference to '_TMaC10Foundation17JSONSerialization'
/path/to/project/Sources/SomeClass_2.swift:73: error: undefined reference to '_TFVC10Foundation17JSONSerialization14WritingOptionsau13prettyPrintedS1_'
/path/to/project/Sources/SomeClass_2.swift:74: error: undefined reference to '_TMaC10Foundation8NSString'
/path/to/project/Sources/SomeClass_2.swift:74: error: undefined reference to '_TFVE10FoundationSS8Encodingau4utf8S0_'
/path/to/project/Sources/SomeClass_2.swift:74: error: undefined reference to '_TFC10Foundation8NSStringCfT4dataVS_4Data8encodingSu_GSqS0__'
/path/to/project/Sources/SomeClass_2.swift:75: error: undefined reference to '_TWPC10Foundation8NSObjects9EquatableS_'
/path/to/project/Sources/SomeClass_2.swift:78: error: undefined reference to '_TFC10Foundation8NSStringCfT13stringLiteralVs12StaticString_S0_'
/path/to/project/Sources/SomeClass_2.swift:82: error: undefined reference to '_TMaC10Foundation8NSString'
/path/to/project/Sources/SomeClass_2.swift:82: error: undefined reference to '_TFC10Foundation8NSStringCfT13stringLiteralVs12StaticString_S0_'
/path/to/project/Sources/SomeClass_3.swift:106: error: undefined reference to '_TMaC10Foundation17JSONSerialization'
/path/to/project/Sources/SomeClass_3.swift:106: error: undefined reference to '_TFVC10Foundation17JSONSerialization14WritingOptionsau13prettyPrintedS1_'
/path/to/project/Sources/SomeClass_3.swift:107: error: undefined reference to '_TFVE10FoundationSS8Encodingau4utf8S0_'
/path/to/project/Sources/SomeClass_3.swift:107: error: undefined reference to '_TFC10Foundation8NSStringCfT4dataVS_4Data8encodingSu_GSqS0__'
/path/to/project/Sources/SomeClass_3.swift:108: error: undefined reference to '_TWPC10Foundation8NSObjects9EquatableS_'
/path/to/project/Sources/main.swift:24: error: undefined reference to '_TMaC10Foundation12NSDictionary'
/path/to/project/Sources/main.swift:24: error: undefined reference to '_TFC10Foundation12NSDictionaryCft17dictionaryLiteralGSaTP_P____S0_'
/path/to/project/Sources/main.swift:51: error: undefined reference to '_TMaC10Foundation12NSDictionary'
/path/to/project/Sources/main.swift:51: error: undefined reference to '_TFC10Foundation12NSDictionaryCft17dictionaryLiteralGSaTP_P____S0_'
/path/to/project/Sources/main.swift:99: error: undefined reference to '_TMaC10Foundation12NSDictionary'
/path/to/project/Sources/main.swift:99: error: undefined reference to '_TFC10Foundation12NSDictionaryCft17dictionaryLiteralGSaTP_P____S0_'
/path/to/project/Sources/main.swift:112: error: undefined reference to '_TMaC10Foundation12NSDictionary'
/path/to/project/Sources/main.swift:112: error: undefined reference to '_TFC10Foundation12NSDictionaryCft17dictionaryLiteralGSaTP_P____S0_'
/path/to/project/Sources/main.swift:167: error: undefined reference to '_TMaC10Foundation17JSONSerialization'
/path/to/project/Sources/main.swift:167: error: undefined reference to '_TFVC10Foundation17JSONSerialization14WritingOptionsau13prettyPrintedS1_'
/path/to/project/Sources/main.swift:168: error: undefined reference to '_TFVE10FoundationSS8Encodingau4utf8S0_'
/path/to/project/Sources/main.swift:168: error: undefined reference to '_TFC10Foundation8NSStringCfT4dataVS_4Data8encodingSu_GSqS0__'
/path/to/project/Sources/main.swift:169: error: undefined reference to '_TWPC10Foundation8NSObjects9EquatableS_'
clang: error: linker command failed with exit code 1 (use -v to see invocation)
<unknown>:0: error: link command failed with exit code 1 (use -v to see invocation)
<unknown>:0: error: build had 1 command failures
error: exit(1): /path/to/swift-3.0.2-RELEASE-ubuntu16.04/usr/bin/swift-build-tool -f /path/to/project/.build/debug.yaml
The problem is that Foundation is not available as static library. There is an open bug for this:
https://bugs.swift.org/browse/SR-2205
You might be able to work around this problem if you could build a static Foundation lib, e.g. as part of building Swift from source.

How to load shared library created in Matlab

I tried to create an OpenModelica model with liquid flow and Media.
And I have a function in Matlab that calculates the PDE (partial differential equation) in pdetool.
I would like to create a shared dynamic library (.so file) in Matlab by MCR and load it in the model.
My platform: OpenModelica used on Linux or Mac OS. MCR on Linux and Mac OS installed.
In Matlab I can generate only DLL (may be it's possible to generate libmyfunc.so?).
When I try to compile the model with extern C function I got an error:
#omc +s test_matlab_so.mo func_mathlab.mo
#make -f test_matlab_so.makefile
/usr/bin/clang -Wimplicit-function-declaration -O0 -falign-functions -march=native -I"/opt/openmodelica/include/omc/c" -I. -DOPENMODELICA_XML_FROM_FILE_AT_RUNTIME -c -o test_matlab_so_functions.o test_matlab_so_functions.c
clang: warning: optimization flag '-falign-functions' is not supported
clang: warning: argument unused during compilation: '-falign-functions'
In file included from test_matlab_so_functions.c:7:
In file included from ./test_matlab_so_includes.h:4:
./shared_train/src/lib_summ.c:90:8: warning: implicit declaration of function 'GetModuleFileName' is invalid in C99 [-Wimplicit-function-declaration]
if (!GetModuleFileName(GetModuleHandle("lib_summ"), path_to_dll, _MAX_PATH))
^
./shared_train/src/lib_summ.c:90:26: warning: implicit declaration of function 'GetModuleHandle' is invalid in C99 [-Wimplicit-function-declaration]
if (!GetModuleFileName(GetModuleHandle("lib_summ"), path_to_dll, _MAX_PATH))
^
./shared_train/src/lib_summ.c:90:55: error: use of undeclared identifier 'path_to_dll'
if (!GetModuleFileName(GetModuleHandle("lib_summ"), path_to_dll, _MAX_PATH))
^
./shared_train/src/lib_summ.c:90:68: error: use of undeclared identifier '_MAX_PATH'
if (!GetModuleFileName(GetModuleHandle("lib_summ"), path_to_dll, _MAX_PATH))
^
./shared_train/src/lib_summ.c:94:37: error: use of undeclared identifier 'path_to_dll'
mclGetEmbeddedCtfStream(path_to_dll);
^
test_matlab_so_functions.c:19:16: warning: implicit declaration of function '_mlfSumm' is invalid in C99 [-Wimplicit-function-declaration]
_v_out_ext = _mlfSumm(_v_a_ext, _v_b_ext);
^
3 warnings and 3 errors generated.
make: *** [test_matlab_so_functions.o] Error 1
Can someone help me with integrating OpenModelica and Matlab?
I don't have much experience with Linux but I did the same thing in Windows using MCR. Check this out:
http://de.mathworks.com/matlabcentral/answers/94471-how-do-i-create-a-c-c-shared-library-with-matlab-compiler-that-can-be-used-in-a-microsoft-visual-c
When you do this, you will get a DLL as well as a static library. You need to copy both of them into the folder that your modelica code is located at and then set the library in the "Library" attibute of your modelica function which calls the external function.
Keep in mind that if you are using a 64 or 32 bit dymola, you are supposed to create the DLL using the same version of matlab correspondingly.

AOSP building error: symbol not defined

I'm trying to build the cornerstone based on AOSP 4.3_r2.2. I got a lot of errors during the building like these:
frameworks/base/core/res/res/values/public.xml:244: error: Symbol 'config_bluetooth_adapter_quick_switch' declared with <java-symbol> not defined
frameworks/base/core/res/res/values/public.xml:1558: error: Symbol 'config_enableDreams' declared with <java-symbol> not defined
frameworks/base/core/res/res/values/public.xml:919: error: Symbol 'ic_suggestions_add' declared with <java-symbol> not defined
frameworks/base/core/res/res/values/public.xml:920: error: Symbol 'ic_suggestions_delete' declared with <java-symbol> not defined
frameworks/base/core/res/res/values/public.xml:1244: error: Symbol 'backspace' declared with <java-symbol> not defined
frameworks/base/core/res/res/values/public.xml:1250: error: Symbol 'carrier' declared with <java-symbol> not defined
frameworks/base/core/res/res/values/public.xml:130: error: Symbol 'dangerous_perms_list' declared with <java-symbol> not defined
frameworks/base/core/res/res/values/public.xml:1253: error: Symbol 'emergencyCallButton' declared with <java-symbol> not defined
frameworks/base/core/res/res/values/public.xml:1254: error: Symbol 'faceLockAreaView' declared with <java-symbol> not defined
frameworks/base/core/res/res/values/public.xml:1256: error: Symbol 'forgotPatternButton' declared with <java-symbol> not defined
frameworks/base/core/res/res/values/public.xml:1258: error: Symbol 'headerText' declared with <java-symbol> not defined
frameworks/base/core/res/res/values/public.xml:1260: error: Symbol 'instructions' declared with <java-symbol> not defined
frameworks/base/core/res/res/values/public.xml:1263: error: Symbol 'lockPattern' declared with <java-symbol> not defined
frameworks/base/core/res/res/values/public.xml:131: error: Symbol 'non_dangerous_perms_list' declared with <java-symbol> not defined
...
make: *** [out/target/common/obj/APPS/framework-res_intermediates/package-export.apk] Error 1
make: *** Deleting file `out/target/common/obj/APPS/framework-res_intermediates/package-export.apk'
make: *** Waiting for unfinished jobs....
I searched here and found this issue. So I know this could be missing the symbol definition problem. But when I look at the public.xml, I see they belong to different types like these:
<java-symbol type="bool" name="config_bluetooth_sco_off_call" />
<java-symbol type="bool" name="config_enableDreams" />
<java-symbol type="drawable" name="ic_suggestions_add" />
<java-symbol type="drawable" name="ic_suggestions_delete" />
<java-symbol type="id" name="backspace" />
<java-symbol type="id" name="carrier" />
<java-symbol type="id" name="dangerous_perms_list" />
...
I also found there's a script file at frameworks/base/core/res/MakeJavaSymbols.sed, it says the command
make framework 2>&1 | sed -n -f MakeJavaSymbols.sed | sort -u
can be used to generate the missing resources. I searched a lot, all I found just to run this command, and it'll output the missing parts. But I ran it, nothing happened. So my question is where and how should I add these missing symbols? There are hundreds of them, do I need to add them manually? Did I missed something? Since I'm new in AOSP framework, so please help.
Finally resolved the problem, by did these:
1. Removed the symbol definition from public.xml;
2. Replaced android.view.Surface with android.view.SurfaceControl, and WindowManagerService.DEFAULT_DIM_DURATION with WindowAnimator.DEFAULT_DIM_DURATION.
After that, I compile it succeed, and it can be run, although there still have some problems.