dynamic-linking

undefined reference to symbol 'XF86VidModeQueryExtension' (linux, qt creator IDE)

╄→гoц情女王★ 提交于 2019-12-01 20:24:27
I've been trying to get some simple GL code that implements GFLW3 to compile on QT Creator (on Ubuntu 13.04). However I keep getting the same output when it tries building: undefined reference to symbol 'XF86VidModeQueryExtension' I then went to the .pro file and linked the lXxf86vm.so library file and added -lXxf86vm but it still gives the same output: g++ -m64 -o GL-Test main.o windowtest.o frametest.o -L/usr/lib/x86_64-linux-gnu/libXxf86vm.so.1 -L/user/lib/x86_64-linux-gnu/libXxf86vm.so -L/user/lib/x86_64-linux-gnu/libXxf86vm.a -L/user/lib/x86_64-linux-gnu/libXxf86vm.so.1.0.0 -L/home/syk435

Linking is jacked up.. what is -rpath? MacOS X

情到浓时终转凉″ 提交于 2019-12-01 18:20:32
So, I'm building a project, and it uses functions from a compiled library (.dylib or .so). I have the headers and the library files (this is all part of QtRoot, btw) in appropriate locations, but when I try to build my project in Xcode, I get a debugger error: dyld: Library not loaded: @rpath/libRIO.so Referenced from: /Users/paulthompson/Documents/Programming/Build Products/Debug/MacHeliosSim.app/Contents/MacOS/MacHeliosSim Reason: image not found sharedlibrary apply-load-rules all Data Formatters temporarily unavailable, will re-try after a 'continue'. (Cannot call into the loader at present

Linking is jacked up.. what is -rpath? MacOS X

北慕城南 提交于 2019-12-01 18:13:20
问题 So, I'm building a project, and it uses functions from a compiled library (.dylib or .so). I have the headers and the library files (this is all part of QtRoot, btw) in appropriate locations, but when I try to build my project in Xcode, I get a debugger error: dyld: Library not loaded: @rpath/libRIO.so Referenced from: /Users/paulthompson/Documents/Programming/Build Products/Debug/MacHeliosSim.app/Contents/MacOS/MacHeliosSim Reason: image not found sharedlibrary apply-load-rules all Data

Mex function not updated after recompile

强颜欢笑 提交于 2019-12-01 17:34:10
I have a simple mex function, which calls another C++ function from a library. I compile the source with mex -cxx mymexfunction.cpp -I/some/include -L/some/lib -lmylib The mylib library is dynamic (.so) and is linked itself against some other libraries (boost, OpenCV and some more). The problem I am having is that once I have called the function mymexfunction once, it will not get updated when I recompile the source code. I have tried clear clear all clear mex clear functions clear fun('mymexfunction') munlock('mymexfunction') unloadlibrary('mymexfunction') ...but nothing helps! I have to

Linux C++ trys to load one specific library using an absolute path, while all otheres are linked using a relative one

时光毁灭记忆、已成空白 提交于 2019-12-01 12:34:04
I have the following Problem: I'm trying to create a portable version of my program, so I set rpath to "." so all libraries are linked using the relative file path. And this does work for all libraries except one. For some reason, the program only works if one specific library is present at the same position it was linked when it was compiled. Which is one I wrote myself, which also has its rpath set to ".". So basicly, the program will refuse to start even though the library is at the exact same position as the executable. I have verified that only that one library is the problem, because if

Memory Allocation in Static vs Dynamic Linking of C Runtime

孤人 提交于 2019-12-01 11:08:12
My program's architecture involves plugins (dlls) and the exe (obviously). We are the only plugin provider. I was told that allocating memory in a plugin and then freeing it in the exe code was a potential problem if we statically linked the c runtime. However, if we dynamically linked it, there was just one heap and the c runtime had access to all of it. We switched to dynamic linking on the basis of this advice, but all we've seen from the switch is headaches and trouble related to distribution and installation of the new runtimes. (Don't know what we avoided in terms of memory allocation

Memory Allocation in Static vs Dynamic Linking of C Runtime

﹥>﹥吖頭↗ 提交于 2019-12-01 08:11:01
问题 My program's architecture involves plugins (dlls) and the exe (obviously). We are the only plugin provider. I was told that allocating memory in a plugin and then freeing it in the exe code was a potential problem if we statically linked the c runtime. However, if we dynamically linked it, there was just one heap and the c runtime had access to all of it. We switched to dynamic linking on the basis of this advice, but all we've seen from the switch is headaches and trouble related to

Is there a way to get a class by name?

橙三吉。 提交于 2019-12-01 07:48:02
In Objective-C, is there a way to get a class and send messages to it when you have the name of the class as a string? For example, is there a function func where func(@"NSString") == [NSString class] ? The reason that I want to know this is I am building a dynamic linker library for a language I am working on, and I want it to have an interface to Objective-C libraries. Yes — two, in fact. If you have a Foundation-type framework (e.g. from Cocoa, Cocoa Touch or GNUstep), you can use the NSClassFromString() function, which is precisely the same as your func . If you do not want to depend on a

DYLD_PRINT_STATISTICS not showing anything

旧时模样 提交于 2019-12-01 05:48:59
I'm trying to profile app startup after moving from static libraries to frameworks. We have 30 or so frameworks (fyi: cocoapods) so I want to check that it's not affecting performance. Anecdotal testing in the team says that it isn't, but I would like some numbers as well! I've added the environment variables DYLD_PRINT_STATISTICS and DYLD_PRINT_LIBRARIES to see what the linker is doing, but all the output I get is from the DYLD_PRINT_LIBRARIES variable. I can see that the frameworks are loading correctly, but get no statistics from them. I've tried restarting the device to make sure that the

Compiling a custom malloc

跟風遠走 提交于 2019-12-01 05:11:54
I have written a custom library which implements malloc/calloc/realloc/free using the standard C prototypes, and I figured out how to compile it to an so. I want to test the library by linking a standard application against it? What would be a good way to do this? Once I have a working library I assume I can just load it with LD_PRELOAD, but how do I get my functions to co-exist with but take precedence over the system library ones? My functions need to make a call to malloc in order to get memory to run, so I can't just completely ditch stdlib... Help? Functions that you are trying to replace