Hi, I am fairly new to the AIX world. I am trying to compile a set of C++ classes as a shared library on AIX. The C++ class methods use some functions, which are C functions. Hence, I should be using 'extern C' directive. I can succesfully compile the code on Windows, but on AIX, I get an error syaing that the extern is unnecessary. The file extension is .cpp, but I have specified an rule, which will treat it as a C++ file. Is there some flag, which will allow me to get rid of this nagging error.
The seond part of the question is, how to make shared libraries .so on AIX. It will be great if I can get a lead over here.
After installation. If you want to use the new xlc compiler and no more the earlier versions, it is recommended to perform the following commands. Installing the AIX compilers from the installation media PASE for i does not support the AIX® smit or installp utilities, which are typically used to install applications on systems running AIX. Installation of the XL C/C++ for AIX, XL C for AIX, or XL Fortran for AIX product is accomplished through a nondefault installation script that is. Have reduced this down from multiple configure options to disable-all, always get this same error. Anyone seen it? I am able to compile lsof source with no issues to.
Xlc Compiler
I am trying to use a library (archive) that was built with GNU C/C++ with a C program that is built using AIX's xlc compiler. The library has C interfaces that manipulates C++ objects declared within the library as either static and/or global variables, and the C program will be calling these C.
Thanks and RegardsShayad
I am trying to use the xlc compiler for my cpp code on AIX.I want the cc compiler for my C code
output:
but when I run make ( right after the above output), it seems to be using the gcc compiler.
I have tried adding the set inside my CMakeLists.txt file
I have also exported the environment variable:
Any thoughts?
There are no links for cc or xlc in the /usr/vac/bin directory.
When I grep for gcc and xlc in the shrxlm directory all I can find is gcc. Why isn't cmake honoring my request for the xlc compiler?
Install Xlc Compiler Aix En Ligne
2 Answers
Check the cc
symlink on your system to make sure it points to XL and not gcc. Do a which cc
and then ls -l
that.
Ibm Xlc Compiler
According to the CMake FAQ 'How do I use a different compiler?' section, there are 3 methods. It looks like you have tried to use all 3, including Method 3 (set())
, which is marked 'avoid'.
Could you try Method 1: use environment variables
again, but this time with the environment variables listed there, CC
(for C) and CXX
(for C++) environment variables?