Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

lnk2019 msvc #98

Closed
venjin opened this issue Apr 23, 2023 · 7 comments
Closed

lnk2019 msvc #98

venjin opened this issue Apr 23, 2023 · 7 comments

Comments

@venjin
Copy link

venjin commented Apr 23, 2023

build qxorm on qt 5.14.2 msvc2017 32 bit is success.
than create a test project to use it. show errors lnk2019 class qx::IxDataMemberX::initData.......... and so on.
when qxorm and test both use mingw, they work well, no error.

What should i do to solve this problem?

@QxOrm
Copy link
Owner

QxOrm commented May 2, 2023

Hello, this is complicated to help you on this kind of problem because I think there is something wrong on your dev environment.
I can just confirm that I'm able to build QxOrm library and all its tests project with MSVC2019 (I use cmake to generate the solution files).

QxOrm added a commit that referenced this issue May 29, 2023
- New settings available in the qx::QxSqlDatabase singleton class (setSqlDelimiterForTableNameAlias() and setSqlDelimiterForColumnNameAlias()) to add delimiters to SQL aliases (more details in GitHub issue #57)
- Fix linking error which could occur with Qt6+ and MSVC2019+ (should fix GitHub issues #98, #91, #89, #90, #62, #65)
@QxOrm
Copy link
Owner

QxOrm commented May 31, 2023

Hello, I re-installed a new dev environement and I had the same issue (Qt6.5.1 and MSVC2019).
It should be fixed now if you download latest version of the source code.

@QxOrm QxOrm closed this as completed May 31, 2023
QxOrm added a commit that referenced this issue Jun 5, 2023
- Fix compilation issue with Qt 6.2+ (due to Qt JIRA : https://bugreports.qt.io/browse/QTBUG-92910), more details in GitHub issue #54
- Support QSqlQuery::execBatch() method to improve performance inserting/updating/deleting a list of C++ instances in database (new optional parameter 'bUseExecBatch' available for functions : qx::dao::insert, qx::dao::update, qx::dao::delete_by_id)
- New method in qx::QxSqlQuery class named setFctOnBeforeSqlPrepare() to define a custom callback function to modify SQL query before preparing in database
- New callbacks functions available in qx::IxDataMember interface to customize SQL generated per data member (see an example in ./test/qxBlogCompositeKey/src/blog.cpp file)
- Fix an issue in qx::QxSqlRelationLinked::hierarchyResolveOutput() which could call getIdFromQuery() for nothing, which could generate some warnings in Qt SQL driver (for example : QPSQLResult::data: column XX out of range)
- Fix a compilation issue of QxRestApi and QxHttpTransaction modules with Qt QStringBuilder option enabled (GitHub issues #50, #83)
- Improve SQL DISTINCT to support relationships (unit test available in qxBlog sample project)
- New feature to fetch relationships only in LEFT OUTER/INNER JOIN and WHERE clauses (so no columns in SELECT part) : use {NULL} syntax to define no relation columns in SELECT part (unit test available in qxBlog sample project)
- Fix a crash which could occur using qx::QxSession and multi-threaded environment
- Add a new parameter caseSensitive (default value : false) to the method qx::QxSqlQuery::getSqlResultAt()
- Fix an issue with JSON REST API (QxRestApi module) and MongoDB database (more details in GitHub issue #70)
- Improve qx::QxClassX::registerAllClasses() : init all validator instances (can fix some issues in a multi-thread environment)
- New settings available in the qx::QxSqlDatabase singleton class (setSqlDelimiterForTableNameAlias() and setSqlDelimiterForColumnNameAlias()) to add delimiters to SQL aliases (more details in GitHub issue #57)
- Fix linking error which could occur with Qt6 and MSVC2019 (should fix GitHub issues #98, #91, #89, #90, #62, #65)
- Fix all checks with QT_VERSION (using macro QT_VERSION_CHECK), should fix checks from Qt 5.10 to Qt 5.15 (GitHub issue #81)
@venjin
Copy link
Author

venjin commented Sep 23, 2023

Hello, I re-installed a new dev environement and I had the same issue (Qt6.5.1 and MSVC2019).
It should be fixed now if you download latest version of the source code.

thanks a lot

@venjin
Copy link
Author

venjin commented Nov 11, 2023

The problem always there:

DatabaseDataAccessor.obj:-1: error: LNK2019:  "__declspec(dllimport) public: static class qx::QxClass<struct MachineInformation> * __cdecl qx::QxSingleton<class qx::QxClass<struct MachineInformation> >::getSingleton(void)" (__imp_?getSingleton@?$QxSingleton@V?$QxClass@UMachineInformation@@@qx@@@qx@@SAPAV?$QxClass@UMachineInformation@@@2@XZ), "public: virtual class qx::IxSqlQueryBuilder & __thiscall qx::QxSqlQueryBuilder_FetchAll<struct MachineInformation>::buildSql(class QStringList const &,class qx::QxSqlRelationLinked *)" (?buildSql@?$QxSqlQueryBuilder_FetchAll@UMachineInformation@@@qx@@UAEAAVIxSqlQueryBuilder@2@ABVQStringList@@PAVQxSqlRelationLinked@2@@Z) 
MachineInformation.obj:-1: error: LNK2001:  "__declspec(dllimport) public: static class qx::QxClass<struct MachineInformation> * __cdecl qx::QxSingleton<class qx::QxClass<struct MachineInformation> >::getSingleton(void)" (__imp_?getSingleton@?$QxSingleton@V?$QxClass@UMachineInformation@@@qx@@@qx@@SAPAV?$QxClass@UMachineInformation@@@2@XZ)

@QxOrm
Copy link
Owner

QxOrm commented Nov 13, 2023

Hello,
You should not have the issue now with the latest version.
Are you able to build and execute without errors or assertions the examples projects from the ./test/ directory of QxOrm package ?
If yes, then the issue is on your project side.

@venjin
Copy link
Author

venjin commented Nov 14, 2023

Hello,
You should not have the issue now with the latest version.
Are you able to build and execute without errors or assertions the examples projects from the ./test/ directory of QxOrm package ?
If yes, then the issue is on your project side.

Hi,
I have found that the issue is on my project.
I have not set dllexport.
Thanks a lot!!!

@QxOrm
Copy link
Owner

QxOrm commented Nov 15, 2023

Great :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants