473,760 Members | 8,623 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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(co nst 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(oth ers.o)(.text+0x 2d): 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(oth ers.o)(.text+0x 55):/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(oth ers.o)(.text+0x 9d): 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(oth ers.o)(.text+0x c5):/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(oth ers.o)(.text+0x 121): 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(oth ers.o)(.text+0x 14c):/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(oth ers.o)(.text+0x 9db): 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(oth ers.o)(.text+0x e2b): 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(oth ers.o)(.text+0x e65):/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(oth ers.o)(.text+0x f1e): 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(oth ers.o)(.text+0x f88): 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(str c.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(dsi g.o)(.text+0x3e 3): 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 1999
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.microsof t.com
Newsgroup: microsoft.publi c.win32.program mer.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
2673
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 trying to get this code to run on my web host's unix server, with no luck. I put the folder (jpgraph) containing all the jpgraph libs in the same directory as my php code. I have tried all of the following:
1
1330
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 would like to make it fully portable to other unix-like platforms. Therefore I need to provide the source and integrate eggtrayicon compiling in my setup.py. At this point I don't know how go on.
0
1813
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 the library in Linker-General-Addition Library Directories field under the Project options. The first question I have is....is this the correct way to include a static library. If not, then what is the correct way to do it (I need to make .NET...
0
1211
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 the library in Linker-General-Addition Library Directories field under the Project options. The first question I have is....is this the correct way to include a static library. If not, then what is the correct way to do it (I need to make .NET...
2
5878
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 librarys? Thanks a lot, Christoph
1
1013
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 getting an unresolved external symbol linker error. I have the same code in an .exe project and it works fine. What the hell, Mel?
0
1101
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 Unknown Module This assertion comes before executing the code in Main(). So I want to know are there any issues accessing static libs(unmanaged) from .Net application. These static libs use MFC classes..So anything to do with that?? Any...
1
1813
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 libSecond.a app.c. It gives( and it should ) multiple declaration error . Is there any
1
2512
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 shared) to Linux, what is the extension in Linux (shared is .so, static is .lib?), can I get some sample makefile for static libs and shared libs?. thanks.
0
9333
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
1
9900
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9765
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7324
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6599
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5214
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5361
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
3
3442
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2733
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.