View topic - QNX Momentics Issue
QNX Momentics Issue
2 posts
• Page 1 of 1
QNX Momentics Issue
Hi,
I make a new QNX C++ project with source files in a subfolder, and I cannot compile the program; the linker cannot find references to functions..
I have a main.cc:
and a folder, asdf that contains:
asdf.h:
asdf.cpp
/*
* asdf.cpp
*/
#include <asdf.h>
#include <stdio.h>
void doStuff()
{
printf ("hello, world.\n");
}
When I try to compile, I receive the error: undefined reference to 'doStuff", indicating that the linker cannot find the compiled .o file for asdf.cpp? But I cannot figure out the makefile structure to get the project to build correctly.
I have tried adding two different makefiles (and no makefile) to the 'asdf' folder, as per http://www.qnx.com/developers/docs/6.3. ... nvent.html.
the first attempt contains:
the second attempt contains:
Neither makefile in folder asdf works. Nor does having no makefile in asdf.
Do you have guidance? This seems like it should be a very basic thing to do, but I cannot figure it out!
I make a new QNX C++ project with source files in a subfolder, and I cannot compile the program; the linker cannot find references to functions..
I have a main.cc:
- Code: Select all
#include <cstdlib>
#include <iostream>
#include <asdf/asdf.h>
int main()
{
doStuff();
}
and a folder, asdf that contains:
asdf.h:
- Code: Select all
/*
* asdf.h
*/
#ifndef ASDF_H_
#define ASDF_H_
void doStuff();
#endif /* ASDF_H_ */
asdf.cpp
/*
* asdf.cpp
*/
#include <asdf.h>
#include <stdio.h>
void doStuff()
{
printf ("hello, world.\n");
}
When I try to compile, I receive the error: undefined reference to 'doStuff", indicating that the linker cannot find the compiled .o file for asdf.cpp? But I cannot figure out the makefile structure to get the project to build correctly.
I have tried adding two different makefiles (and no makefile) to the 'asdf' folder, as per http://www.qnx.com/developers/docs/6.3. ... nvent.html.
the first attempt contains:
- Code: Select all
include ../common.mk
the second attempt contains:
- Code: Select all
include recurse.mk
Neither makefile in folder asdf works. Nor does having no makefile in asdf.
Do you have guidance? This seems like it should be a very basic thing to do, but I cannot figure it out!
- repharaoh
- New Member
- Posts: 1
- Joined: Mon May 12, 2014 6:39 pm
Re: QNX Momentics Issue
Repharaoh,
Usually local header files are denoted with "'s rather than <>. The angled brackets are meant for system include files.
IE: #include "asdf/asdf.h"
That said, what kind of project did you create in Momentics? Did you create one that requires you to create your own custom Makefiles?
Unless you need to do so, it's often far simpler to let Momentics manage the entire project in the same manner that Visual Studio does so that you don't have to fiddle with Makefiles.
Tim
Usually local header files are denoted with "'s rather than <>. The angled brackets are meant for system include files.
IE: #include "asdf/asdf.h"
That said, what kind of project did you create in Momentics? Did you create one that requires you to create your own custom Makefiles?
Unless you need to do so, it's often far simpler to let Momentics manage the entire project in the same manner that Visual Studio does so that you don't have to fiddle with Makefiles.
Tim
- Tim
- Senior Member
- Posts: 1519
- Joined: Wed Mar 10, 2004 12:28 am
2 posts
• Page 1 of 1
Who is online
Users browsing this forum: No registered users and 1 guest