Very simple application fails with “multiple target patterns” from Eclipse

前端 未结 9 857
-上瘾入骨i
-上瘾入骨i 2020-12-01 21:33

Since I\'m more comfortable using Eclipse, I thought I\'d try converting my project from Visual Studio. Yesterday I tried a very simple little test. No matter what I try,

相关标签:
9条回答
  • 2020-12-01 22:09

    I'm working in the Cygwin environment, on Windows 7 (64bit), using Eclipse Kepler CDT for C++.

    In Eclipse, goto

    Project --> Properties --> C++ Builder --> Settings --> Tool Settings Tab

    Cygwin C++ Compiler --> Includes

    In the Include paths (-I) add 2 paths: "C:\cygwin64\usr\include\libxml2"

    and "/cygdrive/c\cygwin64\usr\include\libxml2"

    0 讨论(0)
  • 2020-12-01 22:13

    I also had the problem of multiple target patterns reported by make when using eclipse on windows/cygwin. I solved the problem as suggested above by using only relative paths. I didn't realize that I had absolute paths, but when I specified an include directory using the project directory, eclipse expanded it into the full path.

    For instance, if you add a path relative to the workspace, eclipse generates ""${workspace_loc:/include}"" which will expand to something starting with "c:\". This is why it was happening in my case.

    I simply replaced the complex string above with "../../include" and it solved my problem.

    0 讨论(0)
  • 2020-12-01 22:17

    You can also delete *.d files under output folders and then build

    Debug/src/
    
    0 讨论(0)
  • 2020-12-01 22:19

    The error "multiple target patterns. Stop." will occur because src/Window.d have the paths generated by compiler in windows platform as:

    C:/Program\ Files/OpenCV/cv/include/cv.h \ C:/Program\ Files/OpenCV/cxcore/include/cxcore.h \ C:/Program\ Files/OpenCV/cxcore/include/cxtypes.h \ C:/Program\ Files/OpenCV/cxcore/include/cxerror.h \

    If you import this project into Eclipse in Linux platform, I would recommend you to give a clean build so that next build generates the path in Linux format as:

    /home/user/OpenCV/cv/include/cv.h \ /home/user/OpenCV/cxcore/include/cxcore.h \ /home/user/OpenCV/cxcore/include/cxtypes.h \ /home/user/OpenCV/cxcore/include/cxerror.h \

    The same is applicable, if you are using cygwin. The path format in cygwin is linux like format /cygdrive/c/ instead of C:/

    0 讨论(0)
  • 2020-12-01 22:21

    Looks like there is a simple way to solve this. Just change the "Current Builder" from "GNU Make Builder" to "CDT Internal Builder" in Project properties->C/C++ Builder->Tool Chain Editor->Current Builder will do.

    To me, this problem is caused by the automatically generated "XXX.d" dependency files in Debug directory (or release :), which were generated by gcc -MF as a side-effect to gcc -c. But GNU make obviously forgot to add quotations around file names when -MF.

    "CDT Internal Builder" does not use makefile nor GNU make at all. Eclipse manage the build process itself.

    If you insist to use GNU make, this doesn't work

    0 讨论(0)
  • 2020-12-01 22:22

    On Cygwin, GNU make version 3.81-1 delivered by the default setup program doesn't work with the automatic header file dependencies, generated by the compilers. The error message you will see because of this bug will look something like this:

    Here are two suggested fixes: - Try to obtain the previous version (3.80) - Obtain a fixed 3.81 version, for example from http://www.cmake.org/files/cygwin/make.exe

    src: https://projects.coin-or.org/BuildTools/wiki/current-issues

    Simply replace the make file in your "C:\cygwin\bin\" folder (or wherever cygwin is installed) with the "fixed" make file mentioned above.

    0 讨论(0)
提交回复
热议问题