Home » Community » Newbie corner » [SOLVED] I have a problem linking a LIB
Re: I have a problem linking a LIB [message #28466 is a reply to message #28462] |
Thu, 02 September 2010 17:30   |
jerson
Messages: 202 Registered: June 2010 Location: Bombay, India
|
Experienced Member |

|
|
Update on my situation
In the case which compiles and links, I have the API header declared in my main.cpp and the functions which link to the LIB also in the main.cpp in global scope.
Like this
= snippet from Main.cpp
#include "NIDAQmx.h"
/**********************************************************************/
#define DAQmxErrChk(functionCall) if( DAQmxFailed(error=(functionCall)) ) goto Error; else
void NiCheck()
{
int32 error=0;
TaskHandle taskHandle=0;
uInt32 data;
char errBuff[2048]={'\0'};
int32 read;
/*********************************************/
// DAQmx Configure Code
/*********************************************/
DAQmxErrChk (DAQmxCreateTask("",&taskHandle));
DAQmxErrChk (DAQmxCreateDIChan(taskHandle,"Dev1/port0","",DAQmx_Val_ChanForAllLines));
......
In the same project which compiles and links, if I move the functions which link to the LIB into a separate module/cpp file, put the header for the API in that cpp file again in global scope, I end up with tons of errors.
= snippet from NiDaq.cpp
#include "NIDAQmx.h"
/**********************************************************************/
#define DAQmxErrChk(functionCall) if( DAQmxFailed(error=(functionCall)) ) goto Error; else
void NiCheck()
{
int32 error=0;
TaskHandle taskHandle=0;
uInt32 data;
char errBuff[2048]={'\0'};
int32 read;
/*********************************************/
// DAQmx Configure Code
/*********************************************/
DAQmxErrChk (DAQmxCreateTask("",&taskHandle));
DAQmxErrChk (DAQmxCreateDIChan(taskHandle,"Dev1/port0","",DAQmx_Val_ChanForAllLines));
......
I am not calling the NiCheck function in either case. Just ensuring that it links for now. The Package organiser knows about the additional library which is located in the same folder as my sources.
I created another test case in which I tried the same steps as the above 2 cases, but it doesn't work in either case
What am I doing wrong ?
Thanks
ps. I have attached the relevant files for completeness
-
Attachment: nidaqmx.zip
(Size: 149.17KB, Downloaded 290 times)
[Updated on: Thu, 02 September 2010 17:46] Report message to a moderator
|
|
|
 |
|
[SOLVED] I have a problem linking a LIB
By: jerson on Thu, 02 September 2010 16:05
|
 |
|
Re: I have a problem linking a LIB
By: jerson on Thu, 02 September 2010 17:30
|
 |
|
Re: I have a problem linking a LIB
By: koldo on Thu, 02 September 2010 18:19
|
 |
|
Re: I have a problem linking a LIB
By: jerson on Thu, 02 September 2010 19:09
|
 |
|
Re: I have a problem linking a LIB
By: koldo on Thu, 02 September 2010 22:12
|
 |
|
Re: I have a problem linking a LIB
By: jerson on Fri, 03 September 2010 02:55
|
 |
|
Re: I have a problem linking a LIB
By: koldo on Fri, 03 September 2010 08:20
|
 |
|
Re: I have a problem linking a LIB
By: koldo on Fri, 03 September 2010 08:28
|
 |
|
Re: I have a problem linking a LIB
By: jerson on Fri, 03 September 2010 05:14
|
 |
|
Re: I have a problem linking a LIB
By: jerson on Fri, 03 September 2010 08:50
|
 |
|
Re: I have a problem linking a LIB
By: koldo on Fri, 03 September 2010 09:31
|
 |
|
Re: [SOLVED] I have a problem linking a LIB
By: jibe on Tue, 17 May 2011 15:39
|
 |
|
Re: [SOLVED] I have a problem linking a LIB
By: koldo on Tue, 17 May 2011 15:56
|
 |
|
Re: [SOLVED] I have a problem linking a LIB
By: jibe on Mon, 23 May 2011 09:40
|
 |
|
Re: [SOLVED] I have a problem linking a LIB
By: koldo on Mon, 23 May 2011 16:03
|
 |
|
Re: [SOLVED] I have a problem linking a LIB
By: mr_ped on Tue, 24 May 2011 09:33
|
 |
|
Re: [SOLVED] I have a problem linking a LIB
By: jibe on Thu, 26 May 2011 11:24
|
Goto Forum:
Current Time: Mon Apr 28 11:16:36 CEST 2025
Total time taken to generate the page: 0.00531 seconds
|