English 中文(简体)
ming牛——隐蔽似乎不可行
原标题:mingw -fvisibility=hidden does not seem to work

我有一个共用图书馆,该图书馆仅出口一个功能,其标记是__attribute__ ((可见(视))。 它还与另一个固定图书馆(前两个)链接,

#include<fftw3.h>

在此之前:

#pragma GCC visibility push(hidden)

使用的联系人指挥:

g++.exe -fvisibility=hidden -shared -o mylib.dll -Wl,--out-implib,mylib.dll.a -Wl,--no-whole-archive libfftw3.a libfftw3_omp.a -lgomp 

现在,由此产生的图书馆是巨大的,如果我检查出口职能,它就包括过去的职能和我档案中的所有职能。 它视而不见可见的选择。 我读到,它曾就<代码>-fvisibility提出警告,但现在它没有任何警告汇编。

ming和cc4.6.1是否支持可见旗? 如果是的话,我如何在我的共用图书馆里消除所有不必要的 st?

最佳回答

Windows PE物体文档不具备可见性。 最近的是出口/进口商,但只有共享图书馆。 因此,你要么没有用<条码>表示FFTW的所有功能。 The Right Thing (tm), or You take care not tolink to FFTW iflinking with You Library.

它应当警示不知名的属性,或许需要改写警告等级:-Wall -Wextra -pedantic

问题回答

Mingw是海合会工具链的Windows港,但Windows dll不是so。 特别是 链接部分是不同的。 • 明确“千兆瓦”的可见度,你必须走“视窗”,并用:

  • __declspec(dllexport) while compiling the library
  • __declspec(dllimport) while linking

如果你想多管齐下的海合会工具链,你就可以在你的项目中为你增添一个标题。 举例来说,详细情况,看着海湾合作委员会的可见性指南





相关问题
PCSC-Lite Codes on Windows

I ve successfully built a program that can read Mifare 1K Card using Qt on Linux. So now, I would like it to run on Windows. From what I ve gathered, there s no PCSC-Lite port on Windows and I need to ...

mingw + python eagerly translating path

I am using: Windows XP Python 2.6.2 (standard install from python.org) git version 1.6.5.1-preview20091022 (installed from http://code.google.com/p/msysgit/) I have an environment variable looking ...

Conversion specifier of long double in C

The long double data type can have these conversion specifiers in C: %Le,%LE,%Lf,%Lg,%LG (reference). I wrote a small program to test : #include <stdio.h> int main(void) { long double d = ...

Linux Development C/C++/bash/python on windows-7

Before resorting to stackoverflow, i have spend a lot of times looking for the solutions. I have been a linux-user/developer for few years, now shifting to windows-7. I am looking for seting-up a ...

Gvim, MinGW and Powershell making them work the CLI way

Just shifted to windows7. Liking it :). Is there a way to install MinGW in windows, such that, i can cd to my code directory (which is different from MinGW install directory) and compile my code there....

Which version of gcc to install with MinGW?

If compiling and linking with MinGW gcc v3 is painfully slow, and gcc v4 is not the default install option: What, for a beginner are the advantages/disadvantages of installing one version or another? ...

热门标签