Programming :: Accessing C Function From C++

Jul 5, 2010

i have an open source application that was developed in C++ (it uses objects and namespaces all over the place). I also have another application that was developed in C. Now i am trying to insert the code made in C into C++ application, but when i do that , i get this error on compilation of the source code:

Code:
error: 'mpi_init_vars' was not declared in this scope the function mpi_init_vars() is not part of object oriented programming and it doesn't belong to any scope, it was compiled into an object file and i am linking it with all objects of C++ application.

How can invoke the C function from C++ object oriented code?

View 2 Replies


ADVERTISEMENT

Programming :: How Can A Friend Function Access A Public Function From A Base Class

Nov 16, 2010

Code:
#include <iostream>
using namespace std;

[code]...

View 1 Replies View Related

Programming :: Passing Data From Interrupt Handler Function To Tasklet Function?

May 18, 2010

I am doing some Linux kernel programming for my research project. I need to record the timestamp (by using cpuid and rdtsc) when an interrupt handler (top half) is first invoked. Due to the time critical nature of the problem itself, I have to do the timestamping inside the interrupt handler itself (the first operation when the handler is called). However, I understand that tasks that are not so time critical should be deferred to a tasklet function (bottom half) for processing because other interrupts are disabled in a (top-half) interrupt handler. I am currently out of idea on how I can pass the timestamp information that I have obtained in the interrupt handler to the corresponding tasklet function.

View 2 Replies View Related

Programming :: Declaring A Function In A Function - C Programming

May 24, 2010

I want to declare a function in a function, but had no success till now, see the error code below and visit the project at sourceforge

[Code]...

View 14 Replies View Related

Programming :: Bash Array Add Function Example Using Indirect Array Reference As Function Argument?

Jun 20, 2010

I looked on the net for such function or example and didin't find anything, thus after having made one i guess it would be legitimate to drop it to see what others thinks of it.

#!/bin/bash
addelementtoarray()
{
local arrayname=$1

[code]....

View 10 Replies View Related

Programming :: Surface Fitting Using NR Function Svdfit ( ) In C Programming?

Sep 16, 2010

fit a surface i.e. W(x,y) using svdfit() provided by "Numerical Recipes in C". svdfit() is written for curve fitting and not for surface fitting.But one can use svdfit(), as claimed by authors of NR book, to do surface fitting. On page 680 of NR book, authors have given a hint on how to use svdfit() for fitting a surface. But I have not understood it.This link may be helpful (Chapter 15 th is relevant here.):[URL]This is my problem:

Code:
I have a set of 100 numbers. I want to fit a 2-Dimensional function W(x,y) to these numbers.

[code]....

View 2 Replies View Related

Programming :: Accessing Python Scripts Using Web?

Mar 17, 2011

I am using Centos. I have written some scipts in python that access my routers and fetch the configuration, etc. Now i was thinking of creating a web interface which i can access from my windows XP. I want it to have good look n feel :-),

View 7 Replies View Related

Programming :: PHP Accessing Variables Within Array

Mar 30, 2011

