Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   C Programming (http://www.velocityreviews.com/forums/f42-c-programming.html)
-   -   Makefile Linux (http://www.velocityreviews.com/forums/t947007-makefile-linux.html)

Barry 06-12-2012 10:32 PM

Makefile Linux
 
Who can help me with creating a makefile for Linux (ubuntu 10.04.3) it
is not a big program but cross-platform. I am not a programmer I have
tried Cmake but without success.
I want to bring a few changes in the source code text output and compile
many thanks if you can help me.

please mail me and i give you a link to the source code.
p.s remove nospam in email ;-)

David RF 06-13-2012 08:08 AM

Re: Makefile Linux
 
On 13 jun, 00:32, Barry <b_van_den_...@nospamhotmail.com> wrote:
> Who can help me with creating a makefile for Linux (ubuntu 10.04.3) it
> is not a big program but cross-platform. I am not a programmer I have
> tried Cmake but without success.
> I want to bring a few changes in the source code text output and compile
> many thanks if you can help me.
>
> please mail me and i give you a link to the source code.
> p.s remove nospam in email ;-)


GNU Libtool and automake?

http://en.wikipedia.org/wiki/Libtool

James Kuyper 06-13-2012 11:02 AM

Re: Makefile Linux
 
On 06/12/2012 06:32 PM, Barry wrote:
> Who can help me with creating a makefile for Linux (ubuntu 10.04.3) it
> is not a big program but cross-platform. I am not a programmer I have
> tried Cmake but without success.


I'm not familiar with Cmake, but a quick look at cmake.org suggests that
it creates make files for you. Have you tried using "make" with a
manually-created make file? I won't claim that make file syntax is easy,
but it's not horribly complicated, either.

Neither "Cmake" nor "make" are part of C, but "make" is part of Unix, so
you're likely to get better answers to your question on
comp.unix.programmer. You could also try
<http://www.cmake.org/cmake/help/help.html>

No matter where you post your question, I recommend being a lot more
specific about your problem. It's trivial to create a make file. Since
make is normally configured to implement a lot of useful default rules,
you can even use make with an empty make file (or equivalently, with no
make file at all). I do this quite frequently. The thing that can get
tricky is trying to do some particular thing with a make file, and you
need to explain what that particular thing is before anyone can help you
do it. In particular, you should go into detail explaining how your
attempt to use Cmake failed.
--
James Kuyper

Barry 06-13-2012 12:36 PM

Re: Makefile Linux
 
Op 13-6-2012 13:02, James Kuyper schreef:
> On 06/12/2012 06:32 PM, Barry wrote:
>> Who can help me with creating a makefile for Linux (ubuntu 10.04.3) it
>> is not a big program but cross-platform. I am not a programmer I have
>> tried Cmake but without success.

>
> I'm not familiar with Cmake, but a quick look at cmake.org suggests that
> it creates make files for you. Have you tried using "make" with a
> manually-created make file? I won't claim that make file syntax is easy,
> but it's not horribly complicated, either.
>
> Neither "Cmake" nor "make" are part of C, but "make" is part of Unix, so
> you're likely to get better answers to your question on
> comp.unix.programmer. You could also try
> <http://www.cmake.org/cmake/help/help.html>
>
> No matter where you post your question, I recommend being a lot more
> specific about your problem. It's trivial to create a make file. Since
> make is normally configured to implement a lot of useful default rules,
> you can even use make with an empty make file (or equivalently, with no
> make file at all). I do this quite frequently. The thing that can get
> tricky is trying to do some particular thing with a make file, and you
> need to explain what that particular thing is before anyone can help you
> do it. In particular, you should go into detail explaining how your
> attempt to use Cmake failed.


It's hard to explain but I think the problem lies in #ifdef isunix
#endif statement.
maybe if you see the source code that a makes a lot clear.
here is the link:
http://members.chello.nl/~b.vandenbos/source.zip


I also added to the CMakeLists.txt
I would very happy if I have a working makefile.
And thanks for your response.

Barry

James Kuyper 06-13-2012 01:36 PM

Re: Makefile Linux
 
On 06/13/2012 08:36 AM, Barry wrote:
....
> It's hard to explain but I think the problem lies in #ifdef isunix
> #endif statement.


You misunderstand. That's a diagnosis. By definition, if you're looking
for other people's help, your diagnosis is, at best, unreliable, and
more likely completely worthless. When asking for other people's help,
the most important information you need to give them are the symptoms,
not your diagnosis. What did you try to do? What precisely happened when
you tried it? In particular, the full text of any error or warning
messages that you observed would be very helpful.

By the way, do you expect 'isunix' to be defined? If so, why? I'm not
saying it won't be, just that I need to know your reasons for expecting
it to be. It's not mentioned in the Unix standard. As far as the C
standard is concerned, it's a name reserved for developers, so a
conforming implementation is not allowed to pre-define it. It's not
#defined anywhere in your code. Therefore, it would have to be set
somewhere else. Adding -Disunix to your command line will predefine it
on all of the compilers I'm familiar with, but the syntax may be
different on other compilers.

