Import framework with define

Hi,
Im trying to import a framework. I get an error

E:                Error token! [/Users/JohnMoshakis/Documents/develop/Nougat/ImportSolution/CocoaLumberjack/Debug/CocoaLumberjack.framework/Headers/DDLegacyMacros.h (23)]

which points to

#if DD_LEGACY_MACROS

#warning CocoaLumberjack 1.9.x legacy macros enabled. \
Disable legacy macros by importing CocoaLumberjack.h or DDLogMacros.h instead of DDLog.h or add `#define DD_LEGACY_MACROS 0` before importing DDLog.h.

I should be able to ignore that by defining DD_LEGACY_MACROS as 0

The docs say that conditional defines are c style and can be name value pairs separated by a ;

My elements file looks like this

<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="4.0">
  <PropertyGroup>
    <ProjectGuid>{1FCB86E2-697B-4BE2-BBA9-2129A5A22A01}</ProjectGuid>
    <OutputType>Import</OutputType>
    <RootNamespace>CocoaLumberjack</RootNamespace>
    <Configuration Condition="'$(Configuration)' == ''">Release</Configuration>
    <Mode>Toffee</Mode>
    <SDK>macOS</SDK>
    <DefaultUses>RemObjects.Elements.RTL</DefaultUses>
    <ConditionalDefines>DD_LEGACY_MACROS=0</ConditionalDefines>
    <ImportForceIncludes>import.h</ImportForceIncludes>
  </PropertyGroup>
  <PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">
    <OutputPath>.\Bin\Debug</OutputPath>
    <EnableAsserts>True</EnableAsserts>
    <Optimize>False</Optimize>
    <GenerateDebugInfo>True</GenerateDebugInfo>
    <ConditionalDefines>DEBUG;TRACE;DD_LEGACY_MACROS=0;</ConditionalDefines>
  </PropertyGroup>
  <PropertyGroup Condition=" '$(Configuration)' == 'Release' ">
    <OutputPath>.\Bin\Release</OutputPath>
    <ConditionalDefines>DD_LEGACY_MACROS=0;</ConditionalDefines>
  </PropertyGroup>
  <ItemGroup>
    <Reference Include="#" />
    <Reference Include="libElements" />
  </ItemGroup>
  <ItemGroup>
    <ImportHeader Include="Import.h" />
    <ImportFramework Include="Debug\CocoaLumberjack.framework" />
  </ItemGroup>
  <Import Project="$(MSBuildExtensionsPath)\RemObjects Software\Elements\RemObjects.Elements.targets" />
</Project>

Is that correct ? The build still complains about the error token !

Cheers,
John

But who does define DD_LEGACY_MACROS, and could that be happening in a place that overrides your global define? e.g. if this file had #define DD_LEGACY_MACROS further up, or #included a file that did, then your global attempt to “undefine” it is futile, because you’re just undermining something that wasn’t defined yet anyways.

can I see a complete test-case, ie the .framework and the import project?

CocoaLumberjack.zip (872.7 KB)

FWIW, the real bug her probably is the line break:

#warning CocoaLumberjack 1.9.x legacy macros enabled. \
Disable legacy macros by importing CocoaLumberjack.h or DDLogMacros.h instead of DDLog.h or add `#define DD_LEGACY_MACROS 0` before importing DDLog.h.

Logged as bugs://E25978.

bugs://E25978 was closed as fixed.