menugek / twitcurl

Automatically exported from code.google.com/p/twitcurl
0 stars 0 forks source link

Undefined symbols: CHMAC_SHA1::HMAC_SHA1 #25

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Download source from svn: svn checkout 
http://twitcurl.googlecode.com/svn/trunk/ twitcurl-read-only
2. Compile libtwitcurl: make
Produces these errors:

libtwitcurl$ make                                                               

g++ -Wall -fPIC -c -I/usr/include twitcurl.cpp oauthlib.cpp urlencode.cpp 
base64.cpp HMAC_SHA1.cpp SHA1.cpp
HMAC_SHA1.h: In constructor ‘CHMAC_SHA1::CHMAC_SHA1()’:
HMAC_SHA1.h:23: warning: ‘CHMAC_SHA1::AppendBuf2’ will be initialized after
HMAC_SHA1.h:21: warning:   ‘char* CHMAC_SHA1::SHA1_Key’
HMAC_SHA1.h:34: warning:   when initialized here
HMAC_SHA1.h: In constructor ‘CHMAC_SHA1::CHMAC_SHA1()’:
HMAC_SHA1.h:23: warning: ‘CHMAC_SHA1::AppendBuf2’ will be initialized after
HMAC_SHA1.h:21: warning:   ‘char* CHMAC_SHA1::SHA1_Key’
HMAC_SHA1.h:34: warning:   when initialized here
HMAC_SHA1.cpp: In member function ‘void CHMAC_SHA1::HMAC_SHA1(BYTE*, int, 
BYTE*, int, BYTE*)’:
HMAC_SHA1.cpp:32: warning: comparison between signed and unsigned integer 
expressions
HMAC_SHA1.cpp:49: warning: comparison between signed and unsigned integer 
expressions

3. Creating library (this is on OSX 10.5.8): g++ -dynamiclib 
-Wl,-dylib_install_name -L/usr/lib -o libtwitcurl.dylib *.o -lcurl

Undefined symbols:
  "CHMAC_SHA1::HMAC_SHA1(unsigned char*, int, unsigned char*, int, unsigned char*)", referenced from:
      oAuth::getSignature(_eOAuthHttpRequestType, std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::map<std::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::less<std::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<std::pair<std::basic_string<char, std::char_traits<char>, std::allocator<char> > const, std::basic_string<char, std::char_traits<char>, std::allocator<char> > > > > const&, std::basic_string<char, std::char_traits<char>, std::allocator<char> >&)in oauthlib.o
ld: symbol(s) not found
collect2: ld returned 1 exit status

What is the expected output? What do you see instead?

- See above

What version of the product are you using? On what operating system?

- Apple Macintosh G4 running OSX 10.5.8

Please provide any additional information below.

- Looks like the order in which object files are presented to ld is wrong. 
Putting HMAC_SHA1.o to the end seems to solve the issue.

Original issue reported on code.google.com by edgarm1...@gmail.com on 18 Jan 2012 at 3:33

GoogleCodeExporter commented 9 years ago
Please ignore this issue. It has been solved by specifying the correct library 
name. Sorry for the confusion.

Original comment by edgarm1...@gmail.com on 18 Jan 2012 at 4:27

GoogleCodeExporter commented 9 years ago

Original comment by swatkat....@gmail.com on 28 Apr 2012 at 3:27