Search the web
Sign In
New User? Sign Up
pokersource · Poker Source
? Already a member? Sign in to Yahoo!

Yahoo! Groups Tips

Did you know...
Want your group to be featured on the Yahoo! Groups website? Add a group photo to Flickr.

Best of Y! Groups

   Check them out and nominate your group.
Having problems with message search? Fill out this form to ensure your group is one of the first to be migrated to the new message search system.

Messages

  Messages Help
Advanced
Compile Issue   Message List  
Reply | Forward Message #94 of 355 |
I'm having an issue with compiling libpoker into my app. I'm trying to
use the eval.c example to just evaluate a hand with the 2 hold cards
and 5 community cards. It makes the object just fine but then when it
trys to link it in I get undefined references.

mzupan@homer:~/poker/server$ make
g++ -Wl,-rpath,/usr/lib/qt/lib -o server holdemEval.o server.o
-L/usr/lib/qt/lib -L/usr/X11R6/lib -lqt-mt -lXext -lX11 -lm
./lib/libpoker.a
holdemEval.o(.text+0x6b8): In function
`holdemEval::holdemEval[not-in-charge]()':
: undefined reference to `GenericDeck_maskString(Deck*, void*)'
holdemEval.o(.text+0x6f5): In function
`holdemEval::holdemEval[not-in-charge]()':
: undefined reference to `GenericDeck_maskString(Deck*, void*)'
holdemEval.o(.text+0xfd8): In function
`holdemEval::holdemEval[in-charge]()':
: undefined reference to `GenericDeck_maskString(Deck*, void*)'
holdemEval.o(.text+0x1015): In function
`holdemEval::holdemEval[in-charge]()':
: undefined reference to `GenericDeck_maskString(Deck*, void*)'
collect2: ld returned 1 exit status
make: *** [server] Error 1
mzupan@homer:~/poker/server$

The function seems to be in libpoker

mzupan@homer:~/poker/server$ nm -a lib/libpoker.a | grep
GenericDeck_maskString
00000110 T GenericDeck_maskString
mzupan@homer:~/poker/server$


Here is the same source I'm using. I'm taking the eval.c and trying to
put it into a class

holdemEval.h
-----------------
#include <stdio.h>
#include <stdlib.h>

#include "poker_defs.h"
#include "inlines/eval.h"

class holdemEval {

public:
holdemEval();
~holdemEval();

private:

};


holdemEval.cpp
-------------------

#include "holdemEval.h"





holdemEval::holdemEval() {

int gNCards;
CardMask gCards;
int gLow=0;
int gHighLow=0;

HandVal handval;
LowHandVal low;

gNCards = 0;
CardMask_RESET(gCards);
//parseArgs(argc, argv);

if (!gLow) {
handval = Hand_EVAL_N(gCards, gNCards);
printf("%s: ", Deck_maskString(gCards));
//HandVal_print(handval);
//printf("\n");
};

}


holdemEval::~holdemEval() {

}


it dies if i have printf("%s: ", Deck_maskString(gCards)); in the
source.. so its something to do with Deck_masString.. but I can't
figure it out

ALso I have tried to set init gCards.. I just left a lot out to make
it easier to read

Thanks
Mike




Wed Aug 18, 2004 11:22 am

mzupan21
Offline Offline
Send Email Send Email

Forward
Message #94 of 355 |
Expand Messages Author Sort by Date

I'm having an issue with compiling libpoker into my app. I'm trying to use the eval.c example to just evaluate a hand with the 2 hold cards and 5 community...
mzupan21
Offline Send Email
Aug 18, 2004
11:25 am

What is happening is that you have to include one of the *deck include files which will define the Deck_ macros....
Brian Goetz
briangoetz
Offline Send Email
Aug 23, 2004
4:59 pm
Advanced

Copyright © 2009 Yahoo! Inc. All rights reserved.
Privacy Policy - Terms of Service - Guidelines - Help