Active7 years, 2 months ago
When building an application using g++, I am not explicitly passing the libc library as a library to link to in the same way you would for other libraries (like passing
mathematician1975mathematician1975-lpthread
for example). I know that libc has the so name libc.so.6
but I am aware that this is not actually a library but something like a pointer to another version of libc (such as libc-2.15.so
). My question is if I had multiple versions of libc on my computer, how can I tell which one actually gets linked to through the libc.so.6
.97688 gold badges2222 silver badges4646 bronze badges
Multiple versions of GCC can be installed and used on Ubuntu as described here. The update-alternatives tool makes it easy to switch between multiple versions of GCC. On Ubuntu, gcc and g are just symbolic links to the actual binaries of a specific version of GCC. By switching the version, invoking gcc will execute the. GCC does not support the uncorrected version. A fourth version of the C standard, known as C11, was published in 2011 as ISO/IEC 9899:2011. (While in development, drafts of this standard version were referred to as C1X.) GCC has substantially complete support for this standard, enabled with -std=c11 or -std=iso9899:2011.
1 Answer
ldd
should be the tool of your choice. That gives you the shared library actually linked.In case of the libc you can simply run the
con-f-use.so
file and will be told the library version.con-f-use
13.5k1717 gold badges7878 silver badges139139 bronze badges
Not the answer you're looking for? Browse other questions tagged application-developmentshared-libraryg++ or ask your own question.
Active3 years, 7 months ago
I am programming in c++. I have installed mingw. I installed it from the standard installer from mingw website. I am confused between mingw32, mingw, mingw64. What are the differences and how can I check my version. Also when my programs are build, how would I know whether the executables created are 32 bit or 64 bit?
Sнаđошƒаӽ8,3211010 gold badges4848 silver badges7272 bronze badges
OmkarOmkar18811 gold badge44 silver badges1717 bronze badges
1 Answer
mingw and mingw32 are for creating executables for 32-bit windows systems. mingw64 is for creating 64-bit executables. Note: this doesn't have to do with what version you are running when you do the build, but what the target system is for the executable you are creating (the system on which you will be running the newly created executable).
Regarding MinGW and MinGW32, here's a snippet from
The MinGW Wiki
The MinGW Wiki
'The project's name changed from mingw32 to MinGW is to prevent the implication that MinGW will only works on 32 bit systems (as 64 and higher bit machines become more common, MinGW will evolve to work with them).'
To find out what version you have, go the the associated bin directory and do:
I'd recommend checking out minGW-w64, from here: http://mingw-w64.sourceforge.net/
That projects goal is to 'deliver runtime, headers, and libs for developing 64 bit (x64), as well as 32 bit (x86), windows applications using gcc-4.6 or newer versions.'
RobMRobMThat projects goal is to 'deliver runtime, headers, and libs for developing 64 bit (x64), as well as 32 bit (x86), windows applications using gcc-4.6 or newer versions.'
3,30022 gold badges1313 silver badges1414 bronze badges
Got a question that you can’t ask on public Stack Overflow? Learn more about sharing private information with Stack Overflow for Teams.