- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I am using Nios II SBT Eclipse. I have couple of .c and .h files that i would like to use in a project. But when I trying to call the function in main program, it keep give me error of "undefined reference to: "function name"". I had include the header using# include. All the .c and .h file are placed in a folder in the same directory. Can someone help me with how to set up this folder as include library?
Link Copied
1 Reply
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
Can someone help? I still cant solve the problem. Let say I had a header and a source file, ======= myfunc.h ============ #ifndef _MYFUNC_H___ # define _MYFUNC_H___ # include <stdio.h> void funcCall(); # endif ====== myfunc.c ============= #include <stdio.h> # include "myfunc.h" void funcCall(){ printf("Called funcCall"); } They both are in a folder called "lib" Let say I created a new SBT project and add the source below: # include <stdio.h> # include "myfunc.h" int main(){ printf("Hello,Its working!"); funcCall(); return 0; } The build result always says that undefined reference to funcCall()... What I have to do to successfully build this simple system?
Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page