linker

Finding address of variable in shared library

旧时模样 提交于 2020-01-07 19:36:10
问题 I would like to find the address in the .so file of a variable. I do not know the name of if, I only know that it is an integer, and I know the value of it. I also know that once the library is loaded and linked by the dynamic linker the address in the memory is 0x6416A0 relative to the library address. This offset is larger than the size of the dynamic library itself. I only have the binary, compiled version of the library. To find the address of the variable in the .so file I looked at it

Problems loading resources from function C++/SFML

一世执手 提交于 2020-01-07 07:28:28
问题 I have a stucture that I use to declare Textures, Sprites, Music, Fonts, Sounds, etc in a header. I then use a corresponding .cpp file to set said textures to their corresponding sprites, and so on. I have created the struct object in main, and called the function. But When I build my program, I get a million "undeclared identifier" errors. What am I doing wrong? Here's my code: resources.h: #ifndef __SFML__resources__ #define __SFML__resources__ #include "SFML/Audio.hpp" #include "SFML

#define vs const and linking against frameworks

こ雲淡風輕ζ 提交于 2020-01-07 06:15:27
问题 I have a really small lightweight application which needs to use some constants that are stored in a larger framework. I don't want to duplicate these constants and hardcode them into the lightweight application but I also don't want to have to link against the large framework to just get the constants. The constants are defined using static NSString *const in a header file. Does replacing the static NSString *const with #define prevent me from having to link against the whole framework ? To

#define vs const and linking against frameworks

[亡魂溺海] 提交于 2020-01-07 06:15:03
问题 I have a really small lightweight application which needs to use some constants that are stored in a larger framework. I don't want to duplicate these constants and hardcode them into the lightweight application but I also don't want to have to link against the large framework to just get the constants. The constants are defined using static NSString *const in a header file. Does replacing the static NSString *const with #define prevent me from having to link against the whole framework ? To

Swift link and build with C/C++ library

岁酱吖の 提交于 2020-01-07 02:57:12
问题 I don't have any prior experience with swift. I have a static library libseriallib.a which was written in C++ but has a C wrapper interface by using extern C . I want to link this library into a swift iOS application. I am creating this application from scratch. There are three libraries that libseriallib.a depends on. These are: libz.a , 'libcrypto.a , libssh.a`. I followed the second method mentioned here (Using module) and tried to build the project. However, I am confused how to link the

g++ Cygwin/Linux or version discrepancy

一世执手 提交于 2020-01-07 02:49:06
问题 Can someone explain the discrepancy in how two instances of g++ handle compilation of the following code to shared libraries? Foo.h #ifndef Foo_h #define Foo_h void Foo(); #endif // Foo_h Foo.cpp #include "Foo.h" #include <iostream> void Foo() { std::cout << "Greetings from Foo()!" << std::endl; } Bar.h #ifndef Bar_h #define Bar_h void Bar(); #endif // Bar_h Bar.cpp #include "Bar.h" #include "Foo.h" #include <iostream> void Bar() { Foo(); std::cout << "Greetings from Bar()!" << std::endl; }

How to link using an external pdb?

不想你离开。 提交于 2020-01-07 02:15:34
问题 In VS2012, I'm statically linking with a precompiled .lib, and need to also use that lib's .pdb file for debugging. How can I tell the linker that it should use that external pdb file? 回答1: If you created the static lib with /ZI or /Zi (see project settings for C/C++ -> General -> Debug Information Format), then the $(IntDir)vc$(PlatformToolsetVersion).pdb file is created. The path is defined by /Fd. A linker that uses the static library usually also refers to this pdb file. If you link an

Using libraries compiled for Windows on Linux

。_饼干妹妹 提交于 2020-01-07 00:31:13
问题 I'm curious. I have a library (static and dynamic version) compiled with visual studio for Windows 64bit which I want to use on Linux. This is a commercial library and to get the same library compiled for Linux will take many days of emailing and reminding and so on and so on. Can I use one of these two library variants (and these are not .net, but native libraries) to link to them on Linux machine? 回答1: Theoretically, you should be able to do so. It would be an awful lot of work, but this is

Make error: I want the make file to use gcc compiler flags but originally it uses intel

天大地大妈咪最大 提交于 2020-01-06 20:58:11
问题 I also tried make -icpc="CXX" make -icc="cc" gives the error. make: invalid option -- 'c' make: invalid option -- 'c' make: invalid option -- '=' make: invalid option -- 'c' make: invalid option -- 'c' Currently Loaded Module files: gcc make python/2.7.11 openmpi/1.10.1-gnu hdf5/1.8.10-intel boost/1.60.0-gnu5 mkl/2013.5.192 mpich/3.1.2-gnu 来源: https://stackoverflow.com/questions/43528646/make-error-i-want-the-make-file-to-use-gcc-compiler-flags-but-originally-it-use

run Qt app with dependent libraries on mac with no admin rights

≡放荡痞女 提交于 2020-01-06 19:49:12
问题 I am trying to build and run (and fix) an application that was written in Qt 4.8 for windows and then built on Linux. Trying to run it on Mac now. The app requires certain lib dependencies - some of them built separately that I have control over, and a couple purchased sdks. I can build the app fine, having set the location of all the dependent dylibs in the pro file. Unfortunately I cannot execute the app, because the linker doesn't know where my dependencies are located... i guess it