Error during compilation C code generated by Cython bad reloc address 0x0 in section `.data' - cython

I'm trying to compile C code generated from Python code (hello world) and I'm stuck on one error.
I'm using mingw32-w64. After many errors now I'm using this command
gcc -DMS_WIN64 -I Python38\include -o test.exe test.c -lpython38 -lm -L Python38\libs -shared -Wl,--enable-auto-image-base -Wl,--enable-auto-import
But I'm getting error
C:\Users\Ja\AppData\Local\Temp\ccqKHihT.o:test.c:(.text+0x28c): undefined reference to `__imp_PyExc_ImportError'
C:\Users\Ja\AppData\Local\Temp\ccqKHihT.o:test.c:(.text+0x307): undefined reference to `__imp__Py_NoneStruct'
C:\Users\Ja\AppData\Local\Temp\ccqKHihT.o:test.c:(.text+0x34c): undefined reference to `__imp_PyExc_AttributeError'
C:\Users\Ja\AppData\Local\Temp\ccqKHihT.o:test.c:(.text+0x59c): undefined reference to `__imp_PyExc_RuntimeError'
C:\Users\Ja\AppData\Local\Temp\ccqKHihT.o:test.c:(.text+0xb51): undefined reference to `__imp_PyExc_ImportError'
C:\Users\Ja\AppData\Local\Temp\ccqKHihT.o:test.c:(.text+0xc23): undefined reference to `__imp_PyExc_NameError'
C:\Users\Ja\AppData\Local\Temp\ccqKHihT.o:test.c:(.text+0xcb9): undefined reference to `__imp__Py_CheckRecursionLimit'
C:\Users\Ja\AppData\Local\Temp\ccqKHihT.o:test.c:(.text+0xd22): undefined reference to `__imp__Py_CheckRecursionLimit'
C:\Users\Ja\AppData\Local\Temp\ccqKHihT.o:test.c:(.text+0xd32): undefined reference to `__imp__Py_CheckRecursionLimit'
C:\Users\Ja\AppData\Local\Temp\ccqKHihT.o:test.c:(.text+0xd40): undefined reference to `__imp__Py_CheckRecursionLimit'
C:\Users\Ja\AppData\Local\Temp\ccqKHihT.o:test.c:(.text+0xd8a): undefined reference to `__imp_PyExc_SystemError'
C:\Users\Ja\AppData\Local\Temp\ccqKHihT.o:test.c:(.text+0xfc4): undefined reference to `__imp__Py_FalseStruct'
C:\Users\Ja\AppData\Local\Temp\ccqKHihT.o:test.c:(.text+0xfcd): undefined reference to `__imp__Py_TrueStruct'
C:\Users\Ja\AppData\Local\Temp\ccqKHihT.o:test.c:(.text+0x101f): undefined reference to `__imp__Py_FalseStruct'
C:\Users\Ja\AppData\Local\Temp\ccqKHihT.o:test.c:(.text+0x1037): undefined reference to `__imp__Py_FalseStruct'
C:\Users\Ja\AppData\Local\Temp\ccqKHihT.o:test.c:(.text+0x1044): undefined reference to `__imp__Py_TrueStruct'
C:\Users\Ja\AppData\Local\Temp\ccqKHihT.o:test.c:(.text+0x17c0): undefined reference to `__imp_PyModule_Type'
C:\Users\Ja\AppData\Local\Temp\ccqKHihT.o:test.c:(.text+0x17d8): undefined reference to `__imp_PyModule_Type'
C:\Users\Ja\AppData\Local\Temp\ccqKHihT.o:test.c:(.text+0x18d4): undefined reference to `__imp_PyBaseObject_Type'
C:\Users\Ja\AppData\Local\Temp\ccqKHihT.o:test.c:(.text+0x1e92): undefined reference to `__imp_PyExc_DeprecationWarning'
C:\Users\Ja\AppData\Local\Temp\ccqKHihT.o:test.c:(.text+0x1ee9): undefined reference to `__imp_PyExc_TypeError'
c:/users/ja/documents/winbuilds/bin/../lib64/gcc/x86_64-w64-mingw32/4.8.3/../../../../x86_64-w64-mingw32/bin/ld.exe: C:\Users\Ja\AppData\Local\Temp\ccqKHihT.o: bad reloc address 0x0 in section `.data'
collect2.exe: error: ld returned 1 exit status
Using Python 3.8.4 x86_64-w64-mingw32 Windows 10

Related

Re-frame dispatches and subscribes not working in the repl and test files

I have a re-frame project, and my events, subs and db cljs files are populated. I use these three in my project and it works well. But I created a test file, and called subscribe and dispatch in it like so:
(deftest category-filter-test
(dispatch [:add-filter "cat"])
(is (= #(subscribe [:filters]) ["cat"]))
)
And that doesn't work. I get
#object[Error Error: No protocol method IDeref.-deref defined for type undefined: ]
On the other hand, if I try to run subscribe in the shadow-cljs repl, I get the following error:
------ WARNING - :undeclared-ns ------------------------------------------------
Resource: :1:2
No such namespace: user, could not locate user.cljs, user.cljc, or JavaScript source providing "user"
--------------------------------------------------------------------------------
------ WARNING - :undeclared-var -----------------------------------------------
Resource: :1:2
Use of undeclared Var user/start
--------------------------------------------------------------------------------
ReferenceError: user is not defined
at eval (eval at shadow$cljs$devtools$client$browser$global_eval (http://localhost:3689/js/workspaces/cljs-runtime/shadow.cljs.devtools.client.browser.js), <anonymous>:1:1)
at eval (<anonymous>)
at Object.shadow$cljs$devtools$client$browser$global_eval [as global_eval] (http://localhost:3689/js/workspaces/cljs-runtime/shadow.cljs.devtools.client.browser.js:758:16)
at eval (http://localhost:3689/js/workspaces/cljs-runtime/shadow.cljs.devtools.client.browser.js:767:44)
at Object.shadow$cljs$devtools$client$env$repl_call [as repl_call] (http://localhost:3689/js/workspaces/cljs-runtime/shadow.cljs.devtools.client.env.js:167:108)
at Object.shadow$cljs$devtools$client$browser$repl_invoke [as repl_invoke] (http://localhost:3689/js/workspaces/cljs-runtime/shadow.cljs.devtools.client.browser.js:766:46)
at shadow$cljs$devtools$client$browser$handle_message (http://localhost:3689/js/workspaces/cljs-runtime/shadow.cljs.devtools.client.browser.js:844:37)
at eval (http://localhost:3689/js/workspaces/cljs-runtime/shadow.cljs.devtools.client.env.js:307:151)
at Object.shadow$cljs$devtools$client$env$process_next_BANG_ [as process_next_BANG_] (http://localhost:3689/js/workspaces/cljs-runtime/shadow.cljs.devtools.client.env.js:289:90)
at Object.shadow$cljs$devtools$client$env$process_ws_msg [as process_ws_msg] (http://localhost:3689/js/workspaces/cljs-runtime/shadow.cljs.devtools.client.env.js:310:40)
How to fix these two errors?

undefined reference to symbol '_ZN12QSqlDatabase11setHostNameERK7QString'

My program has a basic function for adding datas to database but when the code gives an error when it is compiled.
void MainWindow::AddLocationToDatabase()
{
QSqlDatabase db= QSqlDatabase::addDatabase("QMYSQL");
db.setHostName("localhost");
db.setUserName("root");
db.setPassword("*******");
db.setDatabaseName("databasename");
db.setPort(1111);
if(db.open()){
qDebug()<<"connected";
}
}
/usr/bin/ld: build/debug/mainwindow.o: undefined reference to symbol '_ZN12QSqlDatabase11setHostNameERK7QString'
/usr/lib/x86_64-linux-gnu/libQt5Sql.so.5: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status
make: *** [sub-pcapprogram-make_first-ordered] Error 2
06:57:04: The process "/usr/bin/make" exited with code 2.
When executing step "Make"
When I added "QT += sql", there was no error.

undefined reference to `lzma_index_end#XZ_5.0'