I am pretty new to PHP so excuse my dumbness. I've searched this up in quite a few places and cant find anything : Basically, I've made an array, within it are 3 more arrays. Their are two values in each array, 'Name' and 'Age'. Basically I am using a While statement to try and cycle through the 'age' value of my array and state whether or not the person is eligible. (I am actually just learning so I'm doing this to just test myself).

Here is my code
Code:
<?php
$people =array(
array('name' => 'Bob', 'age' => 15 ),
array('name' => 'Jhon' , 'age' => 10),
array('name' => 'Sue' , 'age' => 7));
//($value =& $people[0,1,2][age] );

Here was an attempt to try and create a reference to age, I tried it many different ways
while($age < 10) {
echo ('$name, is eligible') ; } ?>

Okay, so I tried to do this through two ways, one way I tried to create a reference to age, then evaluate it, without that line of code their would be no reference, which way is correct, why wont it work? I am using Xammp, so when I launch local host I get an undefined variable error. What To Do?

View 3 Replies View Related

Programming :: Calling An Asm Function From C?

Jun 4, 2010

I have a question about calling an asm function from C....It doesn't work unless I create an asm variable to hold the value of the function in....Why?Here's the code that doesn't work...

asmfile.s - version one Code: .section .data
mydata: .ascii "this is the message!
.equ mylen, . - mydata

[code]...

View 2 Replies View Related

Programming :: Using Backtrace() Function In C?

Jul 23, 2010

I want to use backtrace() function to debug a crash issue. I tried this sample code to see how backtrace works. backtrace() function always returns 0 with the below code. Is there any kernel configuration that needs to be set for proper working of backtrace?

#include <execinfo.h>
#include <stdio.h>
#include <stdlib.h>
/* Obtain a backtrace and print it to stdout. */
void
print_trace (void)

[Code]...

View 2 Replies View Related

Programming :: How To Write / Use Function

May 30, 2010

Can you offer me the code about fmod() in C. I want to know how this function work, i am very interested in it because i have no idea to implement it, i want to know... how to write the function... not 'how to use the function' can anyone post the source codes of this function here?

View 6 Replies View Related

Programming :: Bash Function Using If / Then And Else

May 2, 2011

I am trying to build a function inside a script.

Code:
#!/bin/sh
#System commands and other configurable.
IPT=/sbin/iptables
IP6T=/sbin/ip6tables
IPST=/usr/sbin/ipset
MODP=/sbin/modprobe
GET=/usr/bin/wget
INT_NET=192.168.1.0/24 .....

I can find lots of tutorials in how to use if, then, else. However, how do I define a variable inside the function?
SEE>>
Code:
for c in $ISO
Also, am I using the 'test' command correctly( -/+ week as valid test)?

View 7 Replies View Related

Programming :: Calling C Function In Php?

Feb 7, 2011

I am doing a web site program and what I need is to call a C program in the PHP cloud.Do u think it would be possible? The web site would get the user input from PHP UI and pass to the C program , the C program would process the function with the user input and output the a PHP page.

View 2 Replies View Related

Programming :: C++/c Function Is Uable To Know Its Name?

Jan 4, 2011

I ask if a c++/c function is able to know its name from inside itself:

example:

Code:
int funct1(int a,b)
{
printf("%s ",funct_name());
}
or with a trick.

View 2 Replies View Related

Programming :: Run 'time' On A Function?

May 30, 2010

Code:
#!/bin/ksh
(...)
# FILL UP PARTITION
diskfillerfunction () {

[Code]....

Test 15: fill up partition /usr/bin/time: cannot run diskfillerfunction: No such file or directory

I am obviously omitting (...) a lot of the code, but the relevant part is all there. How do I 'time' a function?

View 5 Replies View Related

Programming :: Run Function In Background?

Mar 26, 2010

I wrote a spinner in Perl and when I did a spinner in shell I could just run the subroutine in the background.

[code]...

In Perl, how do you run a function in a background and get the PID for that? I know PID in Perl is $$

View 2 Replies View Related

Programming :: Regarding Sleep() Function In C?

Mar 25, 2011

I know what is the functionality of the sleep() method.

for(i = 0; i < length; i++){
sleep(1000);
printf("%c
", message[i]);
}

Result :every print of the message will be takes 1000sec of gap but i want to know why wee need to use the Sleep function. where exactly it is useful

View 14 Replies View Related

Programming :: Return Value From A Function?

Nov 15, 2010

On this link [URL]4 a return type is defined

Code:
return ((unsigned int)(unsigned long)base & TBASE_DEFERRABLE_FLAG);
What is the above function returning.I am not clear with definition of what is being returned in the above code.

View 7 Replies View Related

Programming :: Use Function C In Java?

Apr 8, 2010

i want to compile function c in java and compile library is success.. when i call the library in java and error is :

Exception in thread "main" java.lang.UnsatisfiedLinkError: no libfunc.so in java.library.path
at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1689)
at java.lang.Runtime.loadLibrary0(Runtime.java:823)
at java.lang.System.loadLibrary(System.java:1028)

[Code]....

View 1 Replies View Related

Programming :: Accessing A Sybase Database From PHP Running?

May 12, 2011

i get some trouble setting up good environment in linux.i have problem regarding connecting php(under linux) to a sybase server(under windows)is there anyway connecting this two technologies?.

View 1 Replies View Related

Programming :: Accessing File And Manipulating With With Folders?

Mar 12, 2010

I have a .csv file with a list of Drugs Name that i need to remove from the folder. The folder consist of files that stored as drugname.mol format.

What i need to do is to sieve out those mol files from the folder?

How do i

(1) access the drugs names from the .csv file line by line (variable x)

(2) how do i access the files in the folder one by one (variable y)

(3) how can i do a comparison whether $x.mol == $y

(4) and shift them to another folder if $x.mol == $y

View 11 Replies View Related

Programming :: Accessing Server From Remote Host?

Mar 2, 2011

i have made a java web server which works on localhost.but now i want to capable it handling many clients at a time.so clients running on different computer need machine name or IP address of server computer.How can i do this in java?

View 1 Replies View Related

Programming :: Accessing Global Variables In Script?

Apr 10, 2011

I have a script that goes like this

step 1 - install sdk

step 2 - update ~/.bashrc export some new variables

step 3 - check said variables, if they return a value then we know a reboot has taken place and we can continue to step 4. otherwise halt and isssue a warning that a reboot is needed.

Ok, so this works if I just execute the script when I am logged on as root, and after a reboot & rerun of the script I can check the variables exist and the program will continue as expected. only when I am logged on as root will the variables I exported in bashrc return a value. If I run the script as sudo root the values are blank.

View 2 Replies View Related

Programming :: Use Pipe In Excel Function?

Apr 13, 2010

In shell, I execute "./ffmpeg -f h264 - | xxx"

Now I hope use execl function to execute above operations,

I call execl("/bin/sh", "sh", "-c", "./ffmpeg -f h264 - | xxx");

but ffmpeg doesn't work, it seems that "|" pipe don't work.

how could I solve this?

View 1 Replies View Related

Programming :: Remote Function With Pthread?

May 22, 2010

I wrote some code in c, using pthread (I configured the linker and compiler in eclipse IDE first).

Code: #include <pthread.h>
#include "starter.h"
#include "UI.h"
Page* MM;

[Code]....

View 6 Replies View Related

Programming :: .bashrc Function Tab Completion?

Jul 5, 2010

I tried to make a (very simple) function to put in my .bashrc file to make a local backup of a file, but when I call the function and try to use tab completion I get the following error: Code: cp: cannot stat `help': No such file or directory The function I added is as follows:

Code: function bk
{
cp -f --backup=numbered ${1} ${1}.bak

[code]....

View 2 Replies View Related

Programming :: Get Function's Prototype From Elf File?

Oct 18, 2010

I've an ELF file (exec)...I'm interested in getting a the function prototype of the "myfunc"...

View 9 Replies View Related

Programming :: Gc-sections Remove All Function Not Used?

Nov 18, 2010

This is my file, named xxx.c. And there are two functions in it.

[code]...

When I try to compile the whole project, I used -ffunction-sections,-fdata-sections to generate the .o files, use Wl,--gc-sections -Wl,--print-gc-sections to link to the exacutable file. gcc 4.3.2 ld 2.18 Debian 5 After the first time I compiled it, I got a list of Removed functions. But one second later, I rememberd that I forget to close the Compile Switch: Debug. Then I had to recompile it and got another list. Compare these two lists, I found that , bxx isn't on the second list. First I guess that bxx is a debug function but never used in debug mode, and it won't be compiled in release mode. I check the source and find that there was no compile switch for bxx. But it's caller function axx, is removed, both the debug switch is on and off. I try to compiled the project for several times , but the result is the same. I can't realized it , why? Is that the --gc-sections won't remove all the functions not used?

View 4 Replies View Related

Programming :: Function To Close The Script

Feb 12, 2011

I'm doing a script to make some task but I would like to know how can I do the part to check the bu.log ? Cause if the files exists it will send me an email with the log, but when the file doesnt exist it will send a blank emal that why i would like to 'check the file' and if there isnt will end it.

#!/bin/sh
x="$HOME/bu.log"
if [ $x ]; then #if the file exists will do
for file in *.log

[Code].....

How can I edit the funcion to check if there isnt an arq.log and close the script?

View 5 Replies View Related

Programming :: How To Use A Function Inside A Shell

Apr 28, 2011

I am very new to shell script, and my requirement is --

1. open the apache access log, use "cut" and "grep" to find the numbers.
2.put the result in a file
3.then compare the same result with day before result
4. send the result via e-mail.

so how can i do that , using some functions..

View 1 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved