Labels

Android (1) bash (2) boost (2) C (34) C++ (2) cheatsheet (2) CLion (6) css (3) Debian (33) DL (17) Docker (1) Dreamweaver (2) Eclipse (3) fail2ban (4) git (5) GitHub (4) Hacking (3) html (8) http (1) iOS (1) iPad (1) IRC (1) Java (30) javascript (3) Linux (164) Mac (19) Machine Learning (1) mySQL (47) Netbeans (4) Networking (1) Nexus (1) OpenVMS (6) Oracle (1) Pandas (3) php (16) Postgresql (8) Python (9) raid (1) RedHat (14) Samba (2) Slackware (45) SQL (14) svn (1) tar (1) ThinkPad (1) Virtualbox (3) Visual Basic (1) Visual Studio (1) Windows (2)

Sunday 20 December 2020

Problem building mesdb

I had trouble building mesdb using Netbeans but note that it did build correctly from the original source on the box, from the command line by running make.

Up to this point, I've had no such issues rebuilding other applications, namely invoice and docugirl. meslink also built fine but that was from the command-line, so doesn't really count towards this issue.

I first noticed this issue wen using my laptop and building remotely to FEC-A but this tree repeated when building on my Mac targeting my restored FEC-A VM

INTERESTINGLY - After a failed build attempt from Netbeans, even trying to build with make from the command line afterwards would fail.


So...

A successful build from the command-line looks like this;



while a failed build from Netbeans looks like the below;





The difference I could see was the build directory, Debug/GNU-Linux-x86 v GNU-Linux

but there had to be something more, so a bit more digging and a weekend later and I found the successful builds to also have -lodbc and -lodbcinst added, as below;


cd '/app/src/mesdb2'
/usr/bin/make -f Makefile CONF=Debug
"/usr/bin/make" -f nbproject/Makefile-Debug.mk QMAKE= SUBPROJECTS= .build-conf
make[1]: Entering directory `/app/src/mesdb2'
"/usr/bin/make"  -f nbproject/Makefile-Debug.mk /app/bin/mesdb
make[2]: Entering directory `/app/src/mesdb2'
mkdir -p build/Debug/GNU-Linux
rm -f "build/Debug/GNU-Linux/mesdb.o.d"
g++    -c -g -w -I../../include -I/pcli/include -I/usr/include/mysql -I/usr/include/mysql++ -MMD -MP -MF "build/Debug/GNU-Linux/mesdb.o.d" -o build/Debug/GNU-Linux/mesdb.o mesdb.cpp
mkdir -p /app/bin
g++     -o /app/bin/mesdb build/Debug/GNU-Linux/mesdb.o -lm -lpthread /pcli/library/libcore.a /pcli/library/libsdd.a
-lmysqlpp -lodbc -lodbcinst
make[2]: Leaving directory `/app/src/mesdb2'
make[1]: Leaving directory `/app/src/mesdb2'

I'm not entirely sure why these are being omitted when trying to build from Netbeans as the makefile is referencing the same files regardless (I think).

Anyway, the image below, shows how/where to add these two missing links;



Continued curiosity revealed that the file nbproject/Makefile-debug.mk

had the following options when build from the command-line

# Link Libraries and Options

LDLIBSOPTIONS=-lm -lpthread /pcli/library/libcore.a /pcli/library/libsdd.a -lmysqlpp -lodbc -lodbcinst


but after attempting to build from Netbeans, it was changed to;


# Link Libraries and Options

LDLIBSOPTIONS=-lm -lpthread /pcli/library/libcore.a /pcli/library/libsdd.a -lmysqlpp


Reason remains unknown but adding the two links as per the image above does resolve and I'm assuming modifies the Makefile-debug.mk file to match the former entry above. (confirmed)



No comments:

Post a Comment

Note: only a member of this blog may post a comment.