Skip to main content

Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » C / C++ IDE (CDT) » No rule to make target "Player.o" needed by project
No rule to make target "Player.o" needed by project [message #1782821] Fri, 02 March 2018 06:06 Go to next message
Bob Google is currently offline Bob GoogleFriend
Messages: 2
Registered: March 2018
Junior Member
I'm trying to generate random numbers between 1 and 8 and then process them statistically.

My monitor is currently on my desk. My window is currently unbroken. Those are about to change.

So I thought I would ask for help. I have gotten Eclipse to compile and run Hello World. I am importing a project that used to work in MS Visual Studio 2010. I am getting this error:

make: *** No rule to make target 'Player.o', needed by 'VanillaWoW'. Stop.

I have looked at SO and Google for 2 hours and cannot figure this out. Everything seems to be the same as the HelloWorld program that works. The makefile is not in the same directory as the source, however, as some SO topics recommended, but I don't think that's the issue because the working program has them in the same locations. It looks like this:

Erg I can't use links yet.
ibb co slash cBcAqx

I don't understand how it's doing this because when I do a clean build it's clearly doing something because it spits out all the compiler warnings that Boost 1.66 has deprecated uses of class auto_ptr. Also, I need to learn how to squelch those if possible without squelching everything. One SO topic said something about using -isystem but I don't know how to change the automatic build options from -I.

In C/C++ General -> Paths and Symbols -> Source Location I have /VanillaWoW and /VanillaWoW/Source3 listed. I'm using the Cygwin GCC GNU Make Builder

If I use the CDT Internal Builder it says:

g++ -o VanillaWoW "Source3\\Player.o" "Source3\\Tier.o" "Source3\\stdafx.o"
/usr/lib/gcc/x86_64-pc-cygwin/6.4.0/../../../../lib/libcygwin.a(libcmain.o): In function `main':
/usr/src/debug/cygwin-2.10.0-1/winsup/cygwin/lib/libcmain.c:37: undefined reference to `WinMain'
/usr/src/debug/cygwin-2.10.0-1/winsup/cygwin/lib/libcmain.c:37:(.text.startup+0x94): relocation truncated to fit: R_X86_64_PC32 against undefined symbol `WinMain'
collect2: error: ld returned 1 exit status
There is a .cpp file for every .h file. There are only 3.

When I build it makes a .d and .o file in the debug folder for every .cpp and .h file I have.

I have Cygwin and MingW and a couple libraries or whatever installed. I don't believe I have MSYS installed.

Oh the makefile is automatically generated and it and all the code are at: https:// docs.

I also posted this on SO but it was closed as duplicate and a link to a technobabble mega thread was provided, as if I could figure out which of the 27 possible fixes apply to my situation.

So what will fix this and what builder should I be using?
Re: No rule to make target "Player.o" needed by project [message #1782973 is a reply to message #1782821] Mon, 05 March 2018 22:43 Go to previous messageGo to next message
David VavraFriend
Messages: 777
Registered: October 2012
Senior Member
Cygwin and MinGW are mutually incompatible but you are using cygwin.
It's been some time since I've worked with cygwin but here are some things to consider.

You should note that the default HelloWorld project has three directories:
./src which contains the source and headers
./Debug the debug configuration directory
./Release the release configuration dirctory

The configuration directories have the makefile for the configuration.
The directories may not exist until the first build.
There is no makefile with the Internal Builder which simulates one.

CDT normally executes make with the current directory being the selected build configuration directory.
The current build directory is displayed by the makefile.
It also states "Info: Internal Builder is used for build" when appropriate.
Did you omit these from your posted build log for some reason?

The location of the makefile and build directory is set with:
Project --> C/C++ Build --> Builder Settings tab --> Build directory

You are getting a link error: "undefined reference to winmain"
Googling "cygwin g++ undefined reference to winmain" returns a number of links.
So does "undefined reference to winmain eclipse"
You should look at all of them.

You are also getting "relocation truncated to fit: R_X86_64_PC32 against undefined symbol `WinMain'"
This is a relocation error meaning the resultant address is too large for the memory model.
This may be caused by linking the wrong object size (64-bit vs. 32-bit)
Or may be because an undefined reference defaults to -1 -- a very large abs value.

Rather than our trying to figure out what you did, use the HelloWorld project as a template.

Try creating an HelloWorld project (with a different name) and copy your source into the src directory
delete the HelloWorld.cpp (which actually is <project name>.cpp)
Select a build configuration
Then build it.

Let us know what problems you then encounter.

Re: No rule to make target "Player.o" needed by project [message #1783109 is a reply to message #1782973] Thu, 08 March 2018 03:29 Go to previous message
Bob Google is currently offline Bob GoogleFriend
Messages: 2
Registered: March 2018
Junior Member
TY so much, your last paragraph worked first try.

I'd probably spent 6 hours trying to debug this and was so damn mad that night.
Previous Topic:CDT Language Server
Next Topic:CDT Language Server
Goto Forum:

Current Time: Sun Sep 23 02:21:46 GMT 2018

Powered by FUDForum. Page generated in 0.03782 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top