I am trying to install caffe, but I got the following error. Exist solution does not work.
System info:
echo $LD_LIBRARY_PATH
/lib/x86_64-linux-gnu:
Error:
//usr/lib/x86_64-linux-gnu/libunwind.so.8: undefined reference to `lzma_index_end#XZ_5.0'
//usr/lib/x86_64-linux-gnu/libunwind.so.8: undefined reference to `lzma_index_size#XZ_5.0'
//usr/lib/x86_64-linux-gnu/libunwind.so.8: undefined reference to `lzma_index_buffer_decode#XZ_5.0'
//usr/lib/x86_64-linux-gnu/libunwind.so.8: undefined reference to `lzma_stream_footer_decode#XZ_5.0'
//usr/lib/x86_64-linux-gnu/libunwind.so.8: undefined reference to `lzma_stream_buffer_decode#XZ_5.0'
//usr/lib/x86_64-linux-gnu/libunwind.so.8: undefined reference to `lzma_index_uncompressed_size#XZ_5.0'
collect2: error: ld returned 1 exit status
tools/CMakeFiles/finetune_net.dir/build.make:133: recipe for target 'tools/finetune_net' failed
make[2]: *** [tools/finetune_net] Error 1
CMakeFiles/Makefile2:435: recipe for target 'tools/CMakeFiles/finetune_net.dir/all' failed
make[1]: *** [tools/CMakeFiles/finetune_net.dir/all] Error 2
Makefile:127: recipe for target 'all' failed
make: *** [all] Error 2

