使用VS2010构建的可执行文件不是有效的win32应用程序; bindump说这是一个DLL

问题描述:

我一直在做一个涉及FFT的C++程序,并且在我决定使用FFTW之前它工作得很好。从.def文件创建库并将它们链接到我的项目后,它会成功生成。但是,当我尝试运行该应用程序时,它告诉我它不是有效的win32应用程序。对所产生的文件运行产量DUMPBIN:使用VS2010构建的可执行文件不是有效的win32应用程序; bindump说这是一个DLL

(见编辑)

任何想法是什么问题呢?我希望它回到构建可执行文件。

编辑:全DUMPBIN:

PE signature found 

File Type: DLL 

FILE HEADER VALUES 
      14C machine (x86) 
       7 number of sections 
     512E72CE time date stamp Wed Feb 27 14:55:42 2013 
       0 file pointer to symbol table 
       0 number of symbols 
       E0 size of optional header 
      2102 characteristics 
        Executable 
        32 bit word machine 
        DLL 

OPTIONAL HEADER VALUES 
      10B magiC# (PE32) 
      10.00 linker version 
      1C000 size of code 
      3A000 size of initialized data 
       0 size of uninitialized data 
      1229D entry point (1001229D) @ILT+4760([email protected]) 
      1000 base of code 
      1000 base of data 
     10000000 image base (10000000 to 10069FFF) 
      1000 section alignment 
      200 file alignment 
      5.01 operating system version 
      0.00 image version 
      5.01 subsystem version 
       0 Win32 version 
      6A000 size of image 
      400 size of headers 
      59987 checksum 
       3 subsystem (Windows CUI) 
      140 DLL characteristics 
        Dynamic base 
        NX compatible 
      100000 size of stack reserve 
      1000 size of stack commit 
      100000 size of heap reserve 
      1000 size of heap commit 
       0 loader flags 
       10 number of directories 
      30370 [ 19818] RVA [size] of Export Directory 
      4B000 [  A0] RVA [size] of Import Directory 
      66000 [  1B4] RVA [size] of Resource Directory 
       0 [  0] RVA [size] of Exception Directory 
       0 [  0] RVA [size] of Certificates Directory 
      67000 [ 1EC0] RVA [size] of Base Relocation Directory 
      2D620 [  1C] RVA [size] of Debug Directory 
       0 [  0] RVA [size] of Architecture Directory 
       0 [  0] RVA [size] of Global Pointer Directory 
       0 [  0] RVA [size] of Thread Storage Directory 
       0 [  0] RVA [size] of Load Configuration Directory 
       0 [  0] RVA [size] of Bound Import Directory 
      4E68C [ 35EC] RVA [size] of Import Address Table Directory 
       0 [  0] RVA [size] of Delay Import Directory 
       0 [  0] RVA [size] of COM Descriptor Directory 
       0 [  0] RVA [size] of Reserved Directory 


SECTION HEADER #1 
.textbss name 
    10000 virtual size 
    1000 virtual address (10001000 to 10010FFF) 
     0 size of raw data 
     0 file pointer to raw data 
     0 file pointer to relocation table 
     0 file pointer to line numbers 
     0 number of relocations 
     0 number of line numbers 
E00000A0 flags 
     Code 
     Uninitialized Data 
     Execute Read Write 

SECTION HEADER #2 
    .text name 
    1BE65 virtual size 
    11000 virtual address (10011000 to 1002CE64) 
    1C000 size of raw data 
    400 file pointer to raw data (00000400 to 0001C3FF) 
     0 file pointer to relocation table 
     0 file pointer to line numbers 
     0 number of relocations 
     0 number of line numbers 
60000020 flags 
     Code 
     Execute Read 

SECTION HEADER #3 
    .rdata name 
    1CB88 virtual size 
    2D000 virtual address (1002D000 to 10049B87) 
    1CC00 size of raw data 
    1C400 file pointer to raw data (0001C400 to 00038FFF) 
     0 file pointer to relocation table 
     0 file pointer to line numbers 
     0 number of relocations 
     0 number of line numbers 
40000040 flags 
     Initialized Data 
     Read Only 

    Debug Directories 

     Time Type  Size  RVA Pointer 
    -------- ------ -------- -------- -------- 
    512E72CE cv   7F 0002EA90 1DE90 Format: RSDS, {CC4D0BC3-853A-4 
E8D-97A2-304A29035F04}, 4, C:\...... 

SECTION HEADER #4 
    .data name 
    7AC virtual size 
    4A000 virtual address (1004A000 to 1004A7AB) 
    400 size of raw data 
    39000 file pointer to raw data (00039000 to 000393FF) 
     0 file pointer to relocation table 
     0 file pointer to line numbers 
     0 number of relocations 
     0 number of line numbers 
C0000040 flags 
     Initialized Data 
     Read Write 

SECTION HEADER #5 
    .idata name 
    1A611 virtual size 
    4B000 virtual address (1004B000 to 10065610) 
    1A800 size of raw data 
    39400 file pointer to raw data (00039400 to 00053BFF) 
     0 file pointer to relocation table 
     0 file pointer to line numbers 
     0 number of relocations 
     0 number of line numbers 
C0000040 flags 
     Initialized Data 
     Read Write 

SECTION HEADER #6 
    .rsrc name 
    1B4 virtual size 
    66000 virtual address (10066000 to 100661B3) 
    200 size of raw data 
    53C00 file pointer to raw data (00053C00 to 00053DFF) 
     0 file pointer to relocation table 
     0 file pointer to line numbers 
     0 number of relocations 
     0 number of line numbers 
40000040 flags 
     Initialized Data 
     Read Only 

SECTION HEADER #7 
    .reloc name 
    2593 virtual size 
    67000 virtual address (10067000 to 10069592) 
    2600 size of raw data 
    53E00 file pointer to raw data (00053E00 to 000563FF) 
     0 file pointer to relocation table 
     0 file pointer to line numbers 
     0 number of relocations 
     0 number of line numbers 
42000040 flags 
     Initialized Data 
     Discardable 
     Read Only 

    Summary 

     1000 .data 
     1B000 .idata 
     1D000 .rdata 
     3000 .reloc 
     1000 .rsrc 
     1C000 .text 
     10000 .textbss 
+0

相应的命令是dumpbin.exe/headers。我们看不到它看起来像什么,但总是有很好的机会尝试在64位进程中使用32位DLL。或者相反。 – 2013-02-27 20:52:43

+0

非常感谢,我编辑它来保存整个dumpbin。我实际上已经尝试制作x64的.lib,但它给编译带来了错误。另一方面,dll是x64 ...所以这可能是问题,我会尝试x86的 – user2117056 2013-02-27 21:03:23

+1

如果其他人有类似的问题:我连接.exp文件以及.lib文件;只有链接.lib文件并将.dll文件放入目录才能解决问题。 – user2117056 2013-02-27 21:17:07

想通了,如果其他人有类似的问题:

我链接.exp文件以及该.lib文件;只连接.lib文件并将.dll文件放入解决问题的目录中。