- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi all,
Currently I am working on Managed library. I have made a manage library in C++. This library includes some global functions, global variables and different classes. Now I have made one another C/C++ application. And in it use .cpp file extension. And I want to use the managed library functions and classes in the C/C++ application. But it gives me error of undeclared (first use this function)'. So if anybody knows please reply on it.Link Copied
5 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
--- Quote Start --- originally posted by slsnios@Jun 29 2006, 10:39 AM but it gives me error of undeclared (first use this function)'.
so if anybody knows please reply on it.
<div align='right'><{post_snapback}> (index.php?act=findpost&pid=16513)
--- quote end ---
--- Quote End --- probably you didn't include the .h/.hpp file of your class? Paolo
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
--- Quote Start --- originally posted by paolo.gai+jun 29 2006, 03:18 pm--><div class='quotetop'>quote (paolo.gai @ jun 29 2006, 03:18 pm)</div>
--- quote start ---
<!--quotebegin-slsnios@Jun 29 2006, 10:39 AM but it gives me error of undeclared (first use this function)'.
so if anybody knows please reply on it.
<div align='right'><{post_snapback}> (index.php?act=findpost&pid=16513)
--- quote end ---
--- Quote End --- probably you didn't include the .h/.hpp file of your class? Paolo <div align='right'><{post_snapback}> (index.php?act=findpost&pid=16519)</div> [/b] --- Quote End --- This is my class in Managed Library. # include "iostream.h" class Form { public: Form(); }; Form::Form() { printf("Hello NIOS"); } I want to use this managed library in my C/C++ application. # include<iostream.h> int main() { Form *frm = new Form(); return 0; } This is the code of application file even though it gives me error.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
A shot in the dark here....
If the "main" function is in a "C" file then you'll need to do a "C"-style function in the CPP file in order to to link it e.g. in CPP extern "C" void CreateForm (void) { Form *frm = new Form(); } then in main.c extern void CreateForm (void); int main () { CreateForm () }- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
<div class='quotetop'>QUOTE </div>
--- Quote Start --- This is my class in Managed Library. # include "iostream.h" class Form { public: Form(); }; Form::Form() { printf("Hello NIOS"); } I want to use this managed library in my C/C++ application. # include<iostream.h> int main() { Form *frm = new Form(); return 0; } This is the code of application file even though it gives me error.[/b] --- Quote End --- It seems that you forget to include the header file of Form class. You can find the detail information about managed library project in NiosII IDE. Following the steps below: 1. Open NiosII IDE 2. Click Help->Help Content 3. search keyword : "managed library" then you'll get what you want... Hope it will help.- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Dear all,
Is it possible to bring only C++ application project and the library file *.a which is created by managed library project to customer without source code of managed library project? Is there any document to clarify this issue? Sorry for my disturbance, David
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