Error in building itk with GDCM git repository

I build ITK with gdcm official release for windows. But its not having some of file that I'm using in further coding. So I have to use git version of gdcm cause its having those which I needed but following error encountered when I am trying to build ITK with ITK_USE_SYSTEM_GDCM and using gdcm git version to build gdcm bin.
>------ Build started: Project: ITKIOGDCM, Configuration: Debug Win32 ------
80>Compiling...
80>itkGDCMImageIO.cxx
80>..\..\..\..\..\src\Modules\IO\GDCM\src\itkGDCMImageIO.cxx(41) : fatal error C1083: Cannot open include file: 'gdcmImageHelper.h': No such file or directory
80>itkGDCMSeriesFileNames.cxx
80>D:\ITK\src\Modules\IO\GDCM\include\itkGDCMSeriesFileNames.h(154) : error C2664: 'void gdcm::SerieHelper::AddRestriction(const gdcm::TagKey &)' : cannot convert parameter 1 from 'const std::string' to 'const gdcm::TagKey &'
80> Reason: cannot convert from 'const std::string' to 'const gdcm::TagKey'
80> No user-defined-conversion operator available that can perform this conversion, or the operator cannot be called
80>..\..\..\..\..\src\Modules\IO\GDCM\src\itkGDCMSeriesFileNames.cxx(29) : error C2248: 'gdcm::SerieHelper::SerieHelper' : cannot access protected member declared in class 'gdcm::SerieHelper'
80> D:\GDCM\gdcm\src\gdcmSerieHelper.h(198) : see declaration of 'gdcm::SerieHelper::SerieHelper'
80> D:\GDCM\gdcm\src\gdcmSerieHelper.h(64) : see declaration of 'gdcm::SerieHelper'
80>..\..\..\..\..\src\Modules\IO\GDCM\src\itkGDCMSeriesFileNames.cxx(160) : error C2027: use of undefined type 'gdcm::File'
80> D:\GDCM\gdcm\src\gdcmSerieHelper.h(34) : see declaration of 'gdcm::File'
80>..\..\..\..\..\src\Modules\IO\GDCM\src\itkGDCMSeriesFileNames.cxx(160) : error C2227: left of '->IsReadable' must point to class/struct/union/generic type
80>..\..\..\..\..\src\Modules\IO\GDCM\src\itkGDCMSeriesFileNames.cxx(163) : error C2027: use of undefined type 'gdcm::File'
80> D:\GDCM\gdcm\src\gdcmSerieHelper.h(34) : see declaration of 'gdcm::File'
80>..\..\..\..\..\src\Modules\IO\GDCM\src\itkGDCMSeriesFileNames.cxx(163) : error C2227: left of '->GetFileName' must point to class/struct/union/generic type
80>..\..\..\..\..\src\Modules\IO\GDCM\src\itkGDCMSeriesFileNames.cxx(166) : error C2027: use of undefined type 'gdcm::File'
80> D:\GDCM\gdcm\src\gdcmSerieHelper.h(34) : see declaration of 'gdcm::File'
80>..\..\..\..\..\src\Modules\IO\GDCM\src\itkGDCMSeriesFileNames.cxx(166) : error C2227: left of '->GetFileName' must point to class/struct/union/generic type
80>itkGDCMImageIOFactory.cxx
80>Generating Code...
80>Build log was saved at "file://d:\ITK\binGDCM\Modules\IO\GDCM\src\ITKIOGDCM.dir\Debug\BuildLog.htm"
80>ITKIOGDCM - 9 error(s), 0 warning(s)
Please help.
You are mixing the very old and deprecated GDCM 1.x with GDCM 2.x. They are actually API incompatible.

