element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • Community Hub
    Community Hub
    • What's New on element14
    • Feedback and Support
    • Benefits of Membership
    • Personal Blogs
    • Members Area
    • Achievement Levels
  • Learn
    Learn
    • Ask an Expert
    • eBooks
    • element14 presents
    • Learning Center
    • Tech Spotlight
    • STEM Academy
    • Webinars, Training and Events
    • Learning Groups
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • Technology Groups
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents Projects
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • Project Groups
  • Products
    Products
    • Arduino
    • Avnet & Tria Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • About Us
  • Store
    Store
    • Visit Your Store
    • Choose another store...
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      • Japan
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • Vietnam
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
  • Settings
Experts, Learning and Guidance
  • Technologies
  • More
Experts, Learning and Guidance
Ask an Expert Forum Linking issues with gcc.exe when using <bitlib.h> library
  • Blog
  • Forum
  • Documents
  • Leaderboard
  • Files
  • Members
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
Join Experts, Learning and Guidance to participate - click to join for free!
Actions
  • Share
  • More
  • Cancel
Forum Thread Details
  • State Not Answered
  • Replies 16 replies
  • Subscribers 301 subscribers
  • Views 338 views
  • Users 0 members are here
Related
See a helpful answer?

Be sure to click 'more' and select 'suggest as answer'!

If you're the thread creator, be sure to click 'more' then 'Verify as Answer'!

Linking issues with gcc.exe when using <bitlib.h> library

ArminAIM
ArminAIM 5 days ago

Hi,

This is the compiler settings I am using on Embarcadero Dev-C++.....

image

This is my code (which is actually an example code from the bitscope micro people)

/* report.c -- BitLib 2.0 Capture Device Report Generator (ANSI C)
 * See User Programming Manual for information about these calls.*/


#include <stdio.h>
#include <limits.h>
#include <bitlib.h>

 /* required */


#define MY_DEVICES 1 /* change this if you have more than one */
#define MY_PROBE_FILE "" /* default probe file if unspecified */



const char * MODES[] = {"FAST","DUAL","MIXED","LOGIC","STREAM"};
const char * SOURCES[] = {"POD","BNC","X10","X20","X50","ALT","GND"};

int main(int argc, char *argv[]) {
    int N;
    

   /*
    * Open the first device found (only)
    */
    printf("\nStarting: Attempting to open %d device%s...",MY_DEVICES,MY_DEVICES!=1?"s":"");
    if ( (N = BL_Open(MY_PROBE_FILE,MY_DEVICES)) ) {
        int i;
       /*
        * Open succeeded, report library version and for each device...
        */
        printf("\n Library: %s (report.c)\n",BL_Version(BL_VERSION_LIBRARY));
        printf("  Opened: %d Device%s\n",N,N!=1?"s":"");
        for ( i = 0; i < N; i++ ) {
            int j;
           /*
            * Select the device (all following functions talk to this device).
            */
            BL_Select(BL_SELECT_DEVICE,i);
           /*
            * Report the device, link and available channels.
            */
            printf("\nBitScope: %s (%s)\n",BL_ID(),BL_Version(BL_VERSION_DEVICE));
            { char name[100]; printf("    Link: %s\n",BL_Name(name)); }
            printf("Channels: %d (%d analog + %d logic)\n",
                   BL_Count(BL_COUNT_ANALOG)+BL_Count(BL_COUNT_LOGIC),
                   BL_Count(BL_COUNT_ANALOG),BL_Count(BL_COUNT_LOGIC));
           /*
            * Determine which modes the device supports.
            */
            printf("   Modes:");
            for ( j = BL_MODE_FAST; j <= BL_MODE_STREAM; j++ )
                if ( BL_Mode(j) == j ) printf(" %s",MODES[j]);
           /*
            * Report canonic capture specification in LOGIC (if supported) or FAST mode (otherwise).
            */
            if ( BL_Mode(BL_MODE_LOGIC) == BL_MODE_LOGIC || BL_Mode(BL_MODE_FAST) == BL_MODE_FAST )
                printf("\n Capture: %d @ %.0fHz = %fs (%s)\n",BL_Size(BL_ASK),
                       BL_Rate(BL_ASK), BL_Time(BL_ASK),MODES[BL_Mode(BL_ASK)]);
           /*
            * Report the maximum offset range (if the device supports offsets).
            */
            BL_Range(BL_Count(BL_COUNT_RANGE)); /* highest range */
            if ( BL_Offset(INT_MIN) != BL_Offset(INT_MAX) ) /* supports offsets */
                printf("  Offset: %+.4gV to %+.4gV\n",BL_Offset(INT_MAX), BL_Offset(INT_MIN));
           /*
            * Report the sources provided by the device and their respective ranges.
            */
            for ( j = BL_SOURCE_POD; j <= BL_SOURCE_GND; j++ ) {
                int k, n = BL_Count(BL_COUNT_RANGE);
                if ( j == BL_Select(BL_SELECT_SOURCE,j) ) {
                    printf("     %s:",SOURCES[j]);
                    for ( k = n-1; k >= 0; k-- )
                        printf(" %5.2fV",BL_Range(k));
                    printf("\n");
                }
            }
        }
    }
    printf("\n");
    BL_Close();
    return 0;
}