If that is part of your issue, comp.unix.programmer is definitely a
better place to go with your questions.
--
James Kuyper

Barry 06-13-2012 03:17 PM

Re: Makefile Linux
 
Op 13-6-2012 15:36, James Kuyper schreef:
> On 06/13/2012 08:36 AM, Barry wrote:
> ...
>> It's hard to explain but I think the problem lies in #ifdef isunix
>> #endif statement.

>
> You misunderstand. That's a diagnosis. By definition, if you're looking
> for other people's help, your diagnosis is, at best, unreliable, and
> more likely completely worthless. When asking for other people's help,
> the most important information you need to give them are the symptoms,
> not your diagnosis. What did you try to do? What precisely happened when
> you tried it? In particular, the full text of any error or warning
> messages that you observed would be very helpful.
>
> By the way, do you expect 'isunix' to be defined? If so, why? I'm not
> saying it won't be, just that I need to know your reasons for expecting
> it to be. It's not mentioned in the Unix standard. As far as the C
> standard is concerned, it's a name reserved for developers, so a
> conforming implementation is not allowed to pre-define it. It's not
> #defined anywhere in your code. Therefore, it would have to be set
> somewhere else. Adding -Disunix to your command line will predefine it
> on all of the compilers I'm familiar with, but the syntax may be
> different on other compilers.
>
> If that is part of your issue, comp.unix.programmer is definitely a
> better place to go with your questions.


this is what i get when i run make.


[ 0%] Building C object CMakeFiles/dnewsweb.dir/dnewsweb.c.o
/home/barry/dw2/dnewsweb.c: In function âmainâ:
/home/barry/dw2/dnewsweb.c:607: warning: implicit declaration of
function âputenvâ
/home/barry/dw2/dnewsweb.c:645: error: âenvironâ undeclared (first use
in this function)
/home/barry/dw2/dnewsweb.c:645: error: (Each undeclared identifier is
reported only once
/home/barry/dw2/dnewsweb.c:645: error: for each function it appears in.)
/home/barry/dw2/dnewsweb.c:685: warning: implicit declaration of
function âini_trueâ
/home/barry/dw2/dnewsweb.c:790: warning: implicit declaration of
function âispressedâ
/home/barry/dw2/dnewsweb.c:881: warning: implicit declaration of
function âlog_useâ
/home/barry/dw2/dnewsweb.c: In function âlog_useâ:
/home/barry/dw2/dnewsweb.c:908: warning: implicit declaration of
function âgetpidâ
/home/barry/dw2/dnewsweb.c:908: warning: format â%dâ expects type âintâ,
but argument 3 has type âtime_tâ
/home/barry/dw2/dnewsweb.c: In function âset_utagâ:
/home/barry/dw2/dnewsweb.c:943: warning: implicit declaration of
function âuser_readâ
/home/barry/dw2/dnewsweb.c: In function ânntp_read_timeoutâ:
/home/barry/dw2/dnewsweb.c:1054: warning: implicit declaration of
function ânntp_chanwaitâ
/home/barry/dw2/dnewsweb.c: In function âreverse_xoverâ:
/home/barry/dw2/dnewsweb.c:1333: warning: implicit declaration of
function âstr_insertsnâ
/home/barry/dw2/dnewsweb.c: In function âshow_article_partâ:
/home/barry/dw2/dnewsweb.c:1604: warning: implicit declaration of
function âydecodeâ
/home/barry/dw2/dnewsweb.c:1632: warning: implicit declaration of
function âboundary_checkâ
/home/barry/dw2/dnewsweb.c: In function âf_cancelâ:
/home/barry/dw2/dnewsweb.c:1836: warning: implicit declaration of
function âisloginâ
/home/barry/dw2/dnewsweb.c:1870: warning: implicit declaration of
function âgroup_readonlyâ
/home/barry/dw2/dnewsweb.c: In function âr_configâ:
/home/barry/dw2/dnewsweb.c:2006: warning: implicit declaration of
function âuser_writeâ
/home/barry/dw2/dnewsweb.c: In function âr_loginâ:
/home/barry/dw2/dnewsweb.c:2030: warning: implicit declaration of
function âpop_checkâ
/home/barry/dw2/dnewsweb.c: In function âr_partsâ:
/home/barry/dw2/dnewsweb.c:4055: warning: implicit declaration of
function âdecode_urlâ
/home/barry/dw2/dnewsweb.c:4103: warning: implicit declaration of
function âparts_subject_yencâ
/home/barry/dw2/dnewsweb.c: In function âr_postâ:
/home/barry/dw2/dnewsweb.c:5040: warning: implicit declaration of
function âbase64_encodeâ
/home/barry/dw2/dnewsweb.c:5059: warning: implicit declaration of
function âuuencâ
/home/barry/dw2/dnewsweb.c: In function âtemp_fnameâ:
/home/barry/dw2/dnewsweb.c:5139: warning: implicit declaration of
function âmktempâ
/home/barry/dw2/dnewsweb.c:5139: warning: assignment makes pointer from
integer without a cast
/home/barry/dw2/dnewsweb.c: In function âshow_dlineâ:
/home/barry/dw2/dnewsweb.c:5217: warning: format not a string literal
and no format arguments
/home/barry/dw2/dnewsweb.c:5230: warning: format not a string literal
and no format arguments
/home/barry/dw2/dnewsweb.c: In function âattach_fnameâ:
/home/barry/dw2/dnewsweb.c:6007: warning: assignment makes pointer from
integer without a cast
/home/barry/dw2/dnewsweb.c: In function âtpl_replaceâ:
/home/barry/dw2/dnewsweb.c:6862: warning: format not a string literal
and no format arguments
/home/barry/dw2/dnewsweb.c:6864: warning: format not a string literal
and no format arguments
/home/barry/dw2/dnewsweb.c: In function âdisplay_infoâ:
/home/barry/dw2/dnewsweb.c:8887: error: âenvironâ undeclared (first use
in this function)
make[2]: *** [CMakeFiles/dnewsweb.dir/dnewsweb.c.o] Fout 1
make[1]: *** [CMakeFiles/dnewsweb.dir/all] Fout 2
make: *** [all] Fout 2