Cannot compile MySQL++

I am trying to compile MySQL++ 3.1.0 with the command:
mingw32-make -f Makefile.mingw
After a set of files gets compiled (e.g. beemutex.cpp, cmdline.cpp, connection.cpp, ...), I get these errors:
g++ -c -o mysqlpp_sql_buffer.o -g -mthreads -DUNICODE -D_UNICODE -DMYSQLPP_NO_DLL -DHAVE_MYSQL_SSL_SET -I"C:\Program Files\MySQL\MySQL Server 5.5\include" -MT
mysqlpp_sql_buffer.o -MFmysqlpp_sql_buffer.o.d -MD -MP lib/sql_buffer.cpp
In file included from lib/sql_buffer.h:31:0,
from lib/sql_buffer.cpp:26:
lib/refcounted.h:258:2: error: 'size_t' does not name a type
lib/refcounted.h: In constructor 'mysqlpp::RefCountedPointer<T, Destroyer>::RefCountedPointer()':
lib/refcounted.h:89:2: error: class 'mysqlpp::RefCountedPointer<T, Destroyer>' does not have any field named 'refs_'
lib/refcounted.h: In constructor 'mysqlpp::RefCountedPointer<T, Destroyer>::RefCountedPointer(T*)':
lib/refcounted.h:100:2: error: class 'mysqlpp::RefCountedPointer<T, Destroyer>' does not have any field named 'refs_'
lib/refcounted.h:104:4: error: 'refs_' was not declared in this scope
lib/refcounted.h:104:16: error: expected type-specifier before 'size_t'
lib/refcounted.h:104:16: error: expected ';' before 'size_t'
lib/refcounted.h: In constructor 'mysqlpp::RefCountedPointer<T, Destroyer>::RefCountedPointer(const ThisType&)':
lib/refcounted.h:112:2: error: class 'mysqlpp::RefCountedPointer<T, Destroyer>' does not have any field named 'refs_'
lib/refcounted.h:115:8: error: 'refs_' was not declared in this scope
lib/refcounted.h: In destructor 'mysqlpp::RefCountedPointer<T, Destroyer>::~RefCountedPointer()':
lib/refcounted.h:125:7: error: 'refs_' was not declared in this scope
lib/refcounted.h: In member function 'void mysqlpp::RefCountedPointer<T, Destroyer>::swap(mysqlpp::RefCountedPointer<T, Destroyer>::ThisType&)':
lib/refcounted.h:246:13: error: 'refs_' was not declared in this scope
mingw32-make: *** [mysqlpp_sql_buffer.o] Error 1
Something could be wrong in my configuration, but I can't find what. It seems strange that it cannot find, e.g., size_t.
Thank you!
Platform:
Windows 7
MinGW 2011.09 / GCC 4.6.1
MySQL 5.5
mysql++ 3.1.0
Changing size_t() with std::size_t() in refcounted.h solved the problem. It now compiles.
I still have linking problems, but they should be different issues.