<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: CodeWarrior linking issue in Archicad C++ API</title>
    <link>https://community.graphisoft.com/t5/Archicad-C-API/CodeWarrior-linking-issue/m-p/94798#M7934</link>
    <description>&lt;BLOCKQUOTE&gt;Akos wrote:&lt;BR /&gt;CFURLRef cfurl = CFURLCreateWithBytes (kCFAllocatorDefault, reinterpret_cast&amp;lt;const UInt8*&amp;gt; (static_cast&amp;lt;const UniChar*&amp;gt; (url.ToUStr ())), url.GetLength () * sizeof(UniChar), kCFStringEncodingUnicode, NULL);&lt;/BLOCKQUOTE&gt;

Of course!  Why didn't I think of that!  &lt;IMG src="https://community.graphisoft.com/legacyfs/online/emojis/icon_biggrin.gif" style="display : inline;" /&gt;  &lt;IMG src="https://community.graphisoft.com/legacyfs/online/emojis/icon_rolleyes.gif" style="display : inline;" /&gt;  &lt;IMG src="https://community.graphisoft.com/legacyfs/online/emojis/icon_biggrin.gif" style="display : inline;" /&gt;  &lt;IMG src="https://community.graphisoft.com/legacyfs/online/emojis/icon_rolleyes.gif" style="display : inline;" /&gt;  &lt;IMG src="https://community.graphisoft.com/legacyfs/online/emojis/icon_biggrin.gif" style="display : inline;" /&gt; &lt;BR /&gt;
&lt;BR /&gt;
Karl</description>
    <pubDate>Mon, 17 Jan 2005 20:03:56 GMT</pubDate>
    <dc:creator>Karl Ottenstein</dc:creator>
    <dc:date>2005-01-17T20:03:56Z</dc:date>
    <item>
      <title>CodeWarrior linking issue</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/CodeWarrior-linking-issue/m-p/94796#M7932</link>
      <description>&lt;DIV class="actalk-migrated-content"&gt;Hello All,&lt;BR /&gt;&lt;BR /&gt;I am very newbie on a Mac platform and CodeWarrior compiler.&lt;BR /&gt;CW just arrived yeaterday. Though I have coped and have&lt;BR /&gt;compiled one of my projects to try ( and it works ) but I can not&lt;BR /&gt;understand a linker issue. ( API 6.1 )&lt;BR /&gt;&lt;BR /&gt;I actively use STL. At linking I got one error like this:&lt;BR /&gt;Link Error: undefined std::tr1::detail::shared_ptr_deleter_common.....&lt;BR /&gt;&lt;BR /&gt;If I add the MSL_C++_PPC.Lib library the error gone, however then I&lt;BR /&gt;got numerous warnings like:&lt;BR /&gt;Link Warning: ignored std::clog (data) in MSL_C++_PPC.Lib&lt;BR /&gt;Previouly defined in GSCppRuntimeLib&lt;BR /&gt;&lt;BR /&gt;As it is warnings the Addon is linked and works (not tested), but I am&lt;BR /&gt;not sure that it is correct. Except for that I have same warnings about&lt;BR /&gt;GS::GSException::__vt from GeometryLib and GSRootLib&lt;BR /&gt;( by the way the warnings exist if compile API Geometry_Test example&lt;BR /&gt;too ).&lt;BR /&gt;&lt;BR /&gt;Anybody can direct me for a right way or explain linking and library&lt;BR /&gt;nuances.&lt;BR /&gt;May be any options of the compiler, the link order, added libraries or&lt;BR /&gt;may be it is usual stuff and is not "dangerous".&lt;BR /&gt;I remember Ralph Wessel told about necessity to recompile MSL. I yet&lt;BR /&gt;have not do it.&lt;BR /&gt;&lt;BR /&gt;PS: And one another Mac specific question.&lt;BR /&gt;What function will open some page on default web browser like&lt;BR /&gt;ShellExecute on Windows.&lt;/DIV&gt;</description>
      <pubDate>Tue, 13 Dec 2022 21:28:35 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/CodeWarrior-linking-issue/m-p/94796#M7932</guid>
      <dc:creator>Oleg</dc:creator>
      <dc:date>2022-12-13T21:28:35Z</dc:date>
    </item>
    <item>
      <title>Re: CodeWarrior linking issue</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/CodeWarrior-linking-issue/m-p/94797#M7933</link>
      <description>&lt;BLOCKQUOTE&gt;Oleg wrote:&lt;BR /&gt;I actively use STL. At linking I got one error like this:&lt;BR /&gt;
