Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6322553
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T16:21:14+00:00 2026-05-24T16:21:14+00:00

I am linking to a .a lib and need to link to the right

  • 0

I am linking to a .a lib and need to link to the right version for the machine that’s compiling. Is there a way to detect the type of machine in a .pro file in linux? I found this article, but they only discuss Windows: http://developer.qt.nokia.com/faq/answer/how_can_i_detect_in_the_.pro_file_if_i_am_compiling_for_a_32_bit_or_a_64_bi

Edit: The .a library is Gtest. Another way to solve my problem would be to somehow build a .a file with g++ that will work on either 32-bit or 64-bit platforms. Is that possible?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-24T16:21:15+00:00Added an answer on May 24, 2026 at 4:21 pm

    By doing your conditional on a mkspec, (see Platform Scope Values here), you can check for a very large variety of compiler/platform.

    My mkspec directory (Linux64 machine), gives the following differentiations:

    aix-g++/                          irix-g++-64/                      qconfig.pri                       wince50standard-armv4i-msvc2005/
    aix-g++-64/                       linux-cxx/                        qws/                              wince50standard-armv4i-msvc2008/
    aix-xlc/                          linux-ecc-64/                     sco-cc/                           wince50standard-mipsii-msvc2005/
    aix-xlc-64/                       linux-g++/                        sco-g++/                          wince50standard-mipsii-msvc2008/
    common/                           linux-g++-32/                     solaris-cc/                       wince50standard-mipsiv-msvc2005/
    cygwin-g++/                       linux-g++-64/                     solaris-cc-64/                    wince50standard-mipsiv-msvc2008/
    darwin-g++/                       linux-g++-maemo/                  solaris-cc-64-stlport/            wince50standard-sh4-msvc2005/   
    default@                          linux-icc/                        solaris-cc-stlport/               wince50standard-sh4-msvc2008/   
    features/                         linux-icc-32/                     solaris-g++/                      wince50standard-x86-msvc2005/   
    freebsd-g++/                      linux-icc-64/                     solaris-g++-64/                   wince50standard-x86-msvc2008/   
    freebsd-g++34/                    linux-kcc/                        symbian/                          wince60standard-armv4i-msvc2005/
    freebsd-g++40/                    linux-llvm/                       symbian-abld/                     wince60standard-x86-msvc2005/   
    freebsd-icc/                      linux-lsb-g++/                    symbian-sbsv2/                    wincewm50pocket-msvc2005/       
    hpux-acc/                         linux-pgcc/                       tru64-cxx/                        wincewm50pocket-msvc2008/       
    hpux-acc-64/                      lynxos-g++/                       tru64-g++/                        wincewm50smart-msvc2005/        
    hpux-acc-o64/                     macx-g++/                         unixware-cc/                      wincewm50smart-msvc2008/        
    hpux-g++/                         macx-g++40/                       unixware-g++/                     wincewm60professional-msvc2005/ 
    hpux-g++-64/                      macx-g++42/                       unsupported/                      wincewm60professional-msvc2008/ 
    hpuxi-acc-32/                     macx-icc/                         win32-borland/                    wincewm60standard-msvc2005/     
    hpuxi-acc-64/                     macx-llvm/                        win32-g++/                        wincewm60standard-msvc2008/     
    hpuxi-g++-64/                     macx-pbuilder/                    win32-icc/                        wincewm65professional-msvc2005/ 
    hurd-g++/                         macx-xcode/                       win32-msvc2003/                   wincewm65professional-msvc2008/ 
    irix-cc/                          macx-xlc/                         win32-msvc2005/                                                   
    irix-cc-64/                       netbsd-g++/                       win32-msvc2008/                                                   
    irix-g++/                         openbsd-g++/                      win32-msvc2010/                                                   
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to link against a library (libcef_wrapper_dll.lib) that was built with the /MDd
I am getting the following linking error : libOpenSSL.lib(cryptlib.obj) : error LNK2001: unresolved external
I know that when linking to libraries such as jQuery that are hosted on
I'm using shared library with explicit linking (loading shared lib with dlopen ) in
What is the difference between linking to include files versus linking to lib files?
I'm new to VC++ and would like to know know how to link wsock32.lib
Is it possible to make a static linking (compilation) on Gtk(mm) program? I need
I am working in a project based on the lib cppunit, I need to
Linking a library with a project relative path in Visual studio 2008
In linking a sports event to two teams, at first this seemed to make

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.