Re: Do I Need To Link against libdispatch in a C++ program?
Re: Do I Need To Link against libdispatch in a C++ program?
- Subject: Re: Do I Need To Link against libdispatch in a C++ program?
- From: Jean-Daniel Dupas <email@hidden>
- Date: Tue, 28 Jan 2014 16:03:30 +0100
Le 28 janv. 2014 à 14:04, Andreas Grosam <email@hidden> a écrit :
> In a simple C++ console program, I get random crashes and weird behavior when including dispatch.h and executing dispatch functions, including weird dynamic linker errors.
>
> I feel a bit stupid, but it seems I need to link against libdispatch? I’ve never done that before in a C++ program and neither for a Cocoa/iOS app, assuming that clang would link against the system frameworks.
>
> I’m sure that it worked before - now I got really random crashes and dynamic linker errors.
>
> Perhaps this has something to do with this “Module” feature? It was set to “Enable Modules (C and Objective-C)”. I disabled it, but it didn’t change anything.
>
> When compiling as Objective-C++ (through changing the main.cpp to main.mm) it seems to work.
>
> This is Xcode 5.0.2 and Mac OS X 10.9.1
>
>
> Any help greatly appreciated!
It would be easier to help you if you tell us what the errors are.
Dynamic linker errors occurs at runtime, and result in a crash with an crash log and an error describing the issue.
Static linker errors occurs at "compile time", and are displayed in the compiler transcript.
Note that there is no libdispatch you can link against on OS X. dispatch functions are provided by the libSystem.
-- Jean-Daniel
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden