Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
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 Go to previous messageGo to previous message
jerson is currently offline  jerson
Messages: 202
Registered: June 2010
Location: Bombay, India
Experienced Member

Update on my situation Shocked

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 229 times)

[Updated on: Thu, 02 September 2010 17:46]

Report message to a moderator

 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: How to reference value of an item on a layout?
Next Topic: Control with fixed rate Height/Width
Goto Forum:
  


Current Time: Wed May 15 09:48:21 CEST 2024

Total time taken to generate the page: 0.02532 seconds