LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices

Reply
 
Search this Thread
Old 07-23-2008, 01:45 AM   #1
sa20358
LQ Newbie
 
Registered: Apr 2008
Posts: 5

Rep: Reputation: 0
Compilation issue when Function is parameter in function call on LINUX


My code files are written in c++. Iam currently migrating all my api cc files from Solaris to LINUX. My LINUX server is Red hat 3 Update 2. Iam using gcc 3.2.3 compiler.

Iam having issue when compiling code on LINUX. Below is the function
call which compiles properly on Solaris.

DPS_SqlUtils::dropTable(mlDatabase.getDatabase(),rwConnection,szTempTabl
e);

But this line fails to compile on LINUX. If I change code as below it
compiles. My wild guess that this can be handled with compiling options.
I verified gcc man page but couldn't identify correct option for this
issue.

mlRWDBDatabase rwDB = mlDatabase.getDatabase();
DPS_SqlUtils::dropTable(rwDB,rwConnection,szTempTable);

Below are the list of components we are using on Solaris and LINUX server to compile sources.

Latest Solaris Compatible (fiddps8_v6.env)
Product Name Product Version Status
CPLUS_ANSI Y ACTIVE
CPLUS_LANG Y ACTIVE
C_LANG Y ACTIVE
FORTE_REL 10.0p2 PRODUCTION
INS_OPT old ACTIVE
JAKARTAPOI_REL 2.5 PRODUCTION
JAVA_REL 1.4.2_13 PRODUCTION
MAKE_OPT old ACTIVE
OPENCLIENT_REL 12.5.1_32bit_12982 PRODUCTION
OS_REL 5.8p81 PRODUCTION
PCREATE_PKG_REL 4.0_E0 PRODUCTION
RWSP_DB_REL 9.0p1 PRODUCTION
TARG_MACH sun4u ACTIVE
XALANJ_REL 1.2.2 PRODUCTION


LINUX Compatible (fiddpsrh_v1.env) [Red Hat 3 Update 2]
Product Name Product Version Status
CPLUS_REL 3.2.3 PRODUCTION
C_REL 3.2.3 PRODUCTION
INS_OPT old ACTIVE
JAKARTAPOI_REL 3.0 PRODUCTION
JAVA_REL 1.6.0_03l PRODUCTION
MAKE_OPT old ACTIVE
OPENCLIENT_REL 12.5.1_32bit_EBF12107 PRODUCTION
OS_REL RH3.2.3_26AS PRODUCTION
PCREATE_PKG_REL 4.0_E1 PRODUCTION
RWSP_DB_REL 9.0u1L BETA
TARG_MACH i686 ACTIVE
XALANJ_REL 2.7.0 PRODUCTION

Please advise
 
Old 07-23-2008, 05:06 AM   #2
clvic
Member
 
Registered: Feb 2008
Location: Rome, Italy
Distribution: OpenSuSE 11.x, vectorlinux, slax, Sabayon
Posts: 206
Blog Entries: 2

Rep: Reputation: 44
You didn't specify the type of the three parameters nor the prototype of the function, I suppose the function to be passed as a parameter is mlDatabase.getDatabase.

In this case, the correct syntax is not:
DPS_SqlUtils::dropTable(mlDatabase.getDatabase(),rwConnection,szTempTabl
e);
but:
DPS_SqlUtils::dropTable(mlDatabase.getDatabase,rwConnection,szTempTabl
e);

that is, you have to remove the (), otherwise the effect is that of a function call, and the first parameter will be the one returned by the function itself.
 
Old 07-24-2008, 10:19 PM   #3
sa20358
LQ Newbie
 
Registered: Apr 2008
Posts: 5

Original Poster
Rep: Reputation: 0
But this doesn't work for me.
Definition for the function call are given below:
void DPS_SqlUtils::dropTable(mlRWDBDatabase& rwdbDatabase
, RWDBConnection& rwdbConnection
, const mlRWCString& rszTbName)
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
( C ) How do you declare a function pointer where a parameter is a function pointer? spursrule Programming 5 11-27-2007 07:56 PM
what is function parameter? Jeon, Chang-Min Linux - Software 2 06-22-2006 06:53 PM
How to call another function from a function? geminigal Programming 4 04-21-2005 10:41 PM
Passing one php function result as a parameter to another php function davee Programming 13 09-12-2004 12:08 PM
What function does linux call to save a file ? lostboy Programming 2 06-04-2004 03:03 PM


All times are GMT -5. The time now is 03:20 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration