English 中文(简体)
g 用户在两个服务器上的不同链接
原标题:gcc compiler linking differently on two servers

我拥有一个大型的由源控制的C++代码基,该数据库汇编并链接到一个含水层服务器上,没有错误。

我现在试图在新的服务器上设置同样的应用程序,因此在新的箱子上检查了同样的代码。

然而,当我在这个新箱子上对相同的法典进行同样的指挥时,我会发现错误。 原因似乎是因为在旧的箱子上建立了共享图书馆(索)档案。 在新的箱子上——该箱使用相同的代码,因此制作文件——固定图书馆(a)。

使用的汇编器似乎也一样—— gcc-3.4.6。

显然,我有点意见不一,但谁可以建议,或者说这种意见会在哪里? 我可以想到会产生这种效果的任何小变化。

问题回答

Note that the linker ld is part of binutils, which is delivered with the standard binaries as part of the Unix distribution you have, and is not part of the gcc suite.

因此,当你从旧服务器到新的服务器时,机率是你从旧的<代码>ld转至新的<代码>ld。

Since a library is first created by the linker, it would be interested to check it out.

请注意,如果您怀疑汇编者(因为其履行对<条码>><>d>>的号召,你可撰写<条码>。 仅与所收到的论点相呼应的可执行文字,然后在幕后打上真正的<>ld(打上$PATH/code>。

很自然的是,它要么是一个不同论点的案例(hy?),要么是一个不同的双目光,表明什么,你是更接近解决你问题的一步。

st可能产生略微不同的<代码>Makefile-s。

当你与<代码>-lfoo挂钩时,联系人首先尝试动态libfoo.。 然后,libfoo.a

<GCC现为4.6.2,因此,3.4.6>/em> 版本已久。 考虑予以升级,因为海湾合作委员会自此取得了许多进展。

Try using gcc -v (perhaps as make CC= gcc-v ), to inform what is progress on when building.

如果你想要得到真正的帮助,则提供更多细节。 涉及哪些实际图书馆?





相关问题
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?