c program security_getenforce() not found - c

I am trying to gcc my library with another static library and I get this error while runtime
undefined symbol: security_getenforce
I am thinking this is related to selinux, not sure though... how do I resolve this?
Thanks,
Vik.

Figured it out, use -lselinux as the flag to resolve the issue and load the necessary libraries.

Related

kallsyms_lookup_name undefined error in 5.10.0-kali7-amd64

I'm trying to make a basic kernel hook which happens to use kallsyms_lookup_name, but each time i try to compile the module i get modpost: "kallsyms_lookup_name" [<path to .ko>] undefined!
I have MODULE_LICENSE("GPL") in my module, in /proc/kallsyms i found T kallsyms_lookup_name, but in /lib/modules/<kernel>/build/Module.symvers i couldn't find it. So is the symbol not exported and if not, what do I do to export it?
I'm pretty new to kernel programming.
You can't use it cause it's not exported by the latest kernels. You always can build your own kernel, just undo these changes - git patch. However, that's not good for production :)

Uncaught ReferenceError: require is not defined at typeahead.js:2

I am getting following Error as I used Ui.bootstrap's typeahead library
Uncaught ReferenceError: require is not defined
at typeahead.js:2
Tried googling for this but nothing helpful found,Any help will be appreciated
Thanks in advance
Require doesn't work in browser.Basically require is a node_module by which we can access other modules or files.So please if you are using it on browser side then try other things like import or self.import.
Please refer this stack question and answer by Latheesan
Please also check require.js as well.
require.js

Borland C++ Builder 4 [Linker Error] Unresolved external

I'm trying to compile an old project in Borland C++ Builder 4. I have a working exe and the source files for that, therefore someone must have managed to compile it earlier. However, when I open the project, check if the project hs all the necessary files in the resources and try to compile it, I keep getting the following linker error:
[Linker Error] Unresolved external '_fastcall TMapperForm::Button1Click(System::TObject*)' referenced from ...\Unit1.obj
I can see that it cannot find an object in the library but I am not sure how to resolve it, because the obj file with the same name as the main cpp file is in the same file as the other files of the project and seems fine.
I have looked through the answers provided here for similar linker errors but none of what these have suggested worked for me. I have already tried the following:
Adding the .obj file to the Project Resources.
Trying to add pragma lines manually such as #pragma link (Unit1.obj)
Making sure that in Project>Options>Directories the right Include and Library paths were selected.
Checking if all the packages have been added.
None of this seems to work. I am fairly new to C++ and C++ Builder, so I am hoping that it is something trivial.
Has anybody seen this particular error?
The error was caused by a missing handler or more precisely a handler containing nothing.
While the handler for the button contained nothing, the TMapperForm class still included the definitions for an extra button named Button1 but it was not used. Commenting out the method and the declaration in the TMapperForm class (in the header file for Unit1) along with the handler in the C++ file resolved the problem.

Code composer inline function linker error

I am working with Code Composer Studio and I need to inline some functions.
So I put them in a header file (or in .inl file referred by a header, both ways) and try to build my project.
The problem comes when I increase the optimization level. The project builds successfully under no optimization, (off or none) but the linker fails to link them and returns:
error #10234-D: unresolved symbols remain
error #10010: errors encountered during linking;
Has anyone encountered similar issues?
Is is because am not utilizing some kind of flag in the compiler options?
Please check this link http://e2e.ti.com/support/development_tools/code_composer_studio/f/81/t/249183.aspx .
When SW_ROOT was correctly defined, this issue was resolved.

How can I import compiled C++ libraries into an Objective-C++ project in Xcode 4?

I'm trying to use the SkypeKit SDK to create an Objective-C++ project using Xcode 4. I have two compiled libraries from SkypeKit, libskypekit_cyassl_lib.a and libskypekit_cppwrapper_2_lib.a, which I need to be able to use so as to access the Skype API.
I've added in both .a files under 'Linked Frameworks and Libraries' and added -all_load -ObjC -lstdc++ to the 'Other Linker Flags', and that builds okay, but as soon as I try to use any of the methods in those libraries, building fails.
Any help would be greatly appreciated, thank you!
You can call C++ code from Objective-C++, which means that your files should have the .mm extension instead of .m
I assume that this could be the issue, but since you did not specify the errors you get it is just a guess. Specifically, if you call C++ code from a .m file you get compilation errors.
Another possible cause is forgetting to import the header files of the library. For the import to be successful, you also have to add the directory where the headers are to your project "header search path".
If this does not help, please post the error message.

Resources