# include "file.h"
# include <iostream>
usingnamespace std;
int main()
{
func();
cin.get();
return 0;
}
file.h
1 2 3 4 5
# pragma once
# include <iostream>
void func(void);
file.cpp
1 2 3 4 5 6
# include "file.h"
void func(void)
{
std::cout << "A string" << std::endl;
}
I am trying to build an executable from them. This command(g++ main.cpp -o app.exe) I use gives me the following error:
undefined reference to 'func()'