Thread: NetBIOS APIs

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #3
    Registered User
    Join Date
    Jan 2007
    Location
    Northamptonshire, UK
    Posts
    18
    Thanks for that

    I tried putting this into Code::Blocks as a console application. When I compiled I got:

    Code:
    C:\Sourcecode\computers\main.cpp     3    warning:  ignoring #pragma comment
    C:\Sourcecode\computers\main.cpp     4    warning:  ignoring #pragma comment
    C:\Sourcecode\computers\main.cpp          In function 'main':
    C:\Sourcecode\computers\main.cpp     12   warning:  converting of negative value '-0x00000001' to 'DWORD'
    C:\Sourcecode\computers\main.cpp     10   warning:  unused variable 'dwResult'
    obj\Debug.main.o                          In function 'main':
    C:\Sourcecode\computers\main.cpp     18   undefined reference to '_WSAStartup@8'
    C:\Sourcecode\computers\main.cpp     23   undefined reference to '_WNetOpenEnumA@20'
    C:\Sourcecode\computers\main.cpp     26   undefined reference to '_WSACleanup@0'
    C:\Sourcecode\computers\main.cpp     33   undefined reference to '_WNetCloseEnum@4'
    C:\Sourcecode\computers\main.cpp     34   undefined reference to '_WSACleanup@0'
    C:\Sourcecode\computers\main.cpp     37   undefined reference to '_WNetEnumResource@16'
    C:\Sourcecode\computers\main.cpp     46   undefined reference to '_gethostbyname@4'
    C:\Sourcecode\computers\main.cpp     48   undefined reference to '_inet_ntoa@4'
    C:\Sourcecode\computers\main.cpp     51   undefined reference to '_WNetCloseEnum@4'
    C:\Sourcecode\computers\main.cpp     52   undefined reference to '_WSACleanup@0'
                                              === Build Finished: 10 errors, 4  warnings ===
    I had a play and found I needed to add the wsock32 and mpr libraries to the build myself. Is that correct? Or should the #pragma statements have done it for me?

    I'm fairly new to C++ and windows programming, although have experience with other languages. I'm assuming I should have been able to just compile?

    Anyway, it worked and did exactly what I need it to do

    Thanks

    Paul
    Last edited by wierdbeard65; 06-30-2008 at 02:39 AM.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. how to copy binary files using Unix API's
    By rohan_ak1 in forum C Programming
    Replies: 25
    Last Post: 05-07-2008, 09:12 AM
  2. Any good windows system APIs?
    By taelmx in forum Windows Programming
    Replies: 2
    Last Post: 11-08-2006, 12:43 AM
  3. CD Player using waveOutXXX APIs?
    By loobian in forum C++ Programming
    Replies: 6
    Last Post: 12-19-2003, 12:52 AM
  4. Hi all!, Another question about socket's & NetBios
    By Pandora in forum Windows Programming
    Replies: 9
    Last Post: 03-19-2003, 08:10 AM
  5. Those darn API's
    By Zahl in forum A Brief History of Cprogramming.com
    Replies: 6
    Last Post: 01-04-2003, 10:27 AM