Porting C++ 32-bit code on 64-bit Solaris


 
Thread Tools Search this Thread
Operating Systems Solaris Porting C++ 32-bit code on 64-bit Solaris
# 1  
Old 01-05-2009
Porting C++ 32-bit code on 64-bit Solaris

Hi,
I am trying to convert 32-bit code to 64-bit.

I have defined function

int main()
{
int* l;
size_t len1;
fun(len1);
return 0;
}

void fun(int* ptr)
{
cout<<"\nsizeof(ptr)"<<sizeof(ptr);
}

However while compiling getting error as :
Error: Formal argument ptr of type unsigned long* in call to fun(unsigned long*) is being passed unsigned long.
# 2  
Old 01-05-2009
That's probably because you're passing len1 by-value instead of by-reference. I'm guessing you rather want fun(l), instead of fun(len1).
# 3  
Old 01-05-2009
Thanks pludi.
I solved the problem.
Login or Register to Ask a Question

Previous Thread | Next Thread

7 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

How to handle 64 bit arithmetic operation at 32 bit compiled perl interpreter?H

Hi, Here is the issue. From the program snippet I have Base: 0x1800000000, Size: 0x3FFE7FFFFFFFF which are of 40 and 56 bits. SO I used use bignum to do the math but summing them up I always failed having correct result. perl interpreter info, perl, v5.8.8 built for... (0 Replies)
Discussion started by: rrd1986
0 Replies

2. Solaris

Solaris os 32 bit or 64 bit

:confused: how to find out wether my os is 32 bit or 64 bit. I am using Solaris 5.6. also i want to know the difference between 32 bit and 64bit os. any help will be much appreciated as i am in urgent need of this information (6 Replies)
Discussion started by: asalman.qazi
6 Replies

3. SuSE

64 bit Porting Problem !!!

Dear All, I am trying to build my code (currently functioning on 32bit) on 64 bit SUSE machine. I am getting following error: warning: initializer element is not computable at load time dau.gss.c:275: error: initializer element is not constant dau.gss.c:275: error: (near initialization for... (10 Replies)
Discussion started by: skaushal.schip
10 Replies

4. Red Hat

No Error for 64-bit porting

I am just trying to get the warning while compiling for 64-bit on Linux >> uname -a Linux mms4.es.cpth.ie 2.6.9-22.ELsmp #1 SMP Mon Sep 19 18:00:54 EDT 2005 x86_64 x86_64 x86_64 GNU/Linux =================================== Written test.c file which conatin : #include<stdio.h>... (1 Reply)
Discussion started by: amit_27
1 Replies

5. Solaris

Solaris 64-bit to 32-bit

I had previous implemented the following in my menu.lst to be able to get to 32-bit operations. # title Solaris 10 32-bit root (hd0,0,a) kernel /platform/i86pc/multiboot kernel/unix module /platform/i86pc/boot_archive </code> Now, it is not working as I get the following error : ... (0 Replies)
Discussion started by: praveenr
0 Replies

6. AIX

porting an application on 64-bit AIX version 5

Hi all, I am facing problem in porting to 64 bit AIX especially with compiling options to compile and run under 64 bit kernel.Can any one put some light on the issue thanks in advance vishal (14 Replies)
Discussion started by: vishalzone2002
14 Replies

7. Programming

copying or concatinating string from 1st bit, leaving 0th bit

Hello, If i have 2 strings str1 and str2, i would like to copy/concatenate str2 to str1, from 1st bit leaving the 0th bit. How do i do it? (2 Replies)
Discussion started by: jazz
2 Replies
Login or Register to Ask a Question