User forums > General (but related to Code::Blocks)

VC++?

(1/1)

accelas:
I'm using Code::blocks w/ VC++ toolkit, (since it's the only free ide, which supposed to work out of the box w/ VC++ tk).

Well, I'm trying to compile the test example come with libusb-win32. VC++ linker gives me a strange error (admittedly, C/C++ isn't my thing, i do most work with assembly on MCU's), that the function snprintf isn't found. After googling around I found that snprintf is a part of standard C lib, meaning it should be included in libc.lib, which in fact is in my lib search path. When I tried to change libc.lib to another location/version. It gave me the same error plus few more.

I uses standard compiling command come with Code:Block as below


--- Code: ---link.exe /nologo    /LIBPATH:"C:\Program Files\Microsoft Visual C++ Toolkit 2003\lib" /LIBPATH:"C:\Program Files\Microsoft Platform SDK\Lib" /LIBPATH:"C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\lib" /LIBPATH:"C:\Program Files\Microsoft.NET\SDK\v1.1\Lib" /out:"C:\Documents and Settings\accelas\Desktop\project\console.exe"    "C:\Documents and Settings\accelas\Desktop\project\lib\msvc\libusb.lib" .objs\testlibusb.obj
--- End code ---

Does anyone have some ideas?

sethjackson:
You have created a project right?

To use snprintf()

you need to do this


--- Code: ---#include <stdio.h>
#include <stdlib.h>

--- End code ---

It is in one of those headers not sure which one because I don't use C functions very much (mainly becuase I use C++).

mandrav:

--- Quote ---VC++ linker gives me a strange error
--- End quote ---

And the strange error is???

zieQ:
And libc (or another lib with the c standard functions) is automatically included by the linker, no need to worry about putting it to the linker options.
Want to see the linker errror too, since VC++ lacks some libraries (multi-threaded...) :wink:

Navigation

[0] Message Index

Go to full version