Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion Groups
General
GeneralPortable MacsHardwareNetworking
Applications
Mac ApplicationsEudoraFirefox / MozillaInternet ExplorerOutlook ExpressMS OfficeEntourageExcelPowerPointWordVirtual PCMedia PlayerOther MS Products
Programming
Mac ProgrammingCodeWarriorPerl
Country Specific
Australian Mac GroupUK Mac Group

Mac Forum / Programming / CodeWarrior / January 2004



Tip: Looking for answers? Try searching our database.

Sample Dynamic Library Project in CW8

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Jonathan Hoyle - 13 Jan 2004 22:37 GMT
I want to create a Mach-O dynamic library in CodeWarrior 8.3 (using
10.2.8), so I began by launching the sample projects found on the CW 8
Reference CD: Dynamic Library.mcp and Dynamic Library Test.mcp.  They
are simple enough projects, the Test app merely calling the dynamic
lib's function SayHello(), which in turn merely brings up a
NoteAlert() with the expected "Hello World, this is CodeWarrior!"

Both projects compile just fine, no errors, no link problems, nothing.
And the project runs fine when going through the debugger giving the
expected output.

However, if you just run the app (without the debugger), it simply
does nothing and immediately quits.

Since this is a CodeWarrior sample project, I assume that it is I and
not the sample project that is doing something wrong.  Yet all I did
was compile and run.  What am I doing wrong here?

Jonathan Hoyle
MW Ron - 14 Jan 2004 15:36 GMT
>I want to create a Mach-O dynamic library in CodeWarrior 8.3 (using
>10.2.8), so I began by launching the sample projects found on the CW 8
[quoted text clipped - 13 lines]
>not the sample project that is doing something wrong.  Yet all I did
>was compile and run.  What am I doing wrong here?

Hi Jon,

Well of course you should upgrade to CW 9 :)  what I'm thinking is just
it isn't finding the DLL because the current working directory isn't
correct,  It works for me but I do recall changing things in this before.

What is your install path set for in the targets runtime setting?  Is it
@executable_path/ if not that is the problem.

If this is the example straight off the CD I can take a look at it and
see if I can duplicate this.

Ron

Signature

Metrowerks, maker of CodeWarrior   -  "Software Starts Here"  
Ron Liechty - MWRon@metrowerks.com - <http://www.metrowerks.com>

Josef W. Wankerl - 14 Jan 2004 15:48 GMT
> I want to create a Mach-O dynamic library in CodeWarrior 8.3 (using
> 10.2.8), so I began by launching the sample projects found on the CW 8
[quoted text clipped - 9 lines]
> However, if you just run the app (without the debugger), it simply
> does nothing and immediately quits.

That's because the search path for the dylib is undefined.  When you run
from the debugger (or from the command line after a 'cd' to the sample
directory) then the current directory is set and the dylib can be found.  
When you just 'run', the current directory is undefined, thus the dylib
cannot be found.

You can fix this (and we did for the CW9 samples) by setting the Install
Path to @executable_path/ in the dylib's PPC Mac OS X Target panel.
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.