Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   C++ (http://www.velocityreviews.com/forums/f39-c.html)
-   -   osx framework <> linux libs (http://www.velocityreviews.com/forums/t754685-osx-framework-linux-libs.html)

Michael 10-07-2011 08:54 AM

osx framework <> linux libs
 
Hi
I try to compile a OSX project on Linux. I get:

int sflags = fcntl( sock, F_GETFL );
Error:‘F_GETFL’ was not declared in this scope

etc. lots of those. Now this is because the author
has used libcurl framework on OSX? Because this is
different to libcurl libs on Linux? What to do or
how to declare F-GETFL etc.

Many thanks
Michael

Nick Keighley 10-07-2011 10:52 AM

Re: osx framework <> linux libs
 
On Oct 7, 9:54*am, Michael <Mich...@jerk.com> wrote:

> I try to compile a OSX project on Linux.


OSX != Linux

> get:
> * * * * * * * * int sflags = fcntl( sock, F_GETFL );
> Error: F_GETFL was not declared in this scope


you probably missed out a header that's needed on Linux. RTFM. Have
you tried

#include <fcntrl.h>

> etc. lots of those. Now this is because the author
> has used libcurl framework on OSX? Because this is
> different to libcurl libs on Linux? What to do or
> how to declare F-GETFL etc.


Michael 10-07-2011 11:15 AM

Re: osx framework <> linux libs
 

>
> you probably missed out a header that's needed on Linux. RTFM. Have
> you tried
>
> #include<fcntrl.h>


Yes that helped but still I get:

79: error: ‘EBADF’ was not declared in this scope
p:182: error: ‘ENOTSOCK’ was not declared in this scope
ror: ‘EOPNOTSUPP’ was not declared in this scope
rror: ‘EFAULT’ was not declared in this scope
p:191: error: ‘EWOULDBLOCK’ was not declared in this scope
error: ‘EMFILE’ was not declared in this scope
cpp:197: error: ‘ENFILE’ was not declared in this scope

What more headers do I need?
Thanks

PS: I tried those without success:
//#include <sys/types.h>
//#include <sys/socket.h>

Jorgen Grahn 10-07-2011 11:15 AM

Re: osx framework <> linux libs
 
On Fri, 2011-10-07, Nick Keighley wrote:
> On Oct 7, 9:54*am, Michael <Mich...@jerk.com> wrote:
>
>> I try to compile a OSX project on Linux.

>
> OSX != Linux
>
>> get:
>> * * * * * * * * int sflags = fcntl( sock, F_GETFL );
>> Error: F_GETFL was not declared in this scope

>
> you probably missed out a header that's needed on Linux. RTFM. Have
> you tried
>
> #include <fcntrl.h>


You mean fcntl.h. More generally, he can

% find /usr/share/man -name '*.2*' | xargs zgrep F_GETFL

and check what include file the man page says you should use.

For further questions, try a Unix or Linux group -- POSIX APIs are
offtopic here.

/Jorgen

--
// Jorgen Grahn <grahn@ Oo o. . .
\X/ snipabacken.se> O o .

Michael 10-07-2011 01:02 PM

Re: osx framework <> linux libs
 
Now i get tons of errors (~1000) alike:
r:undefined reference to `fopen'

but I've:
#include <stdio.h>

even such errors where no such functions occur!

How should i proceed with such?
Thanks


Alain Ketterlin 10-07-2011 02:16 PM

Re: osx framework <> linux libs
 
Michael <Michael@jerk.com> writes:

> Now i get tons of errors (~1000) alike:
> r:undefined reference to `fopen'
>
> but I've:
> #include <stdio.h>


Both facts are unrelated. The error message is from the linker, not the
compiler. There is something seriously wrong in how you compile.

> How should i proceed with such?


Wrong place, this group is about c++. Please find an appropriate forum.

-- Alain.


All times are GMT. The time now is 04:53 PM.

Powered by vBulletin®. Copyright ©2000 - 2013, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.


1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57