Author Topic: Linking error  (Read 6363 times)

Offline abraker95

  • Single posting newcomer
  • *
  • Posts: 5
Linking error
« on: January 05, 2011, 04:12:08 am »
I'm trying to compile a library, and I am getting a link time error. People said that the code compiles in
Visual C++ just fine, but Code::Blocks has a problem.

The error is undefined reference to `_strtoui64(char const*, char**, int)'
That function is declared in stdio.h

Please help ASAP!!! :(

Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 5913
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Re: Linking error
« Reply #1 on: January 05, 2011, 04:25:47 am »
You need to supply more information and ask a smart question.
Here is my mild guess :D
If you use VC++ compiler in Codeblocks, I think this is not a problem.
I suppose you use MinGW, so these two compilers may have different header files.
If some piece of memory should be reused, turn them to variables (or const variables).
If some piece of operations should be reused, turn them to functions.
If they happened together, then turn them to classes.

Offline abraker95

  • Single posting newcomer
  • *
  • Posts: 5
Re: Linking error
« Reply #2 on: January 05, 2011, 04:53:58 am »
I'm trying to make a dll out of the Raknet library, and it gives me a linktime error. I don't think it's the header file(s) since stdio.h is a standard C header. Yes I'm using MinGW. How can a standard C library have linking problems?

Offline xunxun

  • Almost regular
  • **
  • Posts: 187
Re: Linking error
« Reply #3 on: January 05, 2011, 06:29:44 am »
I'm trying to make a dll out of the Raknet library, and it gives me a linktime error. I don't think it's the header file(s) since stdio.h is a standard C header. Yes I'm using MinGW. How can a standard C library have linking problems?

No, on MinGW, strtoui64 is defined in "stdlib.h", not "stdio.h".
Regards,
xunxun

Offline abraker95

  • Single posting newcomer
  • *
  • Posts: 5
Re: Linking error
« Reply #4 on: January 05, 2011, 02:11:24 pm »
I looked at http://msdn.microsoft.com/en-us/library/85zk715d(v=vs.80).aspx and it like there areGeneric-Text Routine Mappings(???) Would declaring the wrong one cause the error?
« Last Edit: January 05, 2011, 02:19:54 pm by abraker95 »

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7588
    • My Best Post
Re: Linking error
« Reply #5 on: January 05, 2011, 06:49:24 pm »
Turn on Full Compiler Logging for your Compiler!
http://wiki.codeblocks.org/index.php?title=FAQ#Q:_How_do_I_troubleshoot_an_compiler_problem.3F

Then find a site that supports C/C+ programming questions.
Ask your programming questions on that site.
This Code::Blocks Web-Site is for C::B related questions; not C/C++ programming questions.

Tim S.
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org