10-01-2008 04:05 AM
Hello!
I've been working with cins and achieved success, building VI's with CIN under linux.
But now I need to implement Jungo Windriver PCI driver program under Windows XP in Labview.
Last time I worked with only one source file and everything was ok.
But this project compiles with at least 5-6 .c source files and makes executable.
1) How can I build one single CIN from several source files?
2) What changes I should do in a makefile?
Thank you in advance.
10-01-2008 06:40 AM
10-01-2008 08:58 AM
Okey, I've just tested an example of using DLL via Call Library Function Node in the manual.
But Can I Export to one DLL not only one function like this:
_declspec(dllexport) long avg_num(float a[], long size, float *avg);
_declspec(dllexport) long avg_num(float a[], long size, float *avg)
{
.......
.......
}
Can I export to one DLL many functions that contain my .c project ?
And one more question: My project consists of 7 .c files + many headers. In one virtex5_diag.c there is defined main function.
As I understand this is the main project file and others define different functions.
Should I compile other files too?
10-01-2008 09:13 AM
Okey, now I've tested and successfully implemented 2 different functions in one DLL.
But what is unclear now: what to do if my project.c code uses functions which are defined in other .c and .h files ?
Regards
10-01-2008 10:10 AM
10-01-2008 06:23 PM
Thank you for a clear answer. However, I want to ask: Does it care for example if that driver project was created for .EXE program generation? (building a project there is a choice DLL or EXE) and program generates source files for the project. I mean can I build DLL from a " .c " program, or should change source code and learn building DLL's ?
As I understood I can simply compile other source files (containing function definitions) and link them to the main file during compilation as .obj files?
And what to do If compiler notifies me about plenty of undefined symbols? I mean how can I find which one library is needed?
Best Regards
10-02-2008 03:40 AM
10-02-2008 08:34 AM
I've read this manual: http://zone.ni.com/devzone/cda/tut/p/id/3056
There written:
"Every DLL file must have a DllMain function, which is the entry point for the library.
Unless you must do a specific initialization of the library, the default DllMain that MSVC created is sufficient.
Notice that this function does nothing."
And when I read Using External Code in Labview manual, there was nothing said about DllMain function, and I successfully compiled an example to DLL without any "DllMain" function and it worked fine with Labview.
Now it is a great mess in my head.
Should I modify those other .c files according this manual or only main.c file?
Thank you.
10-02-2008 09:40 AM