Linux Program (C ++) is being transplanted from 32-bit to 64-bit. You are still trying it. Do not try it. Give me more advice...

Source: Internet
Author: User
Tags sybase

Project configuration: Linux (32-bit SUSE) + database (32-bit Sybase) + Tomcat

New Platform: Linux (64-bit SUSE) + database (64-bit Sybase) + Tomcat

Let's talk about the environment setup:

Step 1: Install the cmake and FTP-server tools on the new platform. (This is just Baidu)

Step 2: because the project references the C ++ poco open-source library, an error will be reported after the project is transplanted, indicating that the dynamic link library of Poco is incompatible and the link fails. There are many explanations in this regard on the Internet. I tried it here and thought it should be caused by the 32-bit dynamic link library referenced in the project, so I did not hesitate to go To the POCO official website to download the source code. I made a new dynamic link library on 64-bit Suse. After the replacement, the problem was solved. It is very easy to compile a dynamic library. After the source code of the POCO official website is compiled, make it directly.

Step 3: After poco's dynamic library is connected, we can find that Sybase on 64-bit SuSE has been deleted (the user name is still in use )... Then we started to install 64-bit Sybase, and directly installed it on the hard disk. Even if the installation was failed, we could only install the 64-bit Sybase. /setup-console installation, the installation tutorial of Sybase is useless, and I am trying to find out how to install it.

Step 4: I thought everything would be fine. I know that the dynamic library libsybcs. So will be linked to Sybase during compilation. What's more strange is that this time it was not incompatible, but it could not be found! I used the find command to find out that there are indeed some problems. I think it should be a path problem, so export Path = .................. export LD_LIBRARY_PATH = .............. it's strange! During cmake compilation, the system still prompts that libsybcs cannot be found. so, again for the omnipotent csdn, found. bashrc, 64suse found a file, and even this file does not exist, so I copied it directly on 32suse. So...

Step 5: So... Shit! Not yet! This error indicates that libsybcs. So is not compatible! No... Is it necessary to configure a 32-bit dynamic Sybase library? Still trying... Comments

Today, I was dizzy. I didn't even find a library called libsybcs64.so... Modify cmakelists. Finally compiled.

Step 6: I started my postgraduate study. I checked the source code of Poco and the location where the compilation error was reported. Let's change it! Some function calls are incorrect (for example, copystream, copystream64 should be called in 64-Bit mode), and various types of conversions are involved... In short, it is easy to adjust it slowly.

Step 7: Finally, all links have been compiled (ignore warning, there are many warnings when speaking of 32 bits, and there are problems left over from history, don't want to change ). An inexplicable error was reported during running: libpocofoundation. so.12 could not be found. In other words, this link has not been configured on 32-bit Suse and has not been changed in cmakelists on 64-bit Suse. How can this be done? Continue to study...

In the original project, a link is created for the dynamic library. The Link name is *. so.8; now I don't know why I started to find the link with a suffix of 12. I changed the name suffix of the link created in the shell script *. so.12.

Step 8: Finally, all the compilation links have passed! The program name is sss_agent, but coredump is run as soon as the program is run. The debug core file is miserable.

Sss_agent: malloc. c: 3096: sysmalloc: assertion '(old_top = (mbinptr) (char *) & (AV)-> bins [(1)-1) * 2])-_ builtin_offsetof (struct malloc_chunk, FD) & old_size = 0) | (unsigned long) (old_size)> = (unsigned long) (_ builtin_offsetof (struct
Malloc_chunk, fd_nextsize) + (2 * (sizeof (size_t)-1 ))&~ (2 * (sizeof (size_t)-1) & (old_top)-> size & 0x1) & (unsigned long) old_end & pagemask) = 0) 'failed.

Nothing to say, change the code... I still have a headache. I don't know where to start...


Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.