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

使用VS2010生成的可执行文件不是有效的win32应用程序;bindump说它';这是一个动态链接库 我一直在做一个涉及FFT的C++程序,直到我决定使用FFTW为止,它一直运行得很好。从.def文件创建库并将它们链接到我的项目后,它成功构建。但是,当我尝试运行该应用程序时,它告诉我它不是有效的win32应用程序。在生成的文件上运行dumpbin会产生:,c++,visual-studio-2010,dll,exe,fftw,C++,Visual Studio 2010,Dll,Exe,Fftw,(见编辑) 你知道问题出在哪里吗?我希望它作为一个可执行文件返回到构建 编辑:完整垃圾箱: 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 po

(见编辑)

你知道问题出在哪里吗?我希望它作为一个可执行文件返回到构建

编辑:完整垃圾箱:

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(__DllMainCRTStartup@12)
            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

如果其他人也有类似的问题,我会解决的:

我正在链接
.exp
文件以及
.lib
文件;只有链接
.lib
文件并将
.dll
文件放在目录中才能修复此问题


适当的命令是dumpbin.exe/headers。我们看不到它是什么样子,但您尝试在64位进程中使用32位DLL的可能性总是很大。或者反过来。非常感谢,我编辑了它来保存整个垃圾箱。实际上,我尝试为x64创建.lib,但它给出了编译错误。另一方面,DLL是x64…所以这可能是问题所在,如果其他人有类似问题,我将尝试x86配置:我链接了.exp文件和.lib文件;仅链接.lib文件并将.dll文件放在目录中修复了此问题。@user2117056:请将您的答案作为答案发布,并在2天内接受。