Creating a simple 'hello world' and linking it together with 2 pre-compiled objects



In my created project I got "IGEL1.OBJ" and "IGEL2.OBJ" as well as "IGEL.H".

In Orwell Dev-C++ I take the following steps:

1. 'File'->'New'->'Project...'
2. Register 'Basic'->'Console Application'->'C Project'
3. 'Name:'->IgelTest->'OK'.

Then under the 'Project' register

1. right-click on 'IgelTest'
2. 'Add to project'

Adding consequently

* IGEL1.OBJ
* IGEL2.OBJ
* IGEL.H

Once I've done this I go to

1. 'Project'
2. 'Project Options'
3. Register 'Files'
4. left-click on 'IGEL1.OBJ'
5. check 'Include in linking' under 'Files'
6. repeat the same for 'IGEL2.OBJ'
7. left-click 'OK'

Now I've got 'main.c' in my view, click on the 'Compile & Run' button, and receive the following error message: mingw32-make.exe: * No rule to make target 'IGEL1.o', needed by 'IgelTest.exe'. Stop.

I've uploaded the project folder here: https://mega.co.nz/#F!ggpWEJIK!bHu30zK8y4UXU-LoAdcddQ

Here's a pastebin of 'Makefile.win': http://pastebin.com/Pr9iS3Wc

Please help!
The problem were the endings of 'IGEL1.OBJ' and 'IGEL2.OBJ': It should've been '.O' instead of '.OBJ'.
You can also make the .obj files into library files! Just use the command line ar utility, then it's easy to link up with your code (just like a regular library)

I think the syntax is ar rvs libraryname.a filename.obj

edit: lol, looking closer at your question, this is probably not what you're looking for, but it's good information nonetheless!
Last edited on
Topic archived. No new replies allowed.