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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T10:06:24+00:00 2026-06-12T10:06:24+00:00

I am working on a cross platform c++ app. On the mac version I

  • 0

I am working on a cross platform c++ app. On the mac version I need to use a little bit of cocoa in obj-c. So I have made a class called OSXSpecifics and it has the .mm file extension and a c++ header like the rest of the app.

std::string OSXSpecifics::GetOSXFilePath(const char *name, const char *type) {
return [[[NSBundle mainBundle] pathForResource:[NSString stringWithUTF8String: name]
                                        ofType:[NSString stringWithUTF8String: type]] UTF8String];

}

The above code works absolutely perfect. A c++ function in a c++ class with objective-c inside the function. But when I do this:

void OSXSpecifics::printToConsole(<#const char *text#>) {
NSString *Text = [NSString stringWithUTF8String: text];

}

I get a couple of errors. Mainly: variable has incomplete type 'void. I also get expected primary expression before '<'token. And also of interest: expected ';' after top level declarator.
This is the header file for the class:

#ifndef OSXSPECIFICS_h
#define OSXSPECIFICS_h

#include <string.h>

class OSXSpecifics
{
public:
    static std::string GetOSXFilePath(const char* name, const char* type);
    static void printToConsole(const char* text);
};

#endif // OSXSPECIFICS_h

Any idea’s why xcode is freaking out about c++ and objective c mixing?

  • 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-06-12T10:06:25+00:00Added an answer on June 12, 2026 at 10:06 am

    I think <#const char *text#> should be const char *text.

    The <# and #> were put there by Xcode’s autocomplete system and should be removed.

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

Sidebar

Related Questions

I'm currently working on a cross-platform mobile app and have gone through the process
I'm working on a cross platform C++ application for Windows, Mac OS X and
If I'm working on a cross-platform project that uses dbus-java, what do I need
I need a cross-platform way to get the current working directory (yes, getcwd does
I'm working on a cross-platform Firebreath plugin which is crashing on Windows. I use
I am working on a cross platform that needs to use a database to
I'm working on some cross-platform desktop application with heavy 2-D graphics. I use OpenGL
I'm working on some cross-platform code using OpenGL and SDL, but have immediately run
I'm working on a cross-platform Qt application and the paths are different on Mac
I am working on a small cross platform product for Windows and Mac written

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.