Ariosto Ferro
|
Cannot link to source files in project sub-folders?
|
Ariosto Ferro
05/13/2014 1:27 PM
post110305
|
Cannot link to source files in project sub-folders?
Hello,
I am just getting started with the QNX momentics IDE. I started creating a simple project but I am running into the
problem where the QNX Momentics IDE cannot seem to link against source files in sub folders of my project.
I have created a very small simple project, it is a QNX C/C++ project. It has the following structure: In the root
folder: MyTest.cc, and a source folder called asdf. In the /asdf/ folder: asdf.h and asdf.cpp exist.
MyTest.cc is as follows:
#include <cstdlib>
#include <iostream>
#include "asdf/asdf.h"
int main()
{
doStuff();
}
asdf.cpp is as follows:
/*
* asdf.cpp
*/
#include "asdf.h"
#include <stdio.h>
void doStuff()
{
printf ("hello, world.\n");
}
and asdf.h:
/*
* asdf.h
*/
#ifndef ASDF_H_
#define ASDF_H_
void doStuff();
#endif /* ASDF_H_ */
As you can see, this is a very simple example. The project compiles against the header correctly then gives me the
linker error: "undefined reference to doStuff"... I am new to QNX and a rather novice programmer, but this still strikes
me as something the IDE should be able to manage? What am I missing?
I can simply compile this example from command line with
g++ MyTest.cpp asdf/asdf.cpp -o MyTest
and it works just fine, so I am very confused why I cannot get the IDE to do the same.. Any advice?
|
|
|