compiling problem x86_64

If you are having problems with dxflib, post here. Please report bugs here.

Moderator: andrew

Post Reply
johannes911
Registered Member
Posts: 2
Joined: Sun May 24, 2009 12:28 pm

compiling problem x86_64

Post by johannes911 » Sun May 24, 2009 12:38 pm

Hello to all,
I try to compile qcad but the first part stops with error:

src/dl_writer.h: In member function ‘void DL_Writer::entityAttributes(const DL_Attributes&) const’:
src/dl_writer.h:337: error: ‘strcasecmp’ was not declared in this scope
src/dl_writer_ascii.cpp: In member function ‘virtual void DL_WriterA::dxfReal(int, double) const’:
src/dl_writer_ascii.cpp:72: error: ‘strlen’ was not declared in this scope
src/dl_writer_ascii.cpp:81: error: ‘strlen’ was not declared in this scope
src/dl_writer_ascii.cpp: In static member function ‘static void DL_WriterA::strReplace(char*, char, char)’:
src/dl_writer_ascii.cpp:147: error: ‘strlen’ was not declared in this scope
make: *** [src/dl_writer_ascii.o] Fehler 1
Building libdxf.a failed


I read the other thread in this forum, but on my opensuse 11.1 system there is no compat...

gcc++ is 4.3...


what can I do / test?

thanks a lot
Johannes

red_team316
Registered Member
Posts: 1
Joined: Mon Jun 01, 2009 6:25 am

Post by red_team316 » Mon Jun 01, 2009 6:31 am

EDIT:
Do not change <string> to <string.h>, or this will cause the test program to fail at make.

===========================================

Install gcc/g++ 4.2, apparently there is a bug of some sort with 4.3. Reference: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=474804

Code: Select all

./configure CXX=g++-4.2
make depend
make
Then make the test program in the test folder:

Code: Select all

make
./test demo.dxf
===========================================
For a DLL/shared library:

Code: Select all

./configure CXX=g++-4.2 CFLAGS=-fPIC
make depend
make
Then go to the src directory where the object files are and do:

Code: Select all

g++-4.2 -shared -o libdxflib.so dl_dxf.o dl_writer_ascii.o
Then copy the .so somewhere in your system path (I put mine in /usr/lib). Then run a "make clean" so that the libdxflib.a in the /dxflib-2.2.0.0-1.src/lib folder is removed(or manually delete it). This will ensure that when you make the test program that it uses the shared library rather than the static one.

Go to the test folder and run:

Code: Select all

make
./test demo.dxf

I did this on a Kubuntu Jaunty 9.04 x86_64 box and it worked just fine for dxflib 2.2.0.0. I posted how to make a shared library, because apparently the documentation on dxflib is somewhat outdated(2.0.x.x) and "make shared" does not work as it says it will.

Ziko
Registered Member
Posts: 1
Joined: Mon Nov 22, 2010 1:19 pm

Post by Ziko » Mon Nov 22, 2010 1:26 pm

Hello,

I have the same problem. I'm on windows with cygwin, I run:

. / Configure CXX = g + + -4.2
MinGW-make depend
MinGW-make

The first two steps seem to go well, while "MinGW-make" generates the following error:

"$ Mingw32-make
-I./src g + + -4.2-g-O2-DPACKAGE_NAME = \ "\"-DPACKAGE_TARNAME = \ "\"-DPACKAGE_VER
SION = \ "\"-DPACKAGE_STRING = \ "\"-DPACKAGE_BUGREPORT = \ "\"-DUNIX = 1-DX_DISPLAY_MI
SSING = 1-DSTDC_HEADERS = 1-DHAVE_SYS_TYPES_H = 1-DHAVE_SYS_STAT_H = 1-DHAVE_STDLIB_
H = 1-DHAVE_STRING_H = 1-DHAVE_MEMORY_H = 1-DHAVE_STRINGS_H = 1-DHAVE_INTTYPES_H = 1 -
DHAVE_STDINT_H = 1-DHAVE_UNISTD_H = 1-DHAVE_LIMITS_H = 1-c src / dl_writer_ascii.cpp
-O src / dl_writer_ascii.o
process_begin: CreateProcess (NULL, g + + -4.2 -I./src-g-O2-DPACKAGE_NAME = \ "\"-D
PACKAGE_TARNAME = \ "\"-DPACKAGE_VERSION = \ "\"-DPACKAGE_STRING = \ "\"-DPACKAGE_BUGR
Eport = \ "\"-DUNIX = 1-DX_DISPLAY_MISSING = 1-DSTDC_HEADERS = 1-DHAVE_SYS_TYPES_H = 1
-DHAVE_SYS_STAT_H = 1-DHAVE_STDLIB_H = 1-DHAVE_STRING_H = 1-DHAVE_MEMORY_H = 1-DHAVE
_STRINGS_H = 1-DHAVE_INTTYPES_H = 1-DHAVE_STDINT_H = 1-DHAVE_UNISTD_H = 1-DHAVE_LIMI
TS_H = 1-c src / dl_writer_ascii.cpp-o src / dl_writer_ascii.o, ...) failed.
make (e = 2): Can not find the file specified.
Mingw32-make: *** [src / dl_writer_ascii.o] Error 2 "

Sorry for the flood.

roddy
Registered Member
Posts: 1
Joined: Tue Jan 04, 2011 1:30 pm

Post by roddy » Tue Jan 04, 2011 1:45 pm

I have the same problem on windows 7 with cygwin and MinGW.
I get the same make error as Ziko about the file dl_writer_ascii.o

Can someone please help with this?

takar
Registered Member
Posts: 1
Joined: Mon Apr 18, 2011 10:13 pm

Post by takar » Mon Apr 18, 2011 10:22 pm

red_team316 wrote:EDIT:
Do not change <string> to <string.h>, or this will cause the test program to fail at make.
I had the same issue using gcc-4.3 on debian. Nevertheless, if you add the library string.h everything works fine for me - including the test program. I think this is a better solution than installing a different compiler... correct me if I'm wrong!

file: dl_writer_ascii.php

Code: Select all

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000

#include <stdio.h>
[b]#include <string.h>[/b]

#include "dl_writer_ascii.h"
#include "dl_exception.h"

Post Reply

Return to “dxflib Troubleshooting and Problems”