I am trying to compile a program with several source files - two CPP files and a header file with code :: blocks. As an example, I created the following three files (example program created by someone else on another forum):
main.cpp:
#include <stdio.h>
#include "other.h"
int main (void)
{
printf("%d\n", getfavoritenumber());
return 0;
}
other.cpp
#include "other.h"
int getfavoritenumber(void)
{
return 3;
}
other.h
#ifndef _OTHER_H_
#define _OTHER_H_
int getfavoritenumber(void);
#endif
Despite the fact that these three files must refer to each other, I get an error: “Skip step link (assembly target is not tied to object files)” when I try to create a project.
What am I doing wrong? When trying to compile individual files, the error "This file is not assigned to any purpose" appears.
Matt source
share