# Errors in SLES11

**URL:** <https://forums.suse.com/t/errors-in-sles11/26252>\
**Category:** SLES Updates\
**Created:** [October 27, 2014, 6:58am UTC](https://forums.suse.com/t/errors-in-sles11/26252 "2014-10-27T06:58:14Z")\
**Posts on this page:** 15\
**Page:** 1

<div class="post-metadata">

**Author:** ![Supriya](https://avatars.discourse-cdn.com/v4/letter/s/5f8ce5/32.png) [@Supriya](https://forums.suse.com/u/Supriya)\
**Post date:** [October 27, 2014, 6:58am UTC](https://forums.suse.com/t/errors-in-sles11/26252/1 "2014-10-27T06:58:14Z")

</div>

Hello  
recently i magrated my server from SLES10 SLES11.2, gcc copmlier 4.3.4&binutils 2.21. when i am doing builds i am getting errors as atoi,setenv,etc was not declared in the scope and one more error Unrecognized option “–build id”.

1. 

g++ /home/ismdev/sources/cfsw/source/wscafl02.cpp -c -o /home/ismdev/builds/sap/build/wscafl02.o -fexceptions -DTRACE -DCFSW -DSAP -DWEB -DCFSWEB\_LINUX2VM -DCFSWEB\_SWNT\_SAP -DCFSWEB\_SAVERESTORE -m32 -ggdb -DCOMPILER\_MIGRATION -DISPF\_EXCLUDE -I/home/ismdev/sources/cfsw/include -I/home/ismdev/sources/cfsw/components/logclient/include -I/home/ismdev/sources/ispf\_emulator/include -I/home/ismdev/sources/wscapi/include -I/home/ismdev/sources/crf/include -I/usr/include/libxml2 -I/usr/include/curl  
/home/ismdev/sources/cfsw/source/wscafl02.cpp: In member function âRESULT WSCAFL02\_FileUploadPanel::CheckAuthorization()â:  
/home/ismdev/sources/cfsw/source/wscafl02.cpp:1849: error: âgetenvâ was not declared in this scope  
/home/ismdev/sources/cfsw/source/wscafl02.cpp:1849: error: âsetenvâ was not declared in this scope  
/home/ismdev/sources/cfsw/source/wscafl02.cpp:1926: error: âatoiâ was not declared in this scope  
/home/ismdev/sources/cfsw/source/wscafl02.cpp:1942: error: âatoiâ was not declared in this scope  
/home/ismdev/sources/cfsw/source/wscafl02.cpp:1954: error: âfreeâ was not declared in this scope  
/home/ismdev/sources/cfsw/source/wscafl02.cpp:2007: error: âatoiâ was not declared in this scope  
/home/ismdev/sources/cfsw/source/wscafl02.cpp:2013: error: âfreeâ was not declared in this scope  
/home/ismdev/sources/cfsw/source/wscafl02.cpp: In member function âRESULT WSCAFL02\_FileUploadPanel::CheckAuthCFReportRestore()â:  
/home/ismdev/sources/cfsw/source/wscafl02.cpp:2142: error: âatoiâ was not declared in this scope  
make[2]: \*\*\* [/home/ismdev/builds/sap/build/wscafl02.o] Error 1

1. 

g++ -o /home/ismdev/builds/sap/build/ismcache.module /home/ismdev/builds/sap/build/wsconfig.o /home/ismdev/builds/sap/build/settings\_manager.o /home/ismdev/builds/sap/build/wscwmqc.o /home/ismdev/builds/sap/build/cmqasync.o /home/ismdev/builds/sap/build/wscwrdcc.o -L/home/ismdev/builds/sap/build -L/home/ismdev/builds/wscapi/build -L/home/ismdev/builds/ispf/build -L/home/ismdev/builds/sap/build -Xlinker -\( -lwsc135 -lwscx10a -lwscx10b -lwscx10c -lwscp10a -lwscp10b -lwscp10c -lwscp10d -lwscv10 -lwscv111a -lwscv111b -lwscv111c -lwscegg -lwscu10 -lwscde10 -lwscd10a -lwscgl10a -lwscgl10b -lwscgl10c -lwscli10 -lwscna10 -lwscpr10 -lwscse10 -lwscva10 -lwscr10a -lwscr10b -lwscr10c -lwscaci10 -lwscrsap -lwscw10 -lapit -lispf -lpanel -lform -lncurses -lcurl -lxml2 -lssl -lmqic -lsapnt -Xlinker -\) -m32 -Xlinker --export-dynamic  
/usr/lib64/gcc/x86\_64-suse-linux/4.3/…/…/…/…/x86\_64-suse-linux/bin/ld: unrecognized option ‘–build-id’  
/usr/lib64/gcc/x86\_64-suse-linux/4.3/…/…/…/…/x86\_64-suse-linux/bin/ld: use the --help option for usage information  
collect2: ld returned 1 exit status  
make[1]: \*\*\* [ismcache.module] Error 1

---

<div class="post-metadata">

**Author:** ![Supriya](https://avatars.discourse-cdn.com/v4/letter/s/5f8ce5/32.png) [@Supriya](https://forums.suse.com/u/Supriya)\
**Post date:** [October 28, 2014, 12:22pm UTC](https://forums.suse.com/t/errors-in-sles11/26252/2 "2014-10-28T12:22:20Z")

</div>

Hello  
please help me with it. anyone can be much appreciated.

Thanks

---

<div class="post-metadata">

**Author:** ![mikewillis](https://avatars.discourse-cdn.com/v4/letter/m/b2d939/32.png) [@mikewillis](https://forums.suse.com/u/mikewillis)\
**Post date:** [October 28, 2014, 1:30pm UTC](https://forums.suse.com/t/errors-in-sles11/26252/3 "2014-10-28T13:30:40Z")

</div>

[QUOTE=Supriya;24374]Hello  
please help me with it. anyone can be much appreciated.

Thanks[/QUOTE]

I think the reason you’ve not got any replies so far is in large part because it’s not at all clear what you are trying to do. You’re trying to compile something, but what exactly is it you’re trying to compile?

I’m curious why you’ve updated to SLES 11 SP2 rather than SLES 11 SP3 given that SP2 is already End Of Life.

---

<div class="post-metadata">

**Author:** ![Jens-U](https://avatars.discourse-cdn.com/v4/letter/j/d78d45/32.png) [@Jens-U](https://forums.suse.com/u/Jens-U)\
**Post date:** [October 28, 2014, 2:31pm UTC](https://forums.suse.com/t/errors-in-sles11/26252/4 "2014-10-28T14:31:56Z")

</div>

Hi Supriya,

> /home/ismdev/sources/cfsw/source/wscafl02.cpp:1849: error: âgetenvâ was not declared in this scope  
> …

does that source file include the proper include files? It’s rather typical that gcc gets more picky over versions, pointing out errors and warnings that were not reported earlier.

See “man 3 getenv” etc. for details.

> /usr/lib64/gcc/x86\_64-suse-linux/4.3/…/…/…/…/x86\_64-suse-linux/bin/ld: unrecognized option ‘–build-id’  
> /usr/lib64/gcc/x86\_64-suse-linux/4.3/…/…/…/…/x86\_64-suse-linux/bin/ld: use the --help option for usage information

That one looks strange. You might want to call that ld (which ought to be a symlink effectively pointing to /usr/bin/ld) with “–help” to check if it mentions that option - my SLES11SP3 version does.

Regards,  
Jens

---

<div class="post-metadata">

**Author:** ![malcolmlewis](https://sea2.discourse-cdn.com/flex022/user_avatar/forums.suse.com/malcolmlewis/32/11375_2.png) [@malcolmlewis](https://forums.suse.com/u/malcolmlewis)\
**Post date:** [October 28, 2014, 3:34pm UTC](https://forums.suse.com/t/errors-in-sles11/26252/5 "2014-10-28T15:34:42Z")

</div>

> [@](#):
>
> On Tue 28 Oct 2014 12:34:02 PM CDT, jmozdzen wrote:
> 
> Hi Supriya,  
> [color=blue]
> 
> > /home/ismdev/sources/cfsw/source/wscafl02.cpp:1849: error: _getenv_[/color]  
> > was not declared in this scope[color=blue]  
> > …[/color]
> 
> does that source file include the proper include files? It’s rather  
> typical that gcc gets more picky over versions, pointing out errors and  
> warnings that were not reported earlier.
> 
> See “man 3 getenv” etc. for details.  
> [color=blue]
> 
> > [/color]  
> > /usr/lib64/gcc/x86\_64-suse-linux/4.3/…/…/…/…/x86\_64-suse-linux/bin/ld:  
> > unrecognized option ‘–build-id’[color=blue]  
> > [/color]  
> > /usr/lib64/gcc/x86\_64-suse-linux/4.3/…/…/…/…/x86\_64-suse-linux/bin/ld:  
> > use the --help option for usage information
> 
> That one looks strange. You might want to call that ld (which ought to  
> be a symlink effectively pointing to /usr/bin/ld) with “–help” to check  
> if it mentions that option - my SLES11SP3 version does.
> 
> Regards,  
> Jens

Hi  
When having linking issues with older code, exporting the following  
before you compile some times helps…

```auto
export SUSE_ASNEEDED=0
```

–  
Cheers Malcolm Â°Â¿Â° LFCS, SUSE Knowledge Partner (Linux Counter #276890)  
SUSE Linux Enterprise Desktop 12 GNOME 3.10.1 Kernel 3.12.28-4-default  
If you find this post helpful and are logged into the web interface,  
please show your appreciation and click on the star below… Thanks!

---

<div class="post-metadata">

**Author:** ![Jens-U](https://avatars.discourse-cdn.com/v4/letter/j/d78d45/32.png) [@Jens-U](https://forums.suse.com/u/Jens-U)\
**Post date:** [October 28, 2014, 4:15pm UTC](https://forums.suse.com/t/errors-in-sles11/26252/6 "2014-10-28T16:15:43Z")

</div>

Hi Malcolm,

learning something new every day… interesting way to revert that “as-needed” linker flag 🙂

In this case, I believe that this variable wouldn’t help much: The linker statement is already using a link group to wrap all libraries (to avoid the “symbol not found because of lib ordering” issue) and no missing symbols are reported by the linker, anyhow. But from what I can tell, the linker should support the “–build-id” option, Why it is complaining about it, I cannot tell. Do you have an idea what may be causing this, have I overlooked something in the linker parameters used?

Regards,  
Jens

---

<div class="post-metadata">

**Author:** ![Supriya](https://avatars.discourse-cdn.com/v4/letter/s/5f8ce5/32.png) [@Supriya](https://forums.suse.com/u/Supriya)\
**Post date:** [October 28, 2014, 5:18pm UTC](https://forums.suse.com/t/errors-in-sles11/26252/7 "2014-10-28T17:18:43Z")

</div>

SLES11 SP2 is mandatory for me. All the libraries are installed and i have some files. When i am compiling those i am getting those errors. i don’t know why those errors are getting exactly. Thanks

---

<div class="post-metadata">

**Author:** ![Jens-U](https://avatars.discourse-cdn.com/v4/letter/j/d78d45/32.png) [@Jens-U](https://forums.suse.com/u/Jens-U)\
**Post date:** [October 28, 2014, 5:44pm UTC](https://forums.suse.com/t/errors-in-sles11/26252/8 "2014-10-28T17:44:36Z")

</div>

Hi Supriya,

> [@Supriya;24399](#):
>
> i don’t know why those errors are getting exactly.

are you the developer in charge of those sources?

Regards,  
Jens

---

<div class="post-metadata">

**Author:** ![Supriya](https://avatars.discourse-cdn.com/v4/letter/s/5f8ce5/32.png) [@Supriya](https://forums.suse.com/u/Supriya)\
**Post date:** [October 28, 2014, 6:30pm UTC](https://forums.suse.com/t/errors-in-sles11/26252/9 "2014-10-28T18:30:49Z")

</div>

no i am not. i am working on migrating an old server to new server. for that i copied all sources from old to new server and i installed all libraries which the server needed. after that when i tried to compile those sources i am getting errors.

---

<div class="post-metadata">

**Author:** ![Jens-U](https://avatars.discourse-cdn.com/v4/letter/j/d78d45/32.png) [@Jens-U](https://forums.suse.com/u/Jens-U)\
**Post date:** [October 28, 2014, 7:04pm UTC](https://forums.suse.com/t/errors-in-sles11/26252/10 "2014-10-28T19:04:13Z")

</div>

Hi Supriya,

then I’ll try my best, at least to explain… but it’d be helpful if you had someone with a bit of C coding experience at hand…

When stumbling over a function call within some C code, the compiler tries to check if the programmer gave proper parameters to the function call. In order to do that verification, the compiler has to know about the number of required parameters and their types, this information is provided in so-called “header files” (because they include the function signature headers, among other information) or “include files” (because a “#include” statement is used to link your source to those files). In the C world, these files have names that end in “.h”.

The older a compiler you come across, the less picky it acts. Early C compilers didn’t even have a mean to check the function signatures nor cared if the function existed at all. Later compilers issued warnings, modern compilers are more rigorous, as you have found out.

Now, for each function that the compiler complains about, you need to find the name of the proper include file, and include that file once. The functions that were reported in your first post were all system functions, coming from stdlib.h, so you’ll have to insert an include statement in the source code file. Usually, you put these at the beginning of the file, so look for some block of include statement and add

```auto
#include <stdlib.h>
```

Now the compiler complaints should have gone away.

I still have no clue what’s wrong with the linker invocation, so I currently cannot help you with that, unfortunately.

Regards,  
Jens

---

<div class="post-metadata">

**Author:** ![Supriya](https://avatars.discourse-cdn.com/v4/letter/s/5f8ce5/32.png) [@Supriya](https://forums.suse.com/u/Supriya)\
**Post date:** [October 29, 2014, 6:56am UTC](https://forums.suse.com/t/errors-in-sles11/26252/11 "2014-10-29T06:56:28Z")

</div>

I kept all my libraries in /usr/include I don’t want to keep that libraries in source code. In old server we follow same process that time they compiled successfully. now why they are giving error.

my libraries are in  
ismdev@INMBZ2197:/usr/include\> ls  
stdlib.h  
string.h  
stdint.h  
All libarries are included like this.

---

<div class="post-metadata">

**Author:** ![Supriya](https://avatars.discourse-cdn.com/v4/letter/s/5f8ce5/32.png) [@Supriya](https://forums.suse.com/u/Supriya)\
**Post date:** [October 29, 2014, 9:36am UTC](https://forums.suse.com/t/errors-in-sles11/26252/12 "2014-10-29T09:36:59Z")

</div>

It is not working for this linking error.

[QUOTE=malcolmlewis;24393]Hi  
When having linking issues with older code, exporting the following  
before you compile some times helps…

```auto
export SUSE_ASNEEDED=0
```

–

---

<div class="post-metadata">

**Author:** ![Jens-U](https://avatars.discourse-cdn.com/v4/letter/j/d78d45/32.png) [@Jens-U](https://forums.suse.com/u/Jens-U)\
**Post date:** [October 29, 2014, 11:56am UTC](https://forums.suse.com/t/errors-in-sles11/26252/13 "2014-10-29T11:56:56Z")

</div>

Hi Supriya,

[QUOTE=Supriya;24423]I kept all my libraries in /usr/include I don’t want to keep that libraries in source code. In old server we follow same process that time they compiled successfully. now why they are giving error.

my libraries are in  
ismdev@INMBZ2197:/usr/include\> ls  
stdlib.h  
string.h  
stdint.h  
All libarries are included like this.[/QUOTE]

to me it seems this is no product problem, but requires (at least basic “C”) programming skills. Teaching C programming is beyond the scope of this forum, I suggest that you either get some local person from that area to help you out (should be a matter of an hour or less, judging from your description) or try some forum specialized on C/C++ programming if you want to learn the language and programming fundamentals.

Regards,  
Jens

---

<div class="post-metadata">

**Author:** ![Supriya](https://avatars.discourse-cdn.com/v4/letter/s/5f8ce5/32.png) [@Supriya](https://forums.suse.com/u/Supriya)\
**Post date:** [October 29, 2014, 12:31pm UTC](https://forums.suse.com/t/errors-in-sles11/26252/14 "2014-10-29T12:31:40Z")

</div>

I know C++ programming. my problem is that if i include that stdlib.h in source file then error won’t occur. but as per my requirement lib will not be include in source fiels. those libraries need to keep inside /usr/include from there source file will take that libraries and do compilation. in previous servers it works fine. while i am doing the same in new server it is giving error.

---

<div class="post-metadata">

**Author:** ![Jens-U](https://avatars.discourse-cdn.com/v4/letter/j/d78d45/32.png) [@Jens-U](https://forums.suse.com/u/Jens-U)\
**Post date:** [October 29, 2014, 12:47pm UTC](https://forums.suse.com/t/errors-in-sles11/26252/15 "2014-10-29T12:47:37Z")

</div>

Hi Supriya,

> [@Supriya;24431](#):
>
> I know C++ programming.

ah, that’s good.

> [@Supriya;24431](#):
>
> my problem is that if i include that stdlib.h in source file then error won’t occur.

That’s even better - because that#s the way things are to work 😉

> [@Supriya;24431](#):
>
> but as per my requirement lib will not be include in source fiels. those libraries need to keep inside /usr/include from there source file will take that libraries and do compilation. in previous servers it works fine. while i am doing the same in new server it is giving error

Most likely I’m not understanding you correctly - those files in /usr/include are no libraries, but header files, and you _need_ to include them in order to use them. That’s what they are written for. What else do you mean with “from there source file will take that libraries and do compilation”?

That it worked in older versions is likely to blame on the carelessness of the older compilers.

Regards,  
Jens
