• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Mac OS X and SunOS problems running files

 
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi, this is my first time posting here so any suggestions on improvement is greatly appreciated.

Now to my problem:

I have received a c++ program from a third-party company.
To compile it, they have included a Makefile with a couple of basic commands. Now my local computer that I'm working on is using "Mac OS X 10.6.5" and my server is running "SunOS 5.11 snv_111b i86pc i386 i86pc (from uname -a)".

I can run the make install command on my mac and move the files to the server computer but there I am unable to run the program. The error I'm getting is either "cannot execute binary file" or "cannot execute [Exec format error]" depending on which user ofc.

I've found a lot of people saying to test use the "ldd" command, I've tried that as well with "unsupported or unknown file type" as response.
Also tried the file command, in mac it returns: "Mach-O 64-bit executable x86_64" and on my SunOS server just "data".

I am unable to run the make install command on the server due to "make: Fatal error: Don't know how to make target".

I'm guessing that when I'm running the Makefile on my mac it compiles the program for mac somehow, but can't understand why I can't run the Makefile on the server.

I need to somehow either be able to compile it on the server or compile it for another os on my local computer?
An erorr I'm getting when trying to run the Makefile with a different command is: "sh: line 1: /usr/bin/g++: not found
*** Error code 127
".

I currently do not have the root password for the server.
I haven't been working with unix-based system very long.

*Edit*
To clearify what I'm wondering is,

Is it so that a Mach-O file is not supposed to be able to run on SunOS? Is it something I can easily change or does it have to be compiled on SunOS to be run on SunOS?
Do I need g++ to run a file compiled by it?
I can't find the g++ in the /bin/ on the server, does SunOS use that as standard or does it use something else?

Can I assume that if I'd told the server administrator to install g++ I'd be able to run the makefile compile the program and then I'd be able to run it? Or am I missing something completely here?

Also I'd like to get a greater understanding for how these things actually work.
 
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Markus Olsson wrote:I need to somehow either be able to compile it on the server or compile it for another os on my local computer?


Right. Compiling it on the server is probably easier (by far).

An erorr I'm getting when trying to run the Makefile with a different command is: "sh: line 1: /usr/bin/g++: not found
*** Error code 127
".


That means the GNU compiler isn't installed, or isn't in the expected location. I'm not familiar with SunOS 5.11, but you might check in /usr/sfw/bin and /usr/local/bin. If it's really not installed, you'll need to download and install gcc.
 
Markus Olsson
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I don't seem to have a /usr/local/ directory at all. And I found no g++ in the /usr/sfw/bin either.
I tried a "find ~ -type f | grep g++" and found nothing so I assume I don't have g++.
Is there any other standard compilations I can use instead? Or is installing g++ the only / best way to do this?

Thanks for the quick response!
 
Jason Cone
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Markus Olsson wrote:Is it so that a Mach-O file is not supposed to be able to run on SunOS?


You can only run a compiled program on the architecture for which it is compiled.

Is it something I can easily change or does it have to be compiled on SunOS to be run on SunOS?


You can't change it; you need to compile it for SunOS and that particular architecture.

Do I need g++ to run a file compiled by it?


No.

Can I assume that if I'd told the server administrator to install g++ I'd be able to run the makefile compile the program and then I'd be able to run it? Or am I missing something completely here?


If gcc/g++ is installed you should be able to run the makefile and compile the program. You might need to tweak some of the makefile options (like path locations) if they are different from those on the computer you're compiling on.
 
Jason Cone
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Markus Olsson wrote:Is there any other standard compilations I can use instead? Or is installing g++ the only / best way to do this?


Installing gcc/g++ is probably your best bet.
 
Markus Olsson
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks Jason for all those good and quick replies!
You've been of great assistance.
Regards,
Markus
 
Jason Cone
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Markus Olsson wrote:Thanks Jason for all those good and quick replies!
You've been of great assistance.
Regards,
Markus


You're welcome. Good luck!
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic