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

  • Home
  • SEARCH
  • 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 3442514
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T08:40:42+00:00 2026-05-18T08:40:42+00:00

So jenerally I have small C++ project based on OpenSource crossplatform libs. So it

  • 0

So jenerally I have small C++ project based on OpenSource crossplatform libs. So it probably would compile under linux. So I hited the point when I need to implement some defenatly platform specific class functions.

I have a class header with all functions declarations and cpp file with realisations. So first: how to declare my platform specific functions in header so when I’ll try to compile under linux it will not try to compile windows specific ones… and when on windows compiler will not try to compile linux functions include headers etc.

So for windows I need some how wrap such super specific functions

HRESULT EnumerateDevices(REFGUID category, IEnumMoniker **ppEnum)
void DisplayDeviceInformation(IEnumMoniker *pEnum)

And some headers

#include <windows.h>
#include <dshow.h>

#pragma comment(lib, "strmiids")

While for linux I have such headers

#include <unistd.h>
#include <fcntl.h>
#include <sys/ioctl.h>
#include <linux/videodev.h>

And I have function with name of void PrintCamerasList() which I wanna have one for bouth platfrms realisations for which I have seprate.

I hope you see what I need. So generally I need some example using my functions or once you can invent – let your imagination flow!)

So why do I need it all – I am creating some console app using OpenCV and I need to list user cameras names. OpenCV cannot do this on its own. so I asked how to do it for bouth platforms of my intrest – windows and linux

  • 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-18T08:40:42+00:00Added an answer on May 18, 2026 at 8:40 am

    Take a look at http://predef.sourceforge.net/ for an extensive list of pre-defined macros various compilers provide to distinguish between operating systems, compilers, and processor architectures. They will allow you to distinguish between more than just Win32 and Linux if necessary.

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

Sidebar

Related Questions

I have the feeling that Flash -based ( or Silverlight -based) websites are generally
I normally work on single threaded applications and have generally never really bothered with
I have found that there is generally a singe type or namespace that takes
Generally, MVC frameeworks have a structure that looks something like: /models /views /controllers /utils
Generally the database server is the biggest, most expensive box we have to buy
I'm using a logging module that can have reporting enabled/disabled at runtime. Calls generally
(This question specifically in C#, but applies generally to .NET) I have a largish
Generally when I use ClickOnce when I build a VB.NET program but it has
Generally, how bad of a performance hit is storing a file in a database
Generally, when using the conditional operator, here's the syntax: int x = 6; int

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.