Link Error: undefined std::tr1::detail::shared_ptr_deleter_common.....&lt;BR /&gt;
&lt;BR /&gt;
If I add the MSL_C++_PPC.Lib library the error gone, however then I&lt;BR /&gt;
got numerous warnings like:&lt;BR /&gt;
Link Warning: ignored std::clog (data) in MSL_C++_PPC.Lib&lt;BR /&gt;
Previouly defined in GSCppRuntimeLib
&lt;/BLOCKQUOTE&gt;

Hi Oleg,&lt;BR /&gt;
&lt;BR /&gt;
This is a serious issue you bumped into. Basically, you'll have to use the headers which came with CodeWarrior 8 to get STL link correctly. Metrowerks will send you the CW 8 CD for free if you own CW 9, just send a letter to &lt;A href="mailto: MWRon@metrowerks.com"&gt;MWRon@metrowerks.com&lt;/A&gt;. After you install the old version, update it to 8.3 through the web.&lt;BR /&gt;
&lt;BR /&gt;
The problem was that ArchiCAD 9 was compiled with MWerks compiler from the CW 9 package, whereas the headers and runtime libraries were from the CW 8.3 package, so you'll have to use the same files. Unfortunately, we cannot redistribute the CW 8.3 headers &lt;IMG src="https://community.graphisoft.com/legacyfs/online/emojis/icon_sad.gif" style="display : inline;" /&gt;&lt;BR /&gt;
&lt;BR /&gt;
Also, when you compile your project with STL, specify the following in the C/C++ Preprocess pane:&lt;BR /&gt;

&lt;PRE&gt;#define _MSL_NO_LOCALE
#define _MSL_MULTITHREAD
#define TARGET_API_MAC_CARBON 1&lt;/PRE&gt;

That would solve the STL compilation and linking issue.&lt;BR /&gt;
&lt;BR /&gt;

&lt;BLOCKQUOTE&gt;Oleg wrote:&lt;BR /&gt;PS: And one another Mac specific question.&lt;BR /&gt;
What function will open some page on default web browser like&lt;BR /&gt;
ShellExecute on Windows.&lt;/BLOCKQUOTE&gt;

Here you go. The parameter is a unicode string.&lt;BR /&gt;

&lt;PRE&gt;bool	RunBrowser (const GS::UniString&amp;amp; url)
{
	CFURLRef cfurl = CFURLCreateWithBytes (kCFAllocatorDefault, reinterpret_cast&amp;lt;const UInt8*&amp;gt; (static_cast&amp;lt;const UniChar*&amp;gt; (url.ToUStr ())), url.GetLength () * sizeof(UniChar), kCFStringEncodingUnicode, NULL);
	OSStatus status = ::LSOpenCFURLRef (cfurl, NULL);
	CFRelease (cfurl);

	return (status == noErr);
}
&lt;/PRE&gt;

HTH,&lt;BR /&gt;
&lt;BR /&gt;
Akos</description>
      <pubDate>Mon, 17 Jan 2005 10:24:12 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/CodeWarrior-linking-issue/m-p/94797#M7933</guid>
      <dc:creator>Akos Somorjai</dc:creator>
      <dc:date>2005-01-17T10:24:12Z</dc:date>
    </item>
    <item>
      <title>Re: CodeWarrior linking issue</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/CodeWarrior-linking-issue/m-p/94798#M7934</link>
      <description>&lt;BLOCKQUOTE&gt;Akos wrote:&lt;BR /&gt;CFURLRef cfurl = CFURLCreateWithBytes (kCFAllocatorDefault, reinterpret_cast&amp;lt;const UInt8*&amp;gt; (static_cast&amp;lt;const UniChar*&amp;gt; (url.ToUStr ())), url.GetLength () * sizeof(UniChar), kCFStringEncodingUnicode, NULL);&lt;/BLOCKQUOTE&gt;