I have copied all the files from the "Bitscope" folder to my working folder with the ".c" file in it.

And then this is what I get when I try to compile.

Any help would be so much appreciated thanks!!

image

  • Sign in to reply
  • Cancel

Top Replies

  • Jan Cumps
    Jan Cumps 4 days ago in reply to ArminAIM +3
    use <> includes only for C and its standard library includes. For your own project include files (also ones you copied into your project folder from 3rd parties), use "". #include <stdio.h> #include…
  • obones
    obones 5 days ago +1
    Hello Could you show us the file/folder structure that you have? Usually, when a toolchain complain at the linking stage, it's because of one of two things: 1. The required ".a" file cannot be found…
  • beacon_dave
    beacon_dave 4 days ago in reply to Jan Cumps +1
    Jan Cumps said: The extensions aren't hidden I think they are for 'known file types' e.g. Jan Cumps said: I think it's an edited printscreen I think the 'stitch line' two thirds of the way…
Parents
  • ArminAIM
    0 ArminAIM 3 days ago

    Hi guys,

    I got it to work!! So happy!! I have an .exe. file!

    I had to do the -lbitlib thing added to linker and added all the directories again.

    Now though I have anther error called "BITSCOPELIBRARY.dll is missing from your computer"

    But that just made my day to get 0 error and 0 warnings!

    Thanks for all your help

    Armin

    obones said:
    bitlib a

    image

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • obones
    0 obones 3 days ago in reply to ArminAIM

    That DLL should be placed next to the exe file for it to start properly.
    You could copy it over the output folder with a post build script for instance.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • ArminAIM
    0 ArminAIM 3 days ago in reply to obones

    Thanks obones

    Problem is I've never seen this .DLL before and I also can't find it on the internet anywhere

    Strange!

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • obones
    0 obones 2 days ago in reply to ArminAIM

    On your screen capture, there is a zip file with the same name inside it, and you appear to have unzipped it in a folder already

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • ArminAIM
    0 ArminAIM 2 days ago in reply to obones

    Thanks again obones

    Unfortunately I don't have that file.

    I know what you are all thinking - it would seem that it is in one of the zip files and is a DLL to work with some of the programs. But this is not the case because I searched entire PC and it's nowhere to be found

    I think it might be some sort of an illusive wrapper? Closest I get is the BitScopeLibraryGuide.pdf !!!

    If anyone could find it for me anywhere I would be ever so grateful!

    Thanks

    Armin

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • Jan Cumps
    0 Jan Cumps 2 days ago in reply to ArminAIM

    Does the device come with software installer? It's possible that the dll is part of that.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • obones
    0 obones 2 days ago in reply to Jan Cumps

    Well, the bitscope-library_2.0.FE26B_amd64.zip file contains an InstallLibrary.exe executable.
    But using 7zip to get its content without running it, I see it contains a bitlib.lib and a bitlib.dll file

    What I find strange is that this bitlib.lib file only references bitlib.dll and that DLL file has not further exotic dependencies.

    In the end, I believe that putting all files "en vrac" in your program folder is a bad idea, you cannot be sure which file is used by the compiler and linker.

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • Jan Cumps
    0 Jan Cumps 1 day ago in reply to obones

    another cause of this message may be, that the project isn't correctly set up in the IDE. Maybe "use dynamic libraries" is checked in the project properties? (I don't know the Dev-C++ IDE)

    ArminAIM , did you follow any instructions when trying to set up this first test?

    If yes, can you post a link to them? 

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
Reply
  • Jan Cumps
    0 Jan Cumps 1 day ago in reply to obones

    another cause of this message may be, that the project isn't correctly set up in the IDE. Maybe "use dynamic libraries" is checked in the project properties? (I don't know the Dev-C++ IDE)

    ArminAIM , did you follow any instructions when trying to set up this first test?

    If yes, can you post a link to them? 

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
Children
No Data
element14 Community

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2025 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

ICP 备案号 10220084.

Follow element14

  • X
  • Facebook
  • linkedin
  • YouTube