1

我在我的 Windows 7 计算机上安装了 Eclipse CDT(juno)我安装了 cygwin(能够手动创建一个 makefile 并创建一个 .so)

我想在eclipse中使用cygwin编译器来创建一个.so

我在 Eclipse 中创建了一个新的共享库项目,告诉它使用 cygwin c++ 编译器

执行 ctrl-b 并创建一个 .dll

我如何让它制作一个.so?

这是使用 Windows 7

11:13:05 **** Build of configuration Debug for project cygwinc++ ****
make all 
Building file: ../main.cpp
Invoking: Cygwin C++ Compiler
g++ -O0 -g3 -Wall -c -fmessage-length=0 -MMD -MP -MF"main.d" -MT"main.d" -o "main.o" "../main.cpp"
cygwin warning:
  MS-DOS style path detected: C:\Users\EAIGREG\workspace\cygwinc++\Debug
  Preferred POSIX equivalent is: /cygdrive/c/Users/EAIGREG/workspace/cygwinc++/Debug
  CYGWIN environment variable option "nodosfilewarning" turns off this warning.
  Consult the user's guide for more details about POSIX paths:
    http://cygwin.com/cygwin-ug-net/using.html#using-pathnames
Finished building: ../main.cpp

Building target: cygwinc++.dll
Invoking: Cygwin C++ Linker
g++ -shared -o "cygwinc++.dll"  ./main.o   
cygwin warning:
  MS-DOS style path detected: C:\Users\EAIGREG\workspace\cygwinc++\Debug
  Preferred POSIX equivalent is: /cygdrive/c/Users/EAIGREG/workspace/cygwinc++/Debug
  CYGWIN environment variable option "nodosfilewarning" turns off this warning.
  Consult the user's guide for more details about POSIX paths:
    http://cygwin.com/cygwin-ug-net/using.html#using-pathnames
Finished building target: cygwinc++.dll


11:13:06 Build Finished (took 390ms)

显然这是使用了错误的编译器...我知道我的 cygwin 可以创建 SO 那么我如何告诉它使用“linux”c++ 编译器?

4

1 回答 1

1

也许有一种方法可以完成我正在寻找的事情,但我最终做的是让另一台运行 linux 的计算机......

如果我愿意,我可以手动创建我的 makefile 并手动链接和编译(可能是一些花哨的批处理文件),但最终在 linux 中拥有一个完整的工作 eclipse 环境会更容易

于 2013-01-18T18:08:39.673 回答