Of course!  Why didn't I think of that!  &lt;IMG src="https://community.graphisoft.com/legacyfs/online/emojis/icon_biggrin.gif" style="display : inline;" /&gt;  &lt;IMG src="https://community.graphisoft.com/legacyfs/online/emojis/icon_rolleyes.gif" style="display : inline;" /&gt;  &lt;IMG src="https://community.graphisoft.com/legacyfs/online/emojis/icon_biggrin.gif" style="display : inline;" /&gt;  &lt;IMG src="https://community.graphisoft.com/legacyfs/online/emojis/icon_rolleyes.gif" style="display : inline;" /&gt;  &lt;IMG src="https://community.graphisoft.com/legacyfs/online/emojis/icon_biggrin.gif" style="display : inline;" /&gt; &lt;BR /&gt;
&lt;BR /&gt;
Karl</description>
      <pubDate>Mon, 17 Jan 2005 20:03:56 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/CodeWarrior-linking-issue/m-p/94798#M7934</guid>
      <dc:creator>Karl Ottenstein</dc:creator>
      <dc:date>2005-01-17T20:03:56Z</dc:date>
    </item>
    <item>
      <title>Re: CodeWarrior linking issue</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/CodeWarrior-linking-issue/m-p/94799#M7935</link>
      <description>&lt;BLOCKQUOTE&gt;Why didn't I think of that!&lt;/BLOCKQUOTE&gt;

Wow, I must really be off today. I didn't think of that either!</description>
      <pubDate>Mon, 17 Jan 2005 20:47:11 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/CodeWarrior-linking-issue/m-p/94799#M7935</guid>
      <dc:creator>TomWaltz</dc:creator>
      <dc:date>2005-01-17T20:47:11Z</dc:date>
    </item>
    <item>
      <title>Re: CodeWarrior linking issue</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/CodeWarrior-linking-issue/m-p/94800#M7936</link>
      <description>&lt;BLOCKQUOTE&gt;Akos wrote:&lt;BR /&gt;
This is a serious issue you bumped into.&lt;BR /&gt;
Akos&lt;/BLOCKQUOTE&gt;

Thanks Akos.&lt;BR /&gt;
&lt;BR /&gt;
Bad news  &lt;IMG src="https://community.graphisoft.com/legacyfs/online/emojis/icon_cry.gif" style="display : inline;" /&gt; . I own CW 9.0 and I shall write to the email for the 8.0 CD. However it is so long while it will arrive to Russia. I shall experiment more. As STL basically inlined I think the reason is std::string.&lt;BR /&gt;
May be i will try remove std::string from projects or I shall try to play with STLPort if it will compile on CW9 (I did not try, just idea). Actually my two projects work, but my doubts have remained.&lt;BR /&gt;
&lt;BR /&gt;
PS: Also thank you for the LSOpenCFURLRef. I have found it already earlier an my code is same except I used ASCII string. It works.</description>
      <pubDate>Mon, 17 Jan 2005 21:13:23 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/CodeWarrior-linking-issue/m-p/94800#M7936</guid>
      <dc:creator>Oleg</dc:creator>
      <dc:date>2005-01-17T21:13:23Z</dc:date>
    </item>
    <item>
      <title>Re: CodeWarrior linking issue</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/CodeWarrior-linking-issue/m-p/94801#M7937</link>
      <description>To finish the thread by happyend.&lt;BR /&gt;
Ron from Metrowerks was so kind and has sent me the headers I was required. Now I have linked it without warnings.&lt;BR /&gt;
( Except duplication of GS:: Exception::vt in GSGeometry and GSRootLib, but API example has the same warnings, I think it is OK )&lt;BR /&gt;
&lt;BR /&gt;
Akos thank you again for the support.</description>
      <pubDate>Wed, 19 Jan 2005 08:08:24 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/CodeWarrior-linking-issue/m-p/94801#M7937</guid>
      <dc:creator>Oleg</dc:creator>
      <dc:date>2005-01-19T08:08:24Z</dc:date>
    </item>
    <item>
      <title>Re: CodeWarrior linking issue</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/CodeWarrior-linking-issue/m-p/94802#M7938</link>
      <description>&lt;BLOCKQUOTE&gt;Oleg wrote:&lt;BR /&gt;To finish the thread by happyend.&lt;BR /&gt;
Ron from Metrowerks was so kind and has sent me the headers I was required. Now I have linked it without warnings.&lt;BR /&gt;
( Except duplication of GS:: Exception::vt in GSGeometry and GSRootLib, but API example has the same warnings, I think it is OK )&lt;BR /&gt;
&lt;BR /&gt;
Akos thank you again for the support.&lt;/BLOCKQUOTE&gt;

