Author Topic: Beginner: undefined reference to vswscanf...  (Read 4871 times)

Offline hexadecimal

  • Single posting newcomer
  • *
  • Posts: 2
Beginner: undefined reference to vswscanf...
« on: May 10, 2017, 10:34:27 pm »
Hello everybody, I'm a completely beginner with Code :: Blocks and I get this build log when I try to compile with mingw-w64-project.


||=== Build: Debug in Instalador (compiler: GNU GCC Compiler) ===|
C:\wxWidgets-3.0.3\lib\gcc_lib\libwxmsw30u.a(monolib_fmapbase.o):fmapbase.cpp|| undefined reference to `__mingw_vswscanf'|
C:\wxWidgets-3.0.3\lib\gcc_lib\libwxmsw30u.a(monolib_string.o):string.cpp|| undefined reference to `__mingw_wcstod'|
C:\wxWidgets-3.0.3\lib\gcc_lib\libwxmsw30u.a(monolib_txtstrm.o):txtstrm.cpp|| undefined reference to `__mingw_wcstod'|
C:\wxWidgets-3.0.3\lib\gcc_lib\libwxmsw30u.a(monolib_wxcrt.o):wxcrt.cpp|| undefined reference to `__mingw_vswprintf'|
C:\wxWidgets-3.0.3\lib\gcc_lib\libwxmsw30u.a(monolib_wxcrt.o):wxcrt.cpp|| undefined reference to `__mingw_vsscanf'|
C:\wxWidgets-3.0.3\lib\gcc_lib\libwxmsw30u.a(monolib_wxcrt.o):wxcrt.cpp|| undefined reference to `__mingw_vsscanf'|
C:\wxWidgets-3.0.3\lib\gcc_lib\libwxmsw30u.a(monolib_wxcrt.o):wxcrt.cpp|| undefined reference to `__mingw_vswscanf'|
C:\wxWidgets-3.0.3\lib\gcc_lib\libwxmsw30u.a(monolib_wxcrt.o):wxcrt.cpp|| undefined reference to `__mingw_vswprintf'|
C:\wxWidgets-3.0.3\lib\gcc_lib\libwxmsw30u.a(monolib_wxcrt.o):wxcrt.cpp|| undefined reference to `__mingw_vsscanf'|
C:\wxWidgets-3.0.3\lib\gcc_lib\libwxmsw30u.a(monolib_wxcrt.o):wxcrt.cpp|| undefined reference to `__mingw_vswscanf'|
C:\wxWidgets-3.0.3\lib\gcc_lib\libwxmsw30u.a(monolib_wxcrt.o):wxcrt.cpp|| undefined reference to `__mingw_vsscanf'|
C:\wxWidgets-3.0.3\lib\gcc_lib\libwxmsw30u.a(monolib_wxcrt.o):wxcrt.cpp|| undefined reference to `__mingw_vswscanf'|
C:\wxWidgets-3.0.3\lib\gcc_lib\libwxmsw30u.a(monolib_wxcrt.o):wxcrt.cpp|| undefined reference to `__mingw_vswscanf'|
C:\wxWidgets-3.0.3\lib\gcc_lib\libwxmsw30u.a(monolib_xlocale.o):xlocale.cpp|| undefined reference to `__mingw_wcstod'|
C:\wxWidgets-3.0.3\lib\gcc_lib\libwxmsw30u.a(monolib_xlocale.o):xlocale.cpp|| undefined reference to `__mingw_strtod'|
C:\wxWidgets-3.0.3\lib\gcc_lib\libwxmsw30u.a(monolib_basemsw.o):basemsw.cpp|| undefined reference to `__mingw_vfwprintf'|
C:\wxWidgets-3.0.3\lib\gcc_lib\libwxmsw30u.a(monolib_fontutil.o):fontutil.cpp|| undefined reference to `__mingw_vswscanf'|
C:\wxWidgets-3.0.3\lib\gcc_lib\libwxmsw30u.a(monolib_msw_textctrl.o):textctrl.cpp|| undefined reference to `__mingw_vswscanf'|
C:\wxWidgets-3.0.3\lib\gcc_lib\libwxmsw30u.a(monolib_colourcmn.o):colourcmn.cpp|| undefined reference to `__mingw_vsscanf'|
C:\wxWidgets-3.0.3\lib\gcc_lib\libwxmsw30u.a(monolib_colourcmn.o):colourcmn.cpp|| undefined reference to `__mingw_vswscanf'|
C:\wxWidgets-3.0.3\lib\gcc_lib\libwxmsw30u.a(monolib_xpmdecod.o):xpmdecod.cpp|| undefined reference to `__mingw_vsscanf'|
||error: ld returned 1 exit status|
||=== Build failed: 22 error(s), 0 warning(s) (0 minute(s), 2 second(s)) ===


I searched the forum, the most similar thing I've seen has been this:
http://forums.codeblocks.org/index.php?topic=15436.0
But I already have the compiled libraries, or so I think, I have gcc_mswu and gcc_mswud folders in build/msw
Could this be a linker error or in relation to compiler options?

Sorry for my english.
Thanks in advance.

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: Beginner: undefined reference to vswscanf...
« Reply #1 on: May 11, 2017, 09:15:43 am »
If you've not compiled wxwidgets yourself then you're most probably mixing compilers which is not a good idea.
You'll have to use the wxwidgets' compiler or rebuild wxwidgets with your compiler.

p.s. This is topic is violating our forum's rules, because it is generic programming question!
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline hexadecimal

  • Single posting newcomer
  • *
  • Posts: 2
Re: Beginner: undefined reference to vswscanf...
« Reply #2 on: May 11, 2017, 01:42:36 pm »
How could I not have compiled wxwidgets? It would help to respond with the most appropriate compiler, a response that should be simple. It seems the right place to do this question since there is no error during compilation but if it is presented in the IDE I am also sure that I compiled with this compiler.

Offline sodev

  • Regular
  • ***
  • Posts: 498
Re: Beginner: undefined reference to vswscanf...
« Reply #3 on: May 11, 2017, 03:01:19 pm »
How could I not have compiled wxwidgets?

You could have downloaded a binary release? Well, its quite easy to figure out if you compiled wxWidgets or not. Have you ever typed something like that in the build directory of a wxWidgets source tree:
Code
mingw32-make -f makefile.gcc SHARED=1 MONOLITHIC=1 BUILD=release UNICODE=1
Yes? You compiled wxWidgets. No? You did not compile wxWidgets.

Quote
It would help to respond with the most appropriate compiler, a response that should be simple.

Your linker errors indicate that c library functions cannot be found, this can either be the highly unlikely case that you explicit dont link the standard c library or the very likely case that you have a compiler mismatch and the functions cannot be found because of different name mangling.

So the most appropriate compiler is the one that was used to compile wxWidgets, since you didnt tell us which compiler that was, no one can give you an answer.

Quote
It seems the right place to do this question since there is no error during compilation but if it is presented in the IDE I am also sure that I compiled with this compiler.
My magical skills end here, i dont know what you are saying here. Your post indicates a linker error, CodeBlocks != (compiler || linker), here you can only receive support for CodeBlocks issues, please go to a forum for c++ programming beginners to get aid to solve your compiler and linker issues.

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7590
    • My Best Post
Re: Beginner: undefined reference to vswscanf...
« Reply #4 on: May 11, 2017, 06:03:21 pm »
Quote
Could this be a linker error or in relation to compiler options?
Edit: Since you failed to post the build log; no one can answer this question!


FYI: I have had linking [errors] that are not like the above compiling monolithic wxWidgets DLL/Shared with MinGW64 that I traced to the MinGW64 C-Runtime (CRT) Library. The errors do not happen with multi-lib (Non-monolithic)  DLL/Shared build.
In other words, the OP problem is not like the errors that I got.

To original poster (OP): You need to learn how to post a full build log on a website like https://forums.wxwidgets.org/.
http://wiki.codeblocks.org/index.php/FAQ-Compiling_%28errors%29#Q:_How_do_I_troubleshoot_a_compiler_problem.3F

They are not an English only site; so, you might try posting in both English and another language.

Tim S.
« Last Edit: May 11, 2017, 06:27:48 pm by stahta01 »
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org