Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3350100
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T01:44:46+00:00 2026-05-18T01:44:46+00:00

I’m working on a (C++) program that has to process a lot of information

  • 0

I’m working on a (C++) program that has to process a lot of information associated with a file/directory (so more or less I have a path as a key). Currently I’ve attempted a implementation using hash tables. This seem to work reasonably well given the volume of data but after profiling I find they are still the slowest link in the system, so in order to improve I look into using a Trie.

I find the following (C implementation) http://linux.thai.net/~thep/datrie/datrie.html and reading into the documentation there it seems to be a fairly good. However in attempting to write a simple test snippet I end up with a strange link error.

The strange thing is: the function in question exists (as in its there, and in the cpp file) and the object files are created, so why is there a link error for it?

My code:

#include <iostream>
#include <datrie/trie.h>

extern int main(int, char**)
{
    // create character map covering unicode characters
    AlphaMap *map = alpha_map_new();
    AlphaChar start = 32, end = 1114111;
    alpha_map_add_range(map, start, end);
    // create a trie and test it
    Trie *test = trie_new(map);
    const AlphaChar key[] = {0x64,0x64,0x64,0x64};
    trie_store(test, key, 3);
    TrieData *data;
    trie_retrieve(test, key, data);
    std::cout << *data << std::endl;
    return 0;
}

Error (simplified and line wrapped it for readability)

main.obj : error LNK2001: unresolved external symbol 
"int __cdecl alpha_map_add_range(struct _AlphaMap *,unsigned int,unsigned int)"

main.obj : error LNK2001: unresolved external symbol 
"struct _AlphaMap * __cdecl alpha_map_new(void)"

Using Visual Studio 2010

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-18T01:44:46+00:00Added an answer on May 18, 2026 at 1:44 am

    You’re mixing C and C++. When you include datatrie/trie.h in your C++ code the compiler assumes it’s a C++ header, howeever libdatatrie is a C library and its headers arn’t C++ friendly.

    Include the header like:

    extern "C" {
    #include <datrie/trie.h>
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

In my XML file chapters tag has more chapter tag.i need to display chapters
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I have a .ini file as follows: [playlist] numberofentries=2 File1=http://87.230.82.17:80 Title1=(#1 - 365/1400) Example
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I have just tried to save a simple *.rtf file with some websites and
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I've got a string that has curly quotes in it. I'd like to replace
I have a French site that I want to parse, but am running into
I know there's a lot of other questions out there that deal with this
I have thousands of HTML files to process using Groovy/Java and I need to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.