MWRon is one of the best support person in the world. We are also getting great support from him.&lt;BR /&gt;
&lt;BR /&gt;
The warnings come because the virtual destructor of the GS::Exception class is implemented as an inline function. It didn't cause any problems so far, so I think you dont' have to worry about that.&lt;BR /&gt;
&lt;BR /&gt;
You're welcome...&lt;BR /&gt;
&lt;BR /&gt;
Akos</description>
      <pubDate>Mon, 24 Jan 2005 08:26:38 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/CodeWarrior-linking-issue/m-p/94802#M7938</guid>
      <dc:creator>Akos Somorjai</dc:creator>
      <dc:date>2005-01-24T08:26:38Z</dc:date>
    </item>
    <item>
      <title>Re: CodeWarrior linking issue</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/CodeWarrior-linking-issue/m-p/94803#M7939</link>
      <description>&lt;BLOCKQUOTE&gt;Oleg wrote:&lt;BR /&gt;I actively use STL. At linking I got one error like this:&lt;BR /&gt;
Link Error: undefined std::tr1::detail::shared_ptr_deleter_common.....&lt;BR /&gt;
&lt;BR /&gt;
If I add the MSL_C++_PPC.Lib library the error gone, however then I&lt;BR /&gt;
got numerous warnings like:&lt;BR /&gt;
Link Warning: ignored std::clog (data) in MSL_C++_PPC.Lib&lt;BR /&gt;
Previouly defined in GSCppRuntimeLib
&lt;/BLOCKQUOTE&gt;

&lt;BR /&gt;
Oleg,&lt;BR /&gt;
&lt;BR /&gt;
Sorry, I haven't been following ACTalk for a while and missed this. It seems you already have a solution - which is great - but I may as well add my solution to the discussion.&lt;BR /&gt;
&lt;BR /&gt;
I don't use the GS Runtime libs at all in my projects. My understanding is that they are simply a recompilation of the standard MSL library (MSL_All_Carbon.Lib) with the appropriate settings for an ArchiCAD add-on, e.g. 'enums always int' set. I rebuilt them myself and use all the latest headers etc provided with CW 9. I get no warnings in compilation or linking.&lt;BR /&gt;
&lt;BR /&gt;
I would be interested to know if Akos has any comments on this approach.</description>
      <pubDate>Wed, 09 Feb 2005 10:15:01 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/CodeWarrior-linking-issue/m-p/94803#M7939</guid>
      <dc:creator>Ralph Wessel</dc:creator>
      <dc:date>2005-02-09T10:15:01Z</dc:date>
    </item>
    <item>
      <title>Re: CodeWarrior linking issue</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/CodeWarrior-linking-issue/m-p/94804#M7940</link>
      <description>&lt;BLOCKQUOTE&gt;Ralph wrote:&lt;BR /&gt;I don't use the GS Runtime libs at all in my projects. My understanding is that they are simply a recompilation of the standard MSL library (MSL_All_Carbon.Lib) with the appropriate settings for an ArchiCAD add-on, e.g. 'enums always int' set. I rebuilt them myself and use all the latest headers etc provided with CW 9. I get no warnings in compilation or linking.&lt;BR /&gt;
&lt;BR /&gt;
I would be interested to know if Akos has any comments on this approach.&lt;/BLOCKQUOTE&gt;

Yes, you are safe. I would still recommend using the same environment, i.e. compile the MSL headers with:
&lt;PRE&gt;#define _MSL_NO_LOCALE 
#define _MSL_MULTITHREAD 
#define TARGET_API_MAC_CARBON 1&lt;/PRE&gt;

Another issue which you might bump into is the newline character problem ('\r' vs '\n'). Coming from the old Mac OS 9 world ArchiCAD still has some places where line ends matter. CW9 has the 'MPW newline' flag removed, which might crash our code, hence we sticked with the 8.3 headers.&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
We'll clean up this issue in the next major version.&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
HTH,&lt;BR /&gt;
&lt;BR /&gt;
Akos</description>
      <pubDate>Mon, 14 Feb 2005 21:17:33 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/CodeWarrior-linking-issue/m-p/94804#M7940</guid>
      <dc:creator>Akos Somorjai</dc:creator>
      <dc:date>2005-02-14T21:17:33Z</dc:date>
    </item>
  </channel>
</rss>

