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 7171517
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T15:25:47+00:00 2026-05-28T15:25:47+00:00

I created a C++ shared library project in Ubuntu with compiler g++ 4.6 .

  • 0

I created a C++ shared library project in Ubuntu with compiler g++ 4.6.
Some of the dependency libraries expects some preprocessor commands about compiler and operating system to properly compile, like

#elif defined(__GNUC__) || defined(__llvm__) || defined(__clang__)

However Eclipse doesn’t define them automatically (at least the version I’m using), is there a setting or option in Eclipse which does this for me ?

  • 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-28T15:25:48+00:00Added an answer on May 28, 2026 at 3:25 pm

    You can set preprocessor defines in the project properties: project properties.

    However, in your case, I wouldn’t use these, as they shouldn’t be project specific (due to them being compiler specific). I actually think you’re looking for these. I’m not sure for llvm/clang (there are ones, but I don’t remember them right now), but for GCC you should use the macro __GNUC__ which will be defined by the compiler itself, without you having to worry about it. The leading underscores tell you, that they aren’t part of the standard and not necessarily defined when using another compiler (e.g. MSVC).


    For cross platform usage of vsprintf_s:

    // this will be set on Visual Studio only, so this code is added for all other compilers
    #ifndef _MSC_VER
    #define vsprintf_s(b,l,f,v) vsprintf(b,f,v);
    #endif
    

    But in general, try to use functions that are available on all platforms (for this example, in this case use vsnprintf() instead).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am not able to build shared library with static libraries. I downloaded some
I have a Class Library project which houses some shared code between other projects
I have created a multi module maven project. Now I have shared the project
I created a very simple WCF class library and added this project to the
I have a shared library say libeval.so. I am using this in my project
To share some code between projects I created a new eclipse project marking it
Assuming I have a shared activity class defined in a Library project, which does
I'd like to build both static and shared libraries in a project. I know
The way my team's project is developed, we generate a Shared Object library for
Okay I have a project that is using the android-rss library (org.mcsoxford.rss). I created

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.