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 » where can I find more info?
where can I find more info? [message #28584] Wed, 08 September 2010 07:06 Go to next message
jerson is currently offline  jerson
Messages: 202
Registered: June 2010
Location: Bombay, India
Experienced Member

I am looking at the Format function which is in util.cpp

This and few other functions have no mention anywhere in the documentation. Is there a place where all the available functions are listed and their parentage? This will help to know which files need to be included for a particular function to be used.

I have a file that uses the Format("%s","This is a test") function. Without the #include <core/core.h> I get a link time error on Format being undefined. On including <core/core.h> in my cpp file, I get

In file included from C:\MyApps\NIDAQ\NIDAQ.c:2:0:
C:\upp2625\uppsrc/core/core.h:39:20: fatal error: typeinfo: No such file or directory
compilation terminated.


and this is in Nidaq.c
#include "nidaqmx.h"
#include "core/core.h"

/**********************************************************************/
#define DAQmxErrChk(functionCall) if( DAQmxFailed(error=(functionCall)) ) goto Error; else

void	MyTest()
{
	return;
}

int32	Ni_ReadDI(int8 Dev, int8 Port, int32 *DI)
{
   int32     	error=0;
   TaskHandle   taskHandle=0;
   uInt32    	data;
   char      	errBuff[2048]={'\0'};
   int32     	read;

   //*********************************************
   // DAQmx Configure Code
   //*********************************************
   DAQmxErrChk (DAQmxCreateTask("",&taskHandle));
   DAQmxErrChk (DAQmxCreateDIChan(taskHandle, 
   				(const char *)(Format("Dev%c/port%c",Dev,Port)),
   				"",DAQmx_Val_ChanForAllLines));

...... irrelevant part snipped off
 


I'd appreciate any help I can get with this. For now, I'm stuck.

Regards
  • Attachment: NIDAQ.zip
    (Size: 150.13KB, Downloaded 190 times)
Re: where can I find more info? [message #28587 is a reply to message #28584] Wed, 08 September 2010 08:48 Go to previous messageGo to next message
koldo is currently offline  koldo
Messages: 3354
Registered: August 2008
Senior Veteran
Hello Jerson

Things I have done:

- Renamed NIDAQ.c to .cpp (removed extern "C" in .h)
- Added this in the beginning of .cpp files:

#include <Core/Core.h>

using namespace Upp;

#define _NI_int8_DEFINED_ 
#define _NI_int16_DEFINED_
#define _NI_int32_DEFINED_
#include "nidaqmx.h"

- In NIDAQ.cpp, function int32 Ni_ReadDI() does not return any value at the end.

I think with this it will work.


Best regards
Iñaki
Re: where can I find more info? [message #28602 is a reply to message #28584] Wed, 08 September 2010 10:09 Go to previous messageGo to next message
jerson is currently offline  jerson
Messages: 202
Registered: June 2010
Location: Bombay, India
Experienced Member

Thank you Koldo. It works now. Very Happy Just to understand, is the problem due to the nidaqmx.h file? - how? Was that causing the problems? I just cannot wrap my head around this as yet. Can you explain what could be the reason for the problems I see just so I can take adequate precautions in the future.

Best regards
Re: where can I find more info? [message #28608 is a reply to message #28602] Wed, 08 September 2010 10:42 Go to previous messageGo to next message
koldo is currently offline  koldo
Messages: 3354
Registered: August 2008
Senior Veteran
Hello Jerson

An important thing is that you forgot:
using namespace Upp;



Best regards
Iñaki
Re: where can I find more info? [message #28610 is a reply to message #28584] Wed, 08 September 2010 10:53 Go to previous messageGo to next message
jerson is currently offline  jerson
Messages: 202
Registered: June 2010
Location: Bombay, India
Experienced Member

Actually I did not forget the namespace Upp, I had to keep it out for the files to compile, otherwise, the Nidaqmx.h and this one were fighting it out in real-time on my desktop Laughing

the extern "C" was needed to keep the linker happy or it could not 'see' the functions in the other file. Anyway, now that I have something working, I'll 'try' to move on. Thanks again.
Re: where can I find more info? [message #28614 is a reply to message #28610] Wed, 08 September 2010 10:59 Go to previous messageGo to next message
koldo is currently offline  koldo
Messages: 3354
Registered: August 2008
Senior Veteran
jerson wrote on Wed, 08 September 2010 10:53

Actually I did not forget the namespace Upp, I had to keep it out for the files to compile, otherwise, the Nidaqmx.h and this one were fighting it out in real-time on my desktop Laughing

the extern "C" was needed to keep the linker happy or it could not 'see' the functions in the other file. Anyway, now that I have something working, I'll 'try' to move on. Thanks again.

Hello Jerson

As NIDAQmx.h redefines int32, ..., I have included this before:
#define _NI_int8_DEFINED_ 
#define _NI_int16_DEFINED_
#define _NI_int32_DEFINED_
This way, it does not disturb.

And remember that the namespace Upp is a must Smile.


Best regards
Iñaki
Re: where can I find more info? [message #28626 is a reply to message #28584] Wed, 08 September 2010 14:53 Go to previous messageGo to next message
jerson is currently offline  jerson
Messages: 202
Registered: June 2010
Location: Bombay, India
Experienced Member

A related question

Now that I have the NIDAQ package working on its own, I tried to integrate it with my main project.

The main package is in its own folder and NIDAQ along with the dependant NIDAQmx.LIB is in the NIDAQ package along with NIDAQ package knowing about the lib via the package configuration.

If I build in this way, I get a not found error on the LIB file. But, if I drop the LIB file into the main package folder, everything builds as expected.

Question : Is it not enough to indicate via package configuration that NIDAQ needs the LIB file? Why do I have to put it into the main package folder? In the package config, if I try clicking the 'Add to include path' checkbox, it simply greys out all 3 checkboxes and the setting is not persistent. Is there some setting where I can fix this?

In simplified terms
MyMainApp - Main Package
NIDAQ - NiDAQ package
--Nidaqmx.lib - which is needed for NIDAQ to be complete
Re: where can I find more info? [message #28630 is a reply to message #28626] Wed, 08 September 2010 16:07 Go to previous messageGo to next message
koldo is currently offline  koldo
Messages: 3354
Registered: August 2008
Senior Veteran
Hello Jerson

I cannot answer you well as I always put the .lib and .dll files in directories included in Setup/Build Methods.


Best regards
Iñaki
Re: where can I find more info? [message #28633 is a reply to message #28630] Wed, 08 September 2010 16:30 Go to previous messageGo to next message
dolik.rce is currently offline  dolik.rce
Messages: 1789
Registered: August 2008
Location: Czech Republic
Ultimate Contributor

Hi Jerson,

I guess your linker can't find the libs because they are in directory that is not specified on the linker command line. I believe you can solve it by adding "New linker option" in Package manager that specifies the path. For gcc it would be "-L/path/to/the/libs", not sure about the MSVC syntax from the top of my head. If I am not mistaken, then relative path might work as well.

The include paths are actually something bit different, as they are used only during compiling to find #include files.

Honza
Re: where can I find more info? [message #28634 is a reply to message #28584] Wed, 08 September 2010 17:30 Go to previous messageGo to next message
jerson is currently offline  jerson
Messages: 202
Registered: June 2010
Location: Bombay, India
Experienced Member

Koldo, Honza

Perfect. I used the Setup->Build methods to inform the linker about LIB directories and it works.

Thank you for your help

Where can I find info about the various goodies hidden inside the Upp namespace? This will be very helpful as I'm quite unaware of the hidden jewels in the framework.

Quote:

I am looking at the Format function which is in util.cpp
This and few other functions have no mention anywhere in the documentation. Is there a place where all the available functions are listed and their parentage?



Is there some kind of a function browser that can be handy? Is ^N the answer?

Regards

[Updated on: Wed, 08 September 2010 17:34]

Report message to a moderator

Re: where can I find more info? [message #28636 is a reply to message #28634] Wed, 08 September 2010 18:27 Go to previous messageGo to next message
dolik.rce is currently offline  dolik.rce
Messages: 1789
Registered: August 2008
Location: Czech Republic
Ultimate Contributor

jerson wrote on Wed, 08 September 2010 17:30

Is there some kind of a function browser that can be handy? Is ^N the answer?

Ctrl+N, Ctrl+J and last, but not least F1 Wink

Ctrl+N is good if you are interested in stuff from a distinct location (file or class).
Ctrl+J shows you everything (in currently included packages) and tells you where it is if you know how is it named.
F1 gives you details, at least for things that are documented.
Also Ctrl+G, but that is just Ctrl+J restricted to single file.

Honza
Re: where can I find more info? [message #28690 is a reply to message #28584] Sun, 12 September 2010 07:50 Go to previous message
jerson is currently offline  jerson
Messages: 202
Registered: June 2010
Location: Bombay, India
Experienced Member

Things like DrawBorder, DrawFatFrame and more from DrawUtility are missing from documentation. Is there some plan to update the documentation with a list of available functions in Upp as per included package?

The least that can be immensely helpful is to have a list of all the functions in each package added to the src.tpp file for the package even if it is not documented.
Previous Topic: Problems in growing up from newbie
Next Topic: Limits check in Meter code
Goto Forum:
  


Current Time: Thu Mar 28 13:09:50 CET 2024

Total time taken to generate the page: 0.02123 seconds