473,598 Members | 3,409 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

error: expression must have pointer-to-object type

5 New Member
Hi everyone,
I critically need help to solve this problem related to pointer in C++
Basically, I have a C/C++ program "retardselfener g" calling a Fortran 90 subroutine "surfGF4.f9 0". i am so doubtful if my definitions of pointer variables and their use in calling function are correct.

#include<bla bla bla......h>
#include<bla bla bla.h>

double surfGF4_(double *, double*, double*, double*, double*, double*, double*, double*, double*);

void retardselfenerg (real d_omega, int len)
{
int i,j;
double sigm11,sigm12,s igm21,sigm22,si gmN_1N_1,sigmN_ 1N,sigmNN_1,sig mNN;
double *sigm11x = &sigm11;
double *sigm12x = &sigm12;
double *sigm21x = &sigm21;
double *sigm22x = &sigm22;
double *sigmN_1N_1x = &sigmN_1N_1;
double *sigmN_1Nx = &sigmN_1N;
double *sigmNN_1x = &sigmNN_1;
double *sigmNNx = &sigmNN;

double noisevarleft11, noisevarleft12, noisevarleft21, noisevarleft22, noisevarrightN_ 1N_1, noisevarrightN_ 1N, noisevarrightNN _1, noisevarrightNN ;
double *noisevarleft11 x = &noisevarleft11 ;
double *noisevarleft12 x = &noisevarleft21 ;
............... ............... .....
............... ............... ....etc
noisevarrightNN _1x =&noisevarright NN_1;
noisevarrightNN x = &noisevarrightN N;
FILE *out11, *out12, *out21, *out22, *outN_1N_1, *outN_1N, *outNN_1,
*outNN, *out11x, *out12x, *out21x, *out22x, *outN_1N_1x, *outN_1Nx, *outNN_1x, *outNNx;

double w, dw;
double k_B = 1;
double hbar = 0.06465;

fftw_complex *sigm11_w, *sigm11_t;
fftw_plan p;

out11 = fopen("self_lef t11.txt", "w");
out11x = fopen("noisevar left11.txt", "w");

sigm11_w = (fftw_complex *) fftw_malloc(siz eof(fftw_comple x) * len);
sigm11_t = (fftw_complex *) fftw_malloc(siz eof(fftw_comple x) * len);

assert(sigm11_w != NULL);
assert(sigm11_t != NULL);
assert(len == length_FFT);

p = fftw_plan_dft_1 d(len, sigm11_w, sigm11_t, FFTW_FORWARD, FFTW_ESTIMATE);

dw = 2.0*M_PI/(h*len);

for (i=0; i<len; i++)
{
w = i * dw;
for (j=0; j<2; ++j)
{
surfGF4_(w, sigm11x, sigm12x, sigm21x, sigm22x, sigmN_1N_1x, sigmN_1Nx, sigmNN_1x, sigmNNx);
/* sigm11[i][j] = *sigm11x[i][j]; */
*sigm11_w[i][j] = *sigm11x[i][j];
*noisevarleft11 x[i][j] = - (pow(exp(hbar*w/(k_B*T_left))-1,-1) + 0.5)*hbar*h*len *(*sigm11x[i][j]);
}
fprintf(out11x, "%lf", noisevarleft11[i][1]);

}
............... .......
............... .......etc

The corresponding fortran 90 program looks something like this

subroutine surfGF4(w, sigm11, sigm12, sigm21, sigm22, sigmN_1N_1, sigmN_1N, sigmNN_1, sigmNN)

implicit none
............... .........
............... .......

real, dimension (1,2) :: sigm11, sigm12, sigm21, sigm22, sigmN_1N_1, sigmN_1N, sigmNN_1, sigmNN
............... .......etc

It is necessary to know something about FFTW (fastest fourier transform in the west) library function in this case.
I use SSH and linux icc compiler to compile this program but I get this error in compilation

GlobalRev.c(131 3): error: argument of type "double" is incompatible with parameter of type "double *"
surfGF4_(w, sigm11x, sigm12x, sigm21x, sigm22x, sigmN_1N_1x, sigmN_1Nx, sigmNN_1x, sigmNNx);
^

GlobalRev.c(131 5): error: operand of "*" must be a pointer
*sigm11_w[i][j] = *sigm11x[i][j];
^

GlobalRev.c(131 5): error: expression must have pointer-to-object type
*sigm11_w[i][j] = *sigm11x[i][j];
^

GlobalRev.c(131 6): error: expression must have pointer-to-object type
*noisevarleft11 x[i][j] = - (pow(exp(hbar*w/(k_B*T_left))-1,-1) + 0.5)*hbar*h*len *(*sigm11x[i][j]);
^

GlobalRev.c(131 6): error: identifier "T_left" is undefined
*noisevarleft11 x[i][j] = - (pow(exp(hbar*w/(k_B*T_left))-1,-1) + 0.5)*hbar*h*len *(*sigm11x[i][j]);
^

GlobalRev.c(131 6): error: expression must have pointer-to-object type
*noisevarleft11 x[i][j] = - (pow(exp(hbar*w/(k_B*T_left))-1,-1) + 0.5)*hbar*h*len *(*sigm11x[i][j]);
^

GlobalRev.c(131 8): error: expression must have pointer-to-object type
fprintf(out11x, "%lf", noisevarleft11[i][1]);
..............
.............et c

The most serious error is perhaps the one which says
"error: expression must have pointer-to-object type"
I have repeatedly re-checked my definition of pointer and its use in this program (also considering the use of libary function FFTW in defining complex variables) and also the use of those variables in calling function, but I still could not solve the problem. I think most likely the cause of error is in defining which one is pointer and which one is variable to which th pointer points, but I couldn't see which one is wrong. Could someone expert on C/C++ outthere help me on this please? Thanks in advance.

regards
Jul 29 '07 #1
1 23381
weaknessforcats
9,208 Recognized Expert Moderator Expert
GlobalRev.c(131 3): error: argument of type "double" is incompatible with parameter of type "double *"
This error says you need a double* argument and you used a double.

It's on this call:
surfGF4_(w, sigm11x, sigm12x, sigm21x, sigm22x, sigmN_1N_1x, sigmN_1Nx, sigmNN_1x, sigmNNx);
It's the varible w which is defined as:
double w, dw;
You need to call with &w and not just w.

Try this. It should fix the first error. Subsequent errors may be due to this so you always fix the first error and rebuild.
Jul 29 '07 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

2
6163
by: Aloof | last post by:
Using Access 2000 Windows Server 2003 The following code worked fine until we moved hosting companies StartDate = Request.Form("StartDateMonth") & "/" & Request.Form ("StartDateDay") & "/" & Request.Form("StartDateYear") EndDate = Request.Form("EndDateMonth") & "/" & Request.Form ("EndDateDay") & "/" & Request.Form("EndDateYear")
1
1365
by: ksrkp | last post by:
Iam getting a The expression on click you entered as the event property error when I tried run an MDE file at users desk top when executing a query which has qry1="select x from y where z not in (select z from a) " error description says nothing except a period . I was calling the query in the macro with currentdb.execute(qry1). Looks like the users desktop running the same access 2003 version might be slightly different, Also we came with...
1
3633
by: Carlos Kim via DotNetMonster.com | last post by:
Compiler Error Message: CS1026: ) expected Source Error: Line 12: <body MS_POSITIONING="GridLayout"> Line 13: <form id="Form1" method="post" runat="server"> Line 14: <cr:CrystalReportViewer id=CrystalReportViewer3 style="Z-INDEX: 101; LEFT: 24px; POSITION: absolute; TOP: 40px" runat="server" Height="1013px" Width="901px" ReportSource='<%# c:\inetpub\wwwroot\ WebApplication4\CrystalReport222.rpt %>'>
2
686
by: isaac2004 | last post by:
hello i am getting a weird al syntax error from my SQL statement Microsoft OLE DB Provider for ODBC Drivers error '80040e14' Syntax error (missing operator) in query expression 'tblBookDescription.strTitle Where (((tblCategories.strCategory) = 'Database'))'. /06Winter/levini/A07/SearchBrowse.asp, line 53
4
3752
by: vg-mail | last post by:
Hello all, I have identical design for form and report but I am getting calculation error on form and everything is OK on report. The form and report are build up on SQL statement. The calculation is very simple. The calculation is done in an underling query if I can call it a query or I should call it a SQL statement. It looks like a query but it is not saved as the query. The calculation in that query is very simple - ExtendedPrice:*....
3
6239
by: clino | last post by:
const int c=9; void main() { int a=9; switch (a) { case c: a=c+1; break;
8
2149
by: Anshul | last post by:
Hi, I tried compiling this code - int main() { char abc = "%s"; printf("\033[1m" abc "\033[m" , "doing"); }
1
7394
by: Francesco Moi | last post by:
Hi. I get this error message on my Firefox Error Console: ---------------- Error: missing } in XML expression Source File: http://www.foo.com/js/maps.js Line: 273, Column: 18 Source Code: options2 = { title: "John was here", icon: icon1}; -----------------
6
5315
by: Lawrence Spector | last post by:
I ran into a problem using g++. Visual Studio 2005 never complained about this, but with g++ I ran into this error. I can't figure out if I've done something wrong or if this is a compiler bug. Here's a very simple example which should illustrate what I'm doing. #include <iostream> template <class T> class TestBase {
2
1928
werks
by: werks | last post by:
Hello PHP experts how can you detect ' character in your search field? Because every time I input the word hilgard's it returns an error I think because of the character '. This is the error Warning: odbc_exec() : SQL error: Syntax error (missing operator) in query expression 'Title LIKE '%hilgard's%';'., SQL state 37000 in SQLExecDirect in D:\wamp\www\Online Library\opac.php on line 76 Syntax error (missing operator) in query...
0
7991
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
7902
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8398
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8050
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8265
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
5850
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5438
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
3898
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
1504
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.