Stephen Sprunk 06-13-2012 11:12 PM

Re: Makefile Linux
 
On 13-Jun-12 07:36, Barry wrote:
> It's hard to explain but I think the problem lies in #ifdef isunix
> #endif statement.
> maybe if you see the source code that a makes a lot clear.
> here is the link:
> http://members.chello.nl/~b.vandenbos/source.zip


This appears to be the source to copyrighted, closed-source software
which is available pre-compiled for Linux on the copyright owner's web site.

Therefore, I deduce that you have somehow managed to obtain stolen
source code and are asking us to help you further your attempts to
infringe on the owner's rights by compiling and using this source
without a license, which may be a crime not just for you but also for
the people you're asking to help you.

Nice try, but I deleted the code as soon as I figured out what it was
and suggest everyone else do the same--including you, "Barry".

S

--
Stephen Sprunk "God does not play dice." --Albert Einstein
CCIE #3723 "God is an inveterate gambler, and He throws the
K5SSS dice at every possible opportunity." --Stephen Hawking

Barry 06-13-2012 11:40 PM

Re: Makefile Linux
 
Op 14-6-2012 1:12, Stephen Sprunk schreef:
> On 13-Jun-12 07:36, Barry wrote:
>> It's hard to explain but I think the problem lies in #ifdef isunix
>> #endif statement.
>> maybe if you see the source code that a makes a lot clear.
>> here is the link:
>> http://members.chello.nl/~b.vandenbos/source.zip

>
> This appears to be the source to copyrighted, closed-source software
> which is available pre-compiled for Linux on the copyright owner's web site.
>
> Therefore, I deduce that you have somehow managed to obtain stolen
> source code and are asking us to help you further your attempts to
> infringe on the owner's rights by compiling and using this source
> without a license, which may be a crime not just for you but also for
> the people you're asking to help you.
>
> Nice try, but I deleted the code as soon as I figured out what it was
> and suggest everyone else do the same--including you, "Barry".
>
> S
>

no I got it from them.

James Kuyper 06-14-2012 02:26 AM

Re: Makefile Linux
 
On 06/13/2012 11:17 AM, Barry wrote:
....
> this is what i get when i run make.
>
>
> [ 0%] Building C object CMakeFiles/dnewsweb.dir/dnewsweb.c.o
> /home/barry/dw2/dnewsweb.c: In function âmainâ:
> /home/barry/dw2/dnewsweb.c:607: warning: implicit declaration of
> function âputenvâ


Lets start with this. putenv() is an X-Open extension to the C standard
library. It is supposed to be declared in <stdlib.h>, which is #included
in NetWin's code. Like most such extensions, it uses a name reserved by
the C standard library. As a result, an implementation of the C standard
library CANNOT have a declaration of putenv() in <stdlib.h> if invoked
in conforming mode, unless you do something that makes the behavior
undefined. What precisely you need to do depends upon the implementation
of C that you're using.

The man page for my Linux machine indicates that if I #define either
_SVID_SOURCE or _XOPEN_SOURCE before #including <stdlib.h>, that will do
the job. Those identifiers are reserved to the implementation for all
uses, and #defining them therefore give your code undefined behavior,
which gives the compiler permission to add in non-conforming extensions
like putenv().

I tried it, and invoking gcc with -Disunix and either -D_SVID_SOURCE or
-D_XOPEN_SOURCE removed all of the error messages. There's still a huge
number of warning messages - this code would never pass a code review in
my group - but it does compile.
--
James Kuyper

James Kuyper 06-14-2012 02:30 AM

Re: Makefile Linux
 
On 06/13/2012 10:26 PM, James Kuyper wrote:
....
> Lets start with this. putenv() is an X-Open extension to the C standard
> library. It is supposed to be declared in <stdlib.h>, which is #included
> in NetWin's code. Like most such extensions, it uses a name reserved by
> the C standard library.


Correction: that was supposed to say "... reserved by the C standard for
users". If it were reserved for the implementation, there wouldn't be an
issue, but because it's reserved for users, it can't normally be
declared by the C standard library headers.
--
James Kuyper


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

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