473,386 Members | 2,042 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

including c libs in c++ code?

joe
Hi I am trying to compile a cpp ap that runs on the system tray and checks
recently open files with clamav. i am getting a whole bunch of undefined
erros. can i link this library to a cpp program? do i need any special
confiure options?. i tried removing pthread and other libraries and the
results are similar. or should i write a small lib that checks buffers
and just use my lib with extern? thanks for the advice.

the code looks like this
extern "C" {
#include "clamav.h"

int cl_loaddbdir(const char *dirname, struct cl_node **root, int *virnum);

}

compiled with
redir -e out.txt g++ -o temp.exe myapp.cpp -mwindows -mno-cygwin -lclamav -
lz -lbz2 -lgmp

errors

/usr/lib/gcc-lib/i686-pc-
mingw32/3.3.1/../../../libclamav.a(str.o)(.text+0x3b): In function
`cli_hex2int':
/home/john/clamav-0.71/libclamav/str.c:36: undefined reference to
`__imp___ctype_'
/usr/lib/gcc-lib/i686-pc-
mingw32/3.3.1/../../../libclamav.a(others.o)(.text+0x2d): In function
`cli_warnmsg':
/home/john/clamav-0.71/libclamav/others.c:63: undefined reference to
`___getreent'
/usr/lib/gcc-lib/i686-pc-
mingw32/3.3.1/../../../libclamav.a(others.o)(.text+0x55):/home/john/clamav-
0.71/libclamav/others.c:64: undefined reference to `___getreent'
/usr/lib/gcc-lib/i686-pc-
mingw32/3.3.1/../../../libclamav.a(others.o)(.text+0x9d): In function
`cli_errmsg':
/home/john/clamav-0.71/libclamav/others.c:73: undefined reference to
`___getreent'
/usr/lib/gcc-lib/i686-pc-
mingw32/3.3.1/../../../libclamav.a(others.o)(.text+0xc5):/home/john/clamav-
0.71/libclamav/others.c:74: undefined reference to `___getreent'
/usr/lib/gcc-lib/i686-pc-
mingw32/3.3.1/../../../libclamav.a(others.o)(.text+0x121): In function
`cli_dbgmsg':
/home/john/clamav-0.71/libclamav/others.c:84: undefined reference to
`___getreent'
/usr/lib/gcc-lib/i686-pc-
mingw32/3.3.1/../../../libclamav.a(others.o)(.text+0x14c):/home/john/clamav
-0.71/libclamav/others.c:85: more undefined references to `___getreent'
follow
/usr/lib/gcc-lib/i686-pc-
mingw32/3.3.1/../../../libclamav.a(others.o)(.text+0x9db): In function
`cl_rndnum':
/home/john/clamav-0.71/libclamav/others.c:266: undefined reference to
`_gettimeofday'
/usr/lib/gcc-lib/i686-pc-
mingw32/3.3.1/../../../libclamav.a(others.o)(.text+0xe2b): In function
`cli_rmdirs':
/home/john/clamav-0.71/libclamav/others.c:356: undefined reference to
`_lstat'
/usr/lib/gcc-lib/i686-pc-
mingw32/3.3.1/../../../libclamav.a(others.o)(.text+0xe65):/home/john/clamav
-0.71/libclamav/others.c:359: undefined reference to `___errno'
/usr/lib/gcc-lib/i686-pc-
mingw32/3.3.1/../../../libclamav.a(others.o)(.text+0xf1e): In function
`cli_readn':
/home/john/clamav-0.71/libclamav/others.c:407: undefined reference to
`___errno'
/usr/lib/gcc-lib/i686-pc-
mingw32/3.3.1/../../../libclamav.a(others.o)(.text+0xf88): In function
`cli_writen':
/home/john/clamav-0.71/libclamav/others.c:436: undefined reference to
`___errno'
/usr/lib/gcc-lib/i686-pc-
mingw32/3.3.1/../../../libclamav.a(strc.o)(.text+0x13): In function
`strcasecmp':
/home/john/clamav-0.71/libclamav/zziplib/strc.c:42: undefined reference to
`__imp___ctype_'
/usr/lib/gcc-lib/i686-pc-
mingw32/3.3.1/../../../libclamav.a(dsig.o)(.text+0x3e3): In function
`cli_versig':
/home/john/clamav-0.71/libclamav/dsig.c:106: undefined reference to
`__imp___ctype_'
collect2: ld returned 1 exit status

Jul 22 '05 #1
1 1982
joe posted:
Hi I am trying to compile a cpp ap that runs on the system tray and
checks recently open files with clamav. i am getting a whole bunch of
undefined erros. can i link this library to a cpp program? do i need
any special confiure options?. i tried removing pthread and other
libraries and the results are similar. or should i write a small lib
that checks buffers and just use my lib with extern? thanks for the
advice.

More off-topic than talking about cooking meat on a vegetarian newsgroup.

Here's what you want:
News server: msnews.microsoft.com
Newsgroup: microsoft.public.win32.programmer.kernel

Best of luck.
-JKop
Jul 22 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: ebobnar | last post by:
I have some code running on windows on my local machine that uses the jpgraph image library. I include the jpgraph libs using include ("C:\Programming\php\jpgraph-1.14\src\jpgraph.php"); I am...
1
by: Andres Baravalle | last post by:
Hi, I am quite new with python and I'm developing a package that is including a binary file (eggtrayiconmodule.so) that is open source. My software is developed in part under linux, and now I...
0
by: TGF | last post by:
Hello, I am creating a console app. I try to link a static library by including it in the Linker-Input-Additional Dependencies field under the Project properties. Then I specify the path to...
0
by: TGF | last post by:
Hello, I am creating a console app. I try to link a static library by including it in the Linker-Input-Additional Dependencies field under the Project properties. Then I specify the path to...
2
by: Christoph | last post by:
I am including a lib in my c-source by using #pragma comment( lib, myLib.lib ) -> it works! I additionally want to set myLib.lib as my first library. Can anybody help me to set the order of the...
1
by: 0to60 | last post by:
I have a .dll project with both __gc and __nogc classes, managed and unmanaged code. In my unmanaged code, I want to call sqrt() from math.h. So, I've #included <math.h> in the .cpp file, but I'm...
0
by: ArtiB | last post by:
Hi, I have VC++ Windows form application in VS 2005. I am not able to access some static libs(VC6 migrated) from this application. Getting exception of type 'System.TypeInitializationException' in...
1
by: Raman | last post by:
Hi All, I have two libs (libFirst.a and libSecond.a). Both libs contains a common function func(). Now I want to link an application "app" with these two libs as gcc -o app libFirst.a...
1
by: tvnaidu | last post by:
I have windows code to port to Linux, there are some static libraries like xyz.lib, also shared libs ABC.dll, I have to convert those static and shared libs (basically static will be used to make...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.