English 中文(简体)
C++ 盖特:法定建筑和外部校正
原标题:C++ Qt: Static builds and external dylibs

I ve been doing some funny stuff in personal projects with Qt. I m not an expert in this so if it s a dumb question (guess not I couldn t find anything useful) feel free to kill me.

不管怎么说,在OSX的Im,通常我用该指挥部的手稿汇编最后版本的Qt静态版本:

cd "project folder...";
PATH=/Users/TCB13/(...)/qt-source/bin:$PATH;  --> Path to my static QT.
export PATH;
qmake -config release; 
make; 
make clean;

So far if I move the compiled binary to another computer without Qt installed everything works just fine! ;)

Yesterday I start to play around with a dynamic library provided by a company and I ve included the dylib in my .pro file like this: (I ve a copy of the dylib in the project folder)

#macx: LIBS += -L$$PWD/ -lwpsapi

#INCLUDEPATH += $$PWD/
#DEPENDPATH += $$PWD/

当我编集“法定”(使用上述指挥)并在其他计算机操作时,我会:

dyld: Library not loaded: @executable_path/libwpsapi.dylib
 Referenced from: /Users/TCB13/Desktop/dude111
 Reason: image not found
Trace/BPT trap: 5

I noticed that the size of my compiled binary is the same with or without including the dylib so, I googled how to include and external lib and some people are saying that I need to add "CONFIG += static" to my .pro file. I did it and the size of the file increased but I still got the same error.

希望能帮助我。

最佳回答

错误信息非常清楚,你需要分发与你的申请相一致的校准。 如果你想避免这种情况,就查阅这一第三方图书馆的文件,使之使用固定联系的代码。 请注意,你告诉联系人把静态图书馆连接起来,并不意味着参考该守则。 我怀疑,在法典中(或缺席)有某种程序前标准使用有活力的装设图书馆。

问题回答

暂无回答




相关问题
Undefined reference

I m getting this linker error. I know a way around it, but it s bugging me because another part of the project s linking fine and it s designed almost identically. First, I have namespace LCD. Then I ...

C++ Equivalent of Tidy

Is there an equivalent to tidy for HTML code for C++? I have searched on the internet, but I find nothing but C++ wrappers for tidy, etc... I think the keyword tidy is what has me hung up. I am ...

Template Classes in C++ ... a required skill set?

I m new to C++ and am wondering how much time I should invest in learning how to implement template classes. Are they widely used in industry, or is this something I should move through quickly?

Print possible strings created from a Number

Given a 10 digit Telephone Number, we have to print all possible strings created from that. The mapping of the numbers is the one as exactly on a phone s keypad. i.e. for 1,0-> No Letter for 2->...

typedef ing STL wstring

Why is it when i do the following i get errors when relating to with wchar_t? namespace Foo { typedef std::wstring String; } Now i declare all my strings as Foo::String through out the program, ...

C# Marshal / Pinvoke CBitmap?

I cannot figure out how to marshal a C++ CBitmap to a C# Bitmap or Image class. My import looks like this: [DllImport(@"test.dll", CharSet = CharSet.Unicode)] public static extern IntPtr ...

Window iconification status via Xlib

Is it possible to check with the means of pure X11/Xlib only whether the given window is iconified/minimized, and, if it is, how?

热门标签