missing libraries??

General questions regarding the usage of CodeLite
cgillopez
CodeLite Curious
Posts: 6
Joined: Thu Feb 25, 2010 7:50 pm
Genuine User: Yes
IDE Question: c++
Contact:

missing libraries??

Post by cgillopez »

Hello,

Im just a newbie with C/C++ and i have to change some stuff in a program which im able to compile in linux without errors, now in windows i use codelite to compile it but it doesnt work.

i get: C:/temp/h264/PROG/client/sdp.cpp:43: error: 'strlen' was not declared in this scope
C:/temp/h264/PROG/client/sdp.cpp:43: error: 'atoi' was not declared in this scope

i tried to add the libraries (#include <string.h>,...) but it doesnt work.

What can i do?? Wham am i doing wrong??

Thanks!!!!
User avatar
eranif
CodeLite Plugin
Posts: 6372
Joined: Wed Feb 06, 2008 9:29 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: missing libraries??

Post by eranif »

Post here the *complete* build log.
Also: which version of codelite are you using?
Did you install compiler?

Eran
Make sure you have read the HOW TO POST thread
cgillopez
CodeLite Curious
Posts: 6
Joined: Thu Feb 25, 2010 7:50 pm
Genuine User: Yes
IDE Question: c++
Contact:

Re: missing libraries??

Post by cgillopez »

Hello,

This is what i get:

----------Build Started--------
C:\WINDOWS\system32\cmd.exe /c ""mingw32-make.exe" -j 2 -f "H264progC_wsp.mk""
----------Building project:[ h264Axis - Debug ]----------
mingw32-make.exe[1]: Entering directory `C:/Archivos de programa/CodeLite/H264progC'
g++ -c "C:/temp/h264/PROG/client/rtp_parser.cpp" -g -o ../../../temp/h264/PROG/client/./Debug/rtp_parser.o "-I." "-I."
g++ -c "C:/temp/h264/PROG/client/sdp.cpp" -g -o ../../../temp/h264/PROG/client/./Debug/sdp.o "-I." "-I."
C:/temp/h264/PROG/client/sdp.cpp: In member function 'unsigned int SDP::getMediaPort(const std::string&)':
C:/temp/h264/PROG/client/sdp.cpp:43: error: 'strlen' was not declared in this scope
C:/temp/h264/PROG/client/sdp.cpp:43: error: 'atoi' was not declared in this scope
mingw32-make.exe[1]: *** [../../../temp/h264/PROG/client/./Debug/sdp.o] Error 1
mingw32-make.exe[1]: *** Waiting for unfinished jobs....
In file included from C:/temp/h264/PROG/client/rtp_parser.cpp:13:
C:/temp/h264/PROG/client/rtp_parser.hh:19:24: error: netinet/in.h: No such file or directory
C:/temp/h264/PROG/client/rtp_parser.cpp: In member function 'void RTPParser::putData(char*, int, char*, int)':
C:/temp/h264/PROG/client/rtp_parser.cpp:61: error: 'u_int16_t' was not declared in this scope
C:/temp/h264/PROG/client/rtp_parser.cpp:61: error: expected primary-expression before ')' token
C:/temp/h264/PROG/client/rtp_parser.cpp:72: warning: overflow in implicit constant conversion
C:/temp/h264/PROG/client/rtp_parser.cpp:95: error: 'u_int32_t' was not declared in this scope
C:/temp/h264/PROG/client/rtp_parser.cpp:95: error: expected primary-expression before ')' token
C:/temp/h264/PROG/client/rtp_parser.cpp:95: error: 'ntohl' was not declared in this scope
mingw32-make.exe[1]: *** [../../../temp/h264/PROG/client/./Debug/rtp_parser.o] Error 1
mingw32-make.exe: *** [All] Error 2
mingw32-make.exe[1]: Leaving directory `C:/Archivos de programa/CodeLite/H264progC'
----------Build Ended----------

Thanks for your help!
User avatar
eranif
CodeLite Plugin
Posts: 6372
Joined: Wed Feb 06, 2008 9:29 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: missing libraries??

Post by eranif »

Try google for this error:
C:/temp/h264/PROG/client/sdp.cpp:43: error: 'strlen' was not declared in this scope
Its a pure C++ compilation error, you should try some of the C++ forums out there.
Eran
Make sure you have read the HOW TO POST thread
HJarausch
CodeLite Veteran
Posts: 98
Joined: Thu Feb 18, 2010 10:54 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: missing libraries??

Post by HJarausch »

It could be that your compiler has put the definitions into namespace std.
So you could try
bad solution

using namespace std;

or better

#include <cstring>
using std::strlen; using std::atoi

Helmut.
Post Reply