Code::Blocks Forums

User forums => Using Code::Blocks => Topic started by: msdobrescu on July 23, 2016, 11:27:52 am

Title: Cannot find libs ... but they are there...
Post by: msdobrescu on July 23, 2016, 11:27:52 am
Hello,

I am trying to get rid of the MSCV++ 2015 compiler for a project due to its returning bug (find it here: https://connect.microsoft.com/VisualStudio/feedback/details/1853228/lnk1179-invalid-or-corrupt-obj-file-created-by-vs-2015-rtm-compiler-in-debug-builds).
Despite MSVC++ 2015 is pretty advanced in templates (it needs less "template" and "typename" keywords than gcc for the moment as it deduces well the purpose of a A::B::C or A::B::C::F() construct), I need to go with something closer to the standard.

I have an Adobe Illustrator plugin made with Adobe's template, which is MSVC++ based. I have installed Code::Blocks 16.01 and TDM-GCC-64 compiler under, configured the compiler, imported the MSCV++ project into C::B, configured the paths to the headers and libs in the project.

The project compiles pretty well under 64bit, much faster than MSVC++ (after some "template" and "typename" keywords  here and there), but it fails linking:

Code

-------------- Build: Debug x64 in jScriptor (compiler: TDM-GCC-64)---------------

x86_64-w64-mingw32-g++.exe -shared -Wl,--output-def=libjScriptor.def -Wl,--out-implib=libjScriptor.a -Wl,--dll -L..\..\Mozilla\SpiderMonkey\mozjs-45.0.2\js\src\build_OPT.OBJ\dist\sdk\lib -L..\..\Mozilla\SpiderMonkey\mozjs-45.0.2\js\src\build_OPT.OBJ\dist\sdk\lib -L"C:\Program Files (x86)\Windows Kits\10\Lib\10.0.10586.0\um\x64" ".objs\Adobe\sdk\Adobe Illustrator CC_2015.3 SDK\illustratorapi\illustrator\IAIFilePath.o" ".objs\Adobe\sdk\Adobe Illustrator CC_2015.3 SDK\illustratorapi\illustrator\IAIStringFormatUtils.o" ".objs\Adobe\sdk\Adobe Illustrator CC_2015.3 SDK\illustratorapi\illustrator\IAIUnicodeString.o" ".objs\Adobe\sdk\Adobe Illustrator CC_2015.3 SDK\samplecode\common\source\AppContext.o" ".objs\Adobe\sdk\Adobe Illustrator CC_2015.3 SDK\samplecode\common\source\HtmlUIController.o" ".objs\Adobe\sdk\Adobe Illustrator CC_2015.3 SDK\samplecode\common\source\IllustratorSDK.o" ".objs\Adobe\sdk\Adobe Illustrator CC_2015.3 SDK\samplecode\common\source\Main.o" ".objs\Adobe\sdk\Adobe Illustrator CC_2015.3 SDK\samplecode\common\source\Plugin.o" ".objs\Adobe\sdk\Adobe Illustrator CC_2015.3 SDK\samplecode\common\source\SDKAboutPluginsHelper.o" ".objs\Adobe\sdk\Adobe Illustrator CC_2015.3 SDK\samplecode\common\source\SDKErrors.o" ".objs\Adobe\sdk\Adobe Illustrator CC_2015.3 SDK\samplecode\common\source\SDKPlugPlug.o" ".objs\Adobe\sdk\Adobe Illustrator CC_2015.3 SDK\samplecode\common\source\Suites.o" ".objs\jScriptor\jScriptor\Integration\Adobe Illustrator\jsActionDialogStatus.o" ".objs\jScriptor\jScriptor\Integration\Adobe Illustrator\jsAIArtboardLayout.o" ".objs\jScriptor\jScriptor\Integration\Adobe Illustrator\jsAIArtType.o" ".objs\jScriptor\jScriptor\Integration\Adobe Illustrator\jsAIBoolean.o" ".objs\jScriptor\jScriptor\Integration\Adobe Illustrator\jsAIColorModel.o" ".objs\jScriptor\jScriptor\Integration\Adobe Illustrator\jsAIColorProfile.o" ".objs\jScriptor\jScriptor\Integration\Adobe Illustrator\jsAICropMarkStyle.o" ".objs\jScriptor\jScriptor\Integration\Adobe Illustrator\jsAIDictionary.o" ".objs\jScriptor\jScriptor\Integration\Adobe Illustrator\jsAIDocumentColorModelValue.o" ".objs\jScriptor\jScriptor\Integration\Adobe Illustrator\jsAIDocumentFileFormatParameters.o" ".objs\jScriptor\jScriptor\Integration\Adobe Illustrator\jsAIDocumentHandle.o" ".objs\jScriptor\jScriptor\Integration\Adobe Illustrator\jsAIDocumentListSuite.o" ".objs\jScriptor\jScriptor\Integration\Adobe Illustrator\jsAIDocumentMiPrintRecord.o" ".objs\jScriptor\jScriptor\Integration\Adobe Illustrator\jsAIDocumentPlatformPrintRecord.o" ".objs\jScriptor\jScriptor\Integration\Adobe Illustrator\jsAIDocumentRulerUnitValue.o" ".objs\jScriptor\jScriptor\Integration\Adobe Illustrator\jsAIDocumentSetup.o" ".objs\jScriptor\jScriptor\Integration\Adobe Illustrator\jsAIDocumentStartupProfile.o" ".objs\jScriptor\jScriptor\Integration\Adobe Illustrator\jsAIDocumentSuite.o" ".objs\jScriptor\jScriptor\Integration\Adobe Illustrator\jsAIDocumentVersionInfo.o" ".objs\jScriptor\jScriptor\Integration\Adobe Illustrator\jsAIErr.o" ".objs\jScriptor\jScriptor\Integration\Adobe Illustrator\jsAIFileFormatHandle.o" ".objs\jScriptor\jScriptor\Integration\Adobe Illustrator\jsAIFileFormatOptions.o" ".objs\jScriptor\jScriptor\Integration\Adobe Illustrator\jsAIFileFormatSuite.o" ".objs\jScriptor\jScriptor\Integration\Adobe Illustrator\jsAIFilePath.o" ".objs\jScriptor\jScriptor\Integration\Adobe Illustrator\jsAIInt16.o" ".objs\jScriptor\jScriptor\Integration\Adobe Illustrator\jsAIInt32.o" ".objs\jScriptor\jScriptor\Integration\Adobe Illustrator\jsAINewDocumentPreset.o" ".objs\jScriptor\jScriptor\Integration\Adobe Illustrator\jsAIPreviewMode.o" ".objs\jScriptor\jScriptor\Integration\Adobe Illustrator\jsAIRasterResolution.o" ".objs\jScriptor\jScriptor\Integration\Adobe Illustrator\jsAIReal.o" ".objs\jScriptor\jScriptor\Integration\Adobe Illustrator\jsAIRealPoint.o" ".objs\jScriptor\jScriptor\Integration\Adobe Illustrator\jsAIRealRect.o" ".objs\jScriptor\jScriptor\Integration\Adobe Illustrator\jsAIRect.o" ".objs\jScriptor\jScriptor\Integration\Adobe Illustrator\jsAISpotColorMode.o" ".objs\jScriptor\jScriptor\Integration\Adobe Illustrator\jsAITransparencyGrid.o" ".objs\jScriptor\jScriptor\Integration\Adobe Illustrator\jsAIUint32.o" ".objs\jScriptor\jScriptor\Integration\Adobe Illustrator\jsAIUnicodeString.o" ".objs\jScriptor\jScriptor\Integration\Adobe Illustrator\jsAIVersion.o" ".objs\jScriptor\jScriptor\Integration\Adobe Text Engine\jsATEDocumentTextResources.o" ".objs\jScriptor\jScriptor\Integration\Adobe Text Engine\jsATEStory.o" ".objs\jScriptor\jScriptor\Integration\Adobe Text Engine\jsATETextRanges.o" .objs\jScriptor\jScriptor\Integration\jsClass.o .objs\jScriptor\jScriptor\Integration\jsConvert.o .objs\jScriptor\jScriptor\Integration\jsError.o .objs\jScriptor\jScriptor\Integration\jsProperty.o .objs\jScriptor\jScriptor\Integration\jsRTTI.o .objs\jScriptor\jScriptor\Integration\jsSuites.o .objs\jScriptor\jScriptor\Integration\jsTestSuite.o .objs\jScriptor\jScriptor\Integration\Native\jsBool.o .objs\jScriptor\jScriptor\Integration\Native\jsChar.o .objs\jScriptor\jScriptor\Integration\Native\jsCharArray.o .objs\jScriptor\jScriptor\Integration\Native\jsConstCharArray.o .objs\jScriptor\jScriptor\Integration\Native\jsFourCharacterCode.o .objs\jScriptor\jScriptor\Integration\Native\jsShort.o .objs\jScriptor\jScriptor\Integration\Native\jsVoid.o ".objs\jScriptor\jScriptor\Integration\Sweet Pea\jsPIProperty.o" ".objs\jScriptor\jScriptor\Integration\Sweet Pea\jsPIType.o" ".objs\jScriptor\jScriptor\Integration\Sweet Pea\jsSPErr.o" ".objs\jScriptor\jScriptor\Integration\Sweet Pea\jsSPErrorData.o" ".objs\jScriptor\jScriptor\Integration\Sweet Pea\jsSPPlatformFileReference.o" ".objs\jScriptor\jScriptor\Integration\Sweet Pea\jsSPPlugin.o" ".objs\jScriptor\jScriptor\Integration\Sweet Pea\jsSPPluginList.o" ".objs\jScriptor\jScriptor\Integration\Sweet Pea\jsSPPluginListIterator.o" ".objs\jScriptor\jScriptor\Integration\Sweet Pea\jsSPPluginsSuite.o" ".objs\jScriptor\jScriptor\Integration\Sweet Pea\jsSPStringPool.o" ".objs\jScriptor\jScriptor\Integration\Sweet Pea\jsSPStringsSuite.o" .objs\jScriptor\jScriptor\Source\jScriptorFileHelper.o .objs\jScriptor\jScriptor\Source\jScriptorLog.o .objs\jScriptor\jScriptor\Source\jScriptorPanelController.o .objs\jScriptor\jScriptor\Source\jScriptorParameter.o .objs\jScriptor\jScriptor\Source\jScriptorPlugin.o .objs\jScriptor\jScriptor\Source\jScriptorPreferences.o .objs\jScriptor\jScriptor\Source\jScriptorPromptDialog.o .objs\jScriptor\jScriptor\Source\jScriptorSuites.o .objs\jScriptor\jScriptor\Source\jScriptorTokenisor.o .objs\jScriptor\jScriptor\Source\jScriptorUtils.o .objs\jScriptor\jScriptor\Source\jsEngine.o .objs\jScriptor\jScriptor\Source\utils.o  .objs\jScriptor\jScriptor\Resources\Win\jScriptor.res -o jScriptor.dll -m64  -lkernel32.lib -luser32.lib -lgdi32.lib -lwinspool.lib -lcomdlg32.lib -ladvapi32.lib -lshell32.lib -lole32.lib -loleaut32.lib -luuid.lib -lodbc32.lib -lodbccp32.lib -lmozjs-45.lib -lkernel32.lib -luser32.lib -lgdi32.lib -lwinspool.lib -lcomdlg32.lib -ladvapi32.lib -lshell32.lib -lole32.lib -loleaut32.lib -luuid.lib -lodbc32.lib -lodbccp32.lib -lmozjs-45.lib
M:/Development/Tools/c++/CodeBlocks/windows/codeblocks/TDM-GCC-64/bin/../lib/gcc/x86_64-w64-mingw32/5.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: cannot find -lkernel32.lib
M:/Development/Tools/c++/CodeBlocks/windows/codeblocks/TDM-GCC-64/bin/../lib/gcc/x86_64-w64-mingw32/5.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: cannot find -luser32.lib
M:/Development/Tools/c++/CodeBlocks/windows/codeblocks/TDM-GCC-64/bin/../lib/gcc/x86_64-w64-mingw32/5.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: cannot find -lgdi32.lib
M:/Development/Tools/c++/CodeBlocks/windows/codeblocks/TDM-GCC-64/bin/../lib/gcc/x86_64-w64-mingw32/5.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: cannot find -lwinspool.lib
M:/Development/Tools/c++/CodeBlocks/windows/codeblocks/TDM-GCC-64/bin/../lib/gcc/x86_64-w64-mingw32/5.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: cannot find -lcomdlg32.lib
M:/Development/Tools/c++/CodeBlocks/windows/codeblocks/TDM-GCC-64/bin/../lib/gcc/x86_64-w64-mingw32/5.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: cannot find -ladvapi32.lib
M:/Development/Tools/c++/CodeBlocks/windows/codeblocks/TDM-GCC-64/bin/../lib/gcc/x86_64-w64-mingw32/5.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: cannot find -lshell32.lib
M:/Development/Tools/c++/CodeBlocks/windows/codeblocks/TDM-GCC-64/bin/../lib/gcc/x86_64-w64-mingw32/5.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: cannot find -lole32.lib
M:/Development/Tools/c++/CodeBlocks/windows/codeblocks/TDM-GCC-64/bin/../lib/gcc/x86_64-w64-mingw32/5.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: cannot find -loleaut32.lib
M:/Development/Tools/c++/CodeBlocks/windows/codeblocks/TDM-GCC-64/bin/../lib/gcc/x86_64-w64-mingw32/5.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: cannot find -luuid.lib
M:/Development/Tools/c++/CodeBlocks/windows/codeblocks/TDM-GCC-64/bin/../lib/gcc/x86_64-w64-mingw32/5.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: cannot find -lodbc32.lib
M:/Development/Tools/c++/CodeBlocks/windows/codeblocks/TDM-GCC-64/bin/../lib/gcc/x86_64-w64-mingw32/5.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: cannot find -lodbccp32.lib
M:/Development/Tools/c++/CodeBlocks/windows/codeblocks/TDM-GCC-64/bin/../lib/gcc/x86_64-w64-mingw32/5.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: cannot find -lmozjs-45.lib
M:/Development/Tools/c++/CodeBlocks/windows/codeblocks/TDM-GCC-64/bin/../lib/gcc/x86_64-w64-mingw32/5.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: cannot find -lkernel32.lib
M:/Development/Tools/c++/CodeBlocks/windows/codeblocks/TDM-GCC-64/bin/../lib/gcc/x86_64-w64-mingw32/5.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: cannot find -luser32.lib
M:/Development/Tools/c++/CodeBlocks/windows/codeblocks/TDM-GCC-64/bin/../lib/gcc/x86_64-w64-mingw32/5.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: cannot find -lgdi32.lib
M:/Development/Tools/c++/CodeBlocks/windows/codeblocks/TDM-GCC-64/bin/../lib/gcc/x86_64-w64-mingw32/5.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: cannot find -lwinspool.lib
M:/Development/Tools/c++/CodeBlocks/windows/codeblocks/TDM-GCC-64/bin/../lib/gcc/x86_64-w64-mingw32/5.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: cannot find -lcomdlg32.lib
M:/Development/Tools/c++/CodeBlocks/windows/codeblocks/TDM-GCC-64/bin/../lib/gcc/x86_64-w64-mingw32/5.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: cannot find -ladvapi32.lib
M:/Development/Tools/c++/CodeBlocks/windows/codeblocks/TDM-GCC-64/bin/../lib/gcc/x86_64-w64-mingw32/5.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: cannot find -lshell32.lib
M:/Development/Tools/c++/CodeBlocks/windows/codeblocks/TDM-GCC-64/bin/../lib/gcc/x86_64-w64-mingw32/5.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: cannot find -lole32.lib
M:/Development/Tools/c++/CodeBlocks/windows/codeblocks/TDM-GCC-64/bin/../lib/gcc/x86_64-w64-mingw32/5.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: cannot find -loleaut32.lib
M:/Development/Tools/c++/CodeBlocks/windows/codeblocks/TDM-GCC-64/bin/../lib/gcc/x86_64-w64-mingw32/5.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: cannot find -luuid.lib
M:/Development/Tools/c++/CodeBlocks/windows/codeblocks/TDM-GCC-64/bin/../lib/gcc/x86_64-w64-mingw32/5.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: cannot find -lodbc32.lib
M:/Development/Tools/c++/CodeBlocks/windows/codeblocks/TDM-GCC-64/bin/../lib/gcc/x86_64-w64-mingw32/5.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: cannot find -lodbccp32.lib
M:/Development/Tools/c++/CodeBlocks/windows/codeblocks/TDM-GCC-64/bin/../lib/gcc/x86_64-w64-mingw32/5.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: cannot find -lmozjs-45.lib
C:\Program Files (x86)\Windows Kits\10\Lib\10.0.10586.0\um\x64/kernel32.lib: error adding symbols: File in wrong format
collect2.exe: error: ld returned 1 exit status
Process terminated with status 1 (0 minute(s), 15 second(s))
27 error(s), 0 warning(s) (0 minute(s), 15 second(s))

I see some libs duplicated, probably they are added by the compiler itself. Note, my libs from Windows SDK are on a path with spaces because Windows SDK traditionally installs in C:\Program Files (x86)\Windows SDK\10....

What can I do to fix this, as it is my first project on a gcc compiler from scratch?

Thank you.
Title: Re: Cannot find libs ... but they are there...
Post by: BlueHazzard on July 23, 2016, 01:39:06 pm
you can try to remove the .lib extension from the libraries in your project settings
Title: Re: Cannot find libs ... but they are there...
Post by: msdobrescu on July 23, 2016, 01:52:35 pm
I have removed the redundant entries (for each profile and the root profile I've put the libs, thus the duplication.
I have removed the .lib extension and the error stays the same, nothing changed.
Title: Re: Cannot find libs ... but they are there...
Post by: BlueHazzard on July 23, 2016, 03:05:35 pm
Code
C:\Program Files (x86)\Windows Kits\10\Lib\10.0.10586.0\um\x64/kernel32.lib: error adding symbols: File in wrong format
this looks like that you try to use a library not compiled with your compiler version (probably compiled with mvc and not gcc, so it is not possible to use this library...)

Have you checked the paths to the libraries? Also check that you don't have a second mingw installation in your PATH environment variables...
Title: Re: Cannot find libs ... but they are there...
Post by: msdobrescu on July 23, 2016, 03:26:51 pm
I don't find any other MinGW unless C::B uses some internally if there are several compilers installed in C::B.
I did not find any gcc version of the kernel32 library, for example.
Title: Re: Cannot find libs ... but they are there...
Post by: BlueHazzard on July 23, 2016, 03:37:43 pm
in my installation they are under

MINGW\lib

and is called libkernel32.a

but the linker will find it if the library name in your project is "kernel32"

can you try to rebuild the source (Build->Rebuild) and post the full build log in code tags?
Title: Re: Cannot find libs ... but they are there...
Post by: msdobrescu on July 23, 2016, 05:29:44 pm
There is none, I might have missed something at installation time...?
Title: Re: Cannot find libs ... but they are there...
Post by: msdobrescu on July 23, 2016, 05:42:12 pm
It might seem offtopic but...

Right now, I need to build SpiderMonkey on mingw under Windows.
So, I have installed mozilla-build. It uses msvc++. I have altered some configuration file to take gcc and g++ instead of cl.
When I run configure, it displays

Code
checking for as... /m/Development/Tools/c++/CodeBlocks/windows/codeblocks/TDM-GCC-64/bin/as

This is the compiler I use under C::B, C::B is closed now, I have nothing related to this on PATH or other variable.

This is weird.
Title: Re: Cannot find libs ... but they are there...
Post by: BlueHazzard on July 23, 2016, 09:03:08 pm
There is none, I might have missed something at installation time...?
probably not, more likely a configuration error with the paths, or naming of the libraries... post a FULL REBUILD LOG...


Title: Re: Cannot find libs ... but they are there...
Post by: msdobrescu on July 24, 2016, 07:31:52 am
I'll do it as soon as I could, but first I need to link against a SpiderMonkey 45 build that I don't have. Nobody seems to be able to build it with mingw. Is there no project using it and building it with mingw?
Title: Re: Cannot find libs ... but they are there...
Post by: msdobrescu on July 24, 2016, 01:12:43 pm
As I couldn't find any way to build SpiderMonkey with mingw, I have converted the dll to lib:

Code
cd M:/dev/jScriptor/Mozilla/SpiderMonkey/mozjs-45.0.2/js/src/build_OPT.OBJ/dist/sdk/lib

M:/Development/codeblocks/TDM-GCC-64/x86_64-w64-mingw32/bin/gendef ../../bin/mozjs-45.dll
M:/Development/codeblocks/TDM-GCC-64/x86_64-w64-mingw32/bin/dlltool --as-flags=--64 -m i386:x86-64 -k --output-lib mozjs-45.a --input-def mozjs-45.def

The tool says ' -m i386:x86-64' is default.

Now, a full build is attached, as requested.

I did not add system libs so far, I won't, unless it asks for some of their functions.
Title: Re: Cannot find libs ... but they are there...
Post by: BlueHazzard on July 24, 2016, 02:27:43 pm
well now you are missing libraries obviously...
Title: Re: Cannot find libs ... but they are there...
Post by: msdobrescu on July 24, 2016, 02:45:08 pm
I don't know...
I have changed the names of the libs and it says it can not find them.
It finds them, but might be something related to naming?
Title: Re: Cannot find libs ... but they are there...
Post by: msdobrescu on July 24, 2016, 02:57:01 pm
I have found and added all the system libs, but thay are not used, IMHO.
It is an Illustrator plugin without GUI and special OS stuff.
They are just added by the project template "for future use".
The imported lib from the dll seems to be the issue, as all the errors are from it.
Until it doesn't pass that, I won't know it will throw some other errors.
Title: Re: Cannot find libs ... but they are there...
Post by: msdobrescu on July 24, 2016, 03:06:41 pm
Just to illustrate, the generated def file has naming like this:

Code
?JS_GetPrivate@@YAPEAXPEAVJSObject@@@Z

while the linker says:

Code
undefined reference to `__imp__Z13JS_GetPrivateP8JSObject'

What should I deduce from this?
Title: Re: Cannot find libs ... but they are there...
Post by: msdobrescu on July 24, 2016, 06:10:07 pm
I think there is a conflict between what gendef exports and what the linker expects as naming.
Any ideas?
Title: Re: Cannot find libs ... but they are there...
Post by: msdobrescu on July 25, 2016, 09:51:42 am
So mangling for msvc++ and gnu c++ differs. Is there any solution, or should I try to build anything with MinGW?
Title: Re: Cannot find libs ... but they are there...
Post by: msdobrescu on August 15, 2016, 11:58:32 pm
Well, I've managed to build SpiderMokey with MinGW-w64.
Now, I get linkage errors 'multiple definition of...' for everything.
That code compiles under msvc.
I presume there is an issue with the project...?
I do not include cpp in cpp or h.
Any ideas?
Thanks.
Title: Re: Cannot find libs ... but they are there...
Post by: stahta01 on August 16, 2016, 03:15:49 am
You did something wrong; with out more info no one can do anything but guess.

Tim S.
Title: Re: Cannot find libs ... but they are there...
Post by: msdobrescu on August 19, 2016, 05:47:40 pm
Yes, of course, but what? I have a project with tens if not hundreds of files.
How could I know? What should I post?
Title: Re: Cannot find libs ... but they are there...
Post by: stahta01 on August 19, 2016, 06:28:48 pm
Why NOT try posting a build log. So, we can at least see the errors!

http://wiki.codeblocks.org/index.php/FAQ-Compiling_%28errors%29#Q:_How_do_I_troubleshoot_a_compiler_problem.3F (http://wiki.codeblocks.org/index.php/FAQ-Compiling_%28errors%29#Q:_How_do_I_troubleshoot_a_compiler_problem.3F)

Tim S.
Title: Re: Cannot find libs ... but they are there...
Post by: msdobrescu on August 20, 2016, 02:40:19 pm
OK. I have Code::Blocks 16.01 + MinGW-w64 x86_64-6.1.0-win32-seh-rt_v5-rev0.

The build log is attached...
Title: Re: Cannot find libs ... but they are there...
Post by: stahta01 on August 20, 2016, 03:13:05 pm
Please read the build log!!

Please look at lines 55 and 66 of  "sdk/Adobe Illustrator CC_2015.3 SDK/illustratorapi/illustrator/IAIAutoBuffer.cpp"

Then fix the problem.

Edit: You may need to search for all places AllocateBlock and DeleteBlock are defined.

Tim S.

Code
sdk/Adobe Illustrator CC_2015.3 SDK/illustratorapi/illustrator/IAIAutoBuffer.cpp:55: first defined here
sdk/Adobe Illustrator CC_2015.3 SDK/illustratorapi/illustrator/IAIAutoBuffer.cpp:66: first defined here

Code
x86_64-w64-mingw32-g++.exe -shared   -Wl,--dll -L..\..\Mozilla\SpiderMonkey\mozjs-45.0.2.mingw\js\src\build_DBG.OBJ\dist\sdk\lib ".objs\Adobe\sdk\Adobe Illustrator CC_2015.3 SDK\illustratorapi\ate\IText.o" ".objs\Adobe\sdk\Adobe Illustrator CC_2015.3 SDK\illustratorapi\ate\IThrowException.o" ".objs\Adobe\sdk\Adobe Illustrator CC_2015.3 SDK\illustratorapi\illustrator\ASMemory.o" ".objs\Adobe\sdk\Adobe Illustrator CC_2015.3 SDK\illustratorapi\illustrator\IAIArtboards.o" ".objs\Adobe\sdk\Adobe Illustrator CC_2015.3 SDK\illustratorapi\illustrator\IAIAutoBuffer.o" ".objs\Adobe\sdk\Adobe Illustrator CC_2015.3 SDK\illustratorapi\illustrator\IAIColorSpace.o" ".objs\Adobe\sdk\Adobe Illustrator CC_2015.3 SDK\illustratorapi\illustrator\IAIFilePath.o" ".objs\Adobe\sdk\Adobe Illustrator CC_2015.3 SDK\illustratorapi\illustrator\IAIRefAutoSuite.o" ".objs\Adobe\sdk\Adobe Illustrator CC_2015.3 SDK\illustratorapi\illustrator\IAIStringFormatUtils.o" ".objs\Adobe\sdk\Adobe Illustrator CC_2015.3 SDK\illustratorapi\illustrator\IAIUnicodeString.o" ".objs\jScriptor\jScriptor\Integration\Adobe Illustrator\jsActionDialogStatus.o" ".objs\jScriptor\jScriptor\Integration\Adobe Illustrator\jsAIArtboardLayout.o" ".objs\jScriptor\jScriptor\Integration\Adobe Illustrator\jsAIArtType.o" ".objs\jScriptor\jScriptor\Integration\Adobe Illustrator\jsAIBoolean.o" ".objs\jScriptor\jScriptor\Integration\Adobe Illustrator\jsAIColorModel.o" ".objs\jScriptor\jScriptor\Integration\Adobe Illustrator\jsAIColorProfile.o" ".objs\jScriptor\jScriptor\Integration\Adobe Illustrator\jsAICropMarkStyle.o" ".objs\jScriptor\jScriptor\Integration\Adobe Illustrator\jsAIDictionary.o" ".objs\jScriptor\jScriptor\Integration\Adobe Illustrator\jsAIDocumentColorModelValue.o" ".objs\jScriptor\jScriptor\Integration\Adobe Illustrator\jsAIDocumentFileFormatParameters.o" ".objs\jScriptor\jScriptor\Integration\Adobe Illustrator\jsAIDocumentHandle.o" ".objs\jScriptor\jScriptor\Integration\Adobe Illustrator\jsAIDocumentListSuite.o" ".objs\jScriptor\jScriptor\Integration\Adobe Illustrator\jsAIDocumentMiPrintRecord.o" ".objs\jScriptor\jScriptor\Integration\Adobe Illustrator\jsAIDocumentPlatformPrintRecord.o" ".objs\jScriptor\jScriptor\Integration\Adobe Illustrator\jsAIDocumentRulerUnitValue.o" ".objs\jScriptor\jScriptor\Integration\Adobe Illustrator\jsAIDocumentSetup.o" ".objs\jScriptor\jScriptor\Integration\Adobe Illustrator\jsAIDocumentStartupProfile.o" ".objs\jScriptor\jScriptor\Integration\Adobe Illustrator\jsAIDocumentSuite.o" ".objs\jScriptor\jScriptor\Integration\Adobe Illustrator\jsAIDocumentVersionInfo.o" ".objs\jScriptor\jScriptor\Integration\Adobe Illustrator\jsAIErr.o" ".objs\jScriptor\jScriptor\Integration\Adobe Illustrator\jsAIFileFormatHandle.o" ".objs\jScriptor\jScriptor\Integration\Adobe Illustrator\jsAIFileFormatOptions.o" ".objs\jScriptor\jScriptor\Integration\Adobe Illustrator\jsAIFileFormatSuite.o" ".objs\jScriptor\jScriptor\Integration\Adobe Illustrator\jsAIFilePath.o" ".objs\jScriptor\jScriptor\Integration\Adobe Illustrator\jsAIInt16.o" ".objs\jScriptor\jScriptor\Integration\Adobe Illustrator\jsAIInt32.o" ".objs\jScriptor\jScriptor\Integration\Adobe Illustrator\jsAINewDocumentPreset.o" ".objs\jScriptor\jScriptor\Integration\Adobe Illustrator\jsAIPreviewMode.o" ".objs\jScriptor\jScriptor\Integration\Adobe Illustrator\jsAIRasterResolution.o" ".objs\jScriptor\jScriptor\Integration\Adobe Illustrator\jsAIReal.o" ".objs\jScriptor\jScriptor\Integration\Adobe Illustrator\jsAIRealPoint.o" ".objs\jScriptor\jScriptor\Integration\Adobe Illustrator\jsAIRealRect.o" ".objs\jScriptor\jScriptor\Integration\Adobe Illustrator\jsAIRect.o" ".objs\jScriptor\jScriptor\Integration\Adobe Illustrator\jsAISpotColorMode.o" ".objs\jScriptor\jScriptor\Integration\Adobe Illustrator\jsAITransparencyGrid.o" ".objs\jScriptor\jScriptor\Integration\Adobe Illustrator\jsAIUint32.o" ".objs\jScriptor\jScriptor\Integration\Adobe Illustrator\jsAIUnicodeString.o" ".objs\jScriptor\jScriptor\Integration\Adobe Illustrator\jsAIVersion.o" ".objs\jScriptor\jScriptor\Integration\Adobe Text Engine\jsATEDocumentTextResources.o" ".objs\jScriptor\jScriptor\Integration\Adobe Text Engine\jsATEStory.o" ".objs\jScriptor\jScriptor\Integration\Adobe Text Engine\jsATETextRanges.o" .objs\jScriptor\jScriptor\Integration\jsClass.o .objs\jScriptor\jScriptor\Integration\jsConvert.o .objs\jScriptor\jScriptor\Integration\jsError.o .objs\jScriptor\jScriptor\Integration\jsProperty.o .objs\jScriptor\jScriptor\Integration\jsRTTI.o .objs\jScriptor\jScriptor\Integration\jsSuites.o .objs\jScriptor\jScriptor\Integration\jsTestSuite.o .objs\jScriptor\jScriptor\Integration\Native\jsBool.o .objs\jScriptor\jScriptor\Integration\Native\jsChar.o .objs\jScriptor\jScriptor\Integration\Native\jsCharArray.o .objs\jScriptor\jScriptor\Integration\Native\jsConstCharArray.o .objs\jScriptor\jScriptor\Integration\Native\jsFourCharacterCode.o .objs\jScriptor\jScriptor\Integration\Native\jsShort.o .objs\jScriptor\jScriptor\Integration\Native\jsVoid.o ".objs\jScriptor\jScriptor\Integration\Sweet Pea\jsPIProperty.o" ".objs\jScriptor\jScriptor\Integration\Sweet Pea\jsPIType.o" ".objs\jScriptor\jScriptor\Integration\Sweet Pea\jsSPErr.o" ".objs\jScriptor\jScriptor\Integration\Sweet Pea\jsSPErrorData.o" ".objs\jScriptor\jScriptor\Integration\Sweet Pea\jsSPPlatformFileReference.o" ".objs\jScriptor\jScriptor\Integration\Sweet Pea\jsSPPlugin.o" ".objs\jScriptor\jScriptor\Integration\Sweet Pea\jsSPPluginList.o" ".objs\jScriptor\jScriptor\Integration\Sweet Pea\jsSPPluginListIterator.o" ".objs\jScriptor\jScriptor\Integration\Sweet Pea\jsSPPluginsSuite.o" ".objs\jScriptor\jScriptor\Integration\Sweet Pea\jsSPStringPool.o" ".objs\jScriptor\jScriptor\Integration\Sweet Pea\jsSPStringsSuite.o" .objs\jScriptor\jScriptor\Source\jScriptorFileHelper.o .objs\jScriptor\jScriptor\Source\jScriptorLog.o .objs\jScriptor\jScriptor\Source\jScriptorPanelController.o .objs\jScriptor\jScriptor\Source\jScriptorParameter.o .objs\jScriptor\jScriptor\Source\jScriptorPlugin.o .objs\jScriptor\jScriptor\Source\jScriptorPreferences.o .objs\jScriptor\jScriptor\Source\jScriptorPromptDialog.o .objs\jScriptor\jScriptor\Source\jScriptorSuites.o .objs\jScriptor\jScriptor\Source\jScriptorTokenisor.o .objs\jScriptor\jScriptor\Source\jScriptorUtils.o .objs\jScriptor\jScriptor\Source\jsEngine.o .objs\jScriptor\jScriptor\Source\utils.o  .objs\jScriptor\jScriptor\Resources\Win\jScriptor.res -o jScriptor.dll -m64  -lkernel32 -luser32 -lgdi32 -lwinspool -lcomdlg32 -ladvapi32 -lshell32 -lole32 -loleaut32 -luuid -lodbc32 -lodbccp32 -lmozjs-45
.objs\Adobe\sdk\Adobe Illustrator CC_2015.3 SDK\illustratorapi\illustrator\IAIUnicodeString.o: In function `ai::SPAlloc::AllocateBlock(unsigned long long)':
M:/Creative/Adobe/dev/jScriptor/Adobe/sdk/Adobe Illustrator CC_2015.3 SDK/illustratorapi/illustrator/IAIAutoBuffer.cpp:55: multiple definition of `ai::SPAlloc::AllocateBlock(unsigned long long)'
.objs\Adobe\sdk\Adobe Illustrator CC_2015.3 SDK\illustratorapi\illustrator\IAIAutoBuffer.o:M:/Creative/Adobe/dev/jScriptor/Adobe/sdk/Adobe Illustrator CC_2015.3 SDK/illustratorapi/illustrator/IAIAutoBuffer.cpp:55: first defined here
.objs\Adobe\sdk\Adobe Illustrator CC_2015.3 SDK\illustratorapi\illustrator\IAIUnicodeString.o: In function `ai::SPAlloc::DeleteBlock(void*)':
M:/Creative/Adobe/dev/jScriptor/Adobe/sdk/Adobe Illustrator CC_2015.3 SDK/illustratorapi/illustrator/IAIAutoBuffer.cpp:66: multiple definition of `ai::SPAlloc::DeleteBlock(void*)'
.objs\Adobe\sdk\Adobe Illustrator CC_2015.3 SDK\illustratorapi\illustrator\IAIAutoBuffer.o:M:/Creative/Adobe/dev/jScriptor/Adobe/sdk/Adobe Illustrator CC_2015.3 SDK/illustratorapi/illustrator/IAIAutoBuffer.cpp:66: first defined here
.objs\Adobe\sdk\Adobe Illustrator CC_2015.3 SDK\illustratorapi\illustrator\ASMemory.o:ASMemory.cpp:(.rdata$.refptr.sSPBasic[.refptr.sSPBasic]+0x0): undefined reference to `sSPBasic'
.objs\Adobe\sdk\Adobe Illustrator CC_2015.3 SDK\illustratorapi\illustrator\IAIColorSpace.o:IAIColorSpace.cpp:(.rdata$.refptr.sAIColorSpace[.refptr.sAIColorSpace]+0x0): undefined reference to `sAIColorSpace'
.objs\Adobe\sdk\Adobe Illustrator CC_2015.3 SDK\illustratorapi\illustrator\IAIFilePath.o:IAIFilePath.cpp:(.rdata$.refptr.sAIFilePath[.refptr.sAIFilePath]+0x0): undefined reference to `sAIFilePath'
.objs\Adobe\sdk\Adobe Illustrator CC_2015.3 SDK\illustratorapi\illustrator\IAIRefAutoSuite.o:IAIRefAutoSuite.cpp:(.rdata$.refptr._ZN2ai9AutoSuite5sHeadE[.refptr._ZN2ai9AutoSuite5sHeadE]+0x0): undefined reference to `ai::AutoSuite::sHead'
.objs\Adobe\sdk\Adobe Illustrator CC_2015.3 SDK\illustratorapi\illustrator\IAIRefAutoSuite.o:IAIRefAutoSuite.cpp:(.rdata$.refptr._ZN2ai9AutoSuite8sSPBasicE[.refptr._ZN2ai9AutoSuite8sSPBasicE]+0x0): undefined reference to `ai::AutoSuite::sSPBasic'
.objs\jScriptor\jScriptor\Integration\Sweet Pea\jsSPPluginList.o:jsSPPluginList.cpp:(.rdata$.refptr.sSPPlugins[.refptr.sSPPlugins]+0x0): undefined reference to `sSPPlugins'
.objs\jScriptor\jScriptor\Source\jScriptorFileHelper.o:jScriptorFileHelper.cpp:(.rdata$.refptr.sAIUser[.refptr.sAIUser]+0x0): undefined reference to `sAIUser'
.objs\jScriptor\jScriptor\Source\jScriptorPanelController.o: In function `jScriptorPanelController::jScriptorPanelController()':
Title: Re: Cannot find libs ... but they are there...
Post by: stahta01 on August 20, 2016, 03:27:24 pm
Please read the file comments!!

This file should NOT be included in the core application.

Try removing this file from being built.

Code
/*
 *        Name: IAIAutoBuffer.cpp
 *   $Revision: 1 $
 *      Author:
 *        Date:    
 *     Purpose: Plug-in side implementation of the
 * ai::AutoBuffer object interface.
 * This file should NOT be included in the
 * core application.
 *
 * ADOBE SYSTEMS INCORPORATED
 * Copyright 2004-2007 Adobe Systems Incorporated.
 * All rights reserved.
 *
 * NOTICE:  Adobe permits you to use, modify, and distribute this file
 * in accordance with the terms of the Adobe license agreement
 * accompanying it. If you have received this file from a source other
 * than Adobe, then your use, modification, or distribution of it
 * requires the prior written permission of Adobe.
 *
 */
Title: Re: Cannot find libs ... but they are there...
Post by: stahta01 on August 20, 2016, 03:37:12 pm
I think you need to move your questions to an site that supports your compiler and supports porting this library to your compiler.

This problem likely violates the CB Rules http://forums.codeblocks.org/index.php/topic,9996.0.html (http://forums.codeblocks.org/index.php/topic,9996.0.html)

I would suggest downloading the Mac source code and the Windows source code if you still wish to port this library to Windows GCC; but, I think it will be very hard to do the port!! The Mac source code might be easier to port to Windows GCC.

It might be easier to do a C DLL wrapper using Visual Studio 2015; but, that is also off topic for this site!

Tim S.
Title: Re: Cannot find libs ... but they are there...
Post by: msdobrescu on August 20, 2016, 04:45:31 pm
First, I do not port, I have to use it.
Secondly, it seems I misinterpreted the error.
I took the following as it was somehow compiled twice and I've wondered if C::B generated a malformed build command.

Code
M:/Creative/Adobe/dev/jScriptor/Adobe/sdk/Adobe Illustrator CC_2015.3 SDK/illustratorapi/illustrator/IAIAutoBuffer.cpp:55: multiple definition of `ai::SPAlloc::AllocateBlock(unsigned long long)'
.objs\Adobe\sdk\Adobe Illustrator CC_2015.3 SDK\illustratorapi\illustrator\IAIAutoBuffer.o:M:/Creative/Adobe/dev/jScriptor/Adobe/sdk/Adobe Illustrator CC_2015.3 SDK/illustratorapi/illustrator/IAIAutoBuffer.cpp:55: first defined here

If this is not the case, thing is solved.

+ It's Adobe API poorly documented. That statement is not clear. I've no idea what "core application" means as I build a plugin.
Title: Re: Cannot find libs ... but they are there...
Post by: msdobrescu on August 20, 2016, 06:21:09 pm
One question though.
When I add files to the project, are they automatically set to compile and link?
Especially headers, how are to be set concernng compiling and linking?
Title: Re: Cannot find libs ... but they are there...
Post by: stahta01 on August 20, 2016, 08:13:39 pm
First, I do not port, I have to use it.
Secondly, it seems I misinterpreted the error.
I took the following as it was somehow compiled twice and I've wondered if C::B generated a malformed build command.

Code
M:/Creative/Adobe/dev/jScriptor/Adobe/sdk/Adobe Illustrator CC_2015.3 SDK/illustratorapi/illustrator/IAIAutoBuffer.cpp:55: multiple definition of `ai::SPAlloc::AllocateBlock(unsigned long long)'
.objs\Adobe\sdk\Adobe Illustrator CC_2015.3 SDK\illustratorapi\illustrator\IAIAutoBuffer.o:M:/Creative/Adobe/dev/jScriptor/Adobe/sdk/Adobe Illustrator CC_2015.3 SDK/illustratorapi/illustrator/IAIAutoBuffer.cpp:55: first defined here

If this is not the case, thing is solved.

+ It's Adobe API poorly documented. That statement is not clear. I've no idea what "core application" means as I build a plugin.

If you DO NOT wish to port it to a different compiler; then use a supported Compiler!!!!!!

Quote
***********************************************************
3. Development Environments
***********************************************************
The following platforms are supported for the development of plug-ins:

Mac OS:
  OS:  Mac OS 10.9
  IDE: Xcode 7.2.1
  Compiler for C/C++: com.apple.compilers.llvm.clang.1_0
  Base SDK: OS X 10.11
  OS X Deployment Target: OS X 10.9


Windows:
  OS:  Microsoft Windows 7 (including 32 bit)
  IDE: Microsoft Visual C++ 14 (Visual Studio 2015)

For more details, see the ”Porting Guide."

Title: Re: Cannot find libs ... but they are there...
Post by: stahta01 on August 20, 2016, 08:14:49 pm
One question though.
When I add files to the project, are they automatically set to compile and link?
Especially headers, how are to be set concernng compiling and linking?

Source files default to compiling and linking.
Header files default to NOT compiling and NOT linking.

Tim S.
 
Title: Re: Cannot find libs ... but they are there...
Post by: stahta01 on August 20, 2016, 08:31:29 pm
Please give up on using the GCC compiler!!

If you do NOT want to; then, I suggest you need to ask someone you know and trust to explain why what you are doing is a waste of time.

FYI: Code::Blocks is a IDE that works with more than one compiler.

IF someone told you to use Code::Blocks it does NOT mean you have to use the GCC Compiler!

HINT: You are trying to build a plugin, the plugin ABI must match what the application is expecting!!
That means using the compiler the application tells you to use in nearly all cases where the API is C++.

Tim S.
Title: Re: Cannot find libs ... but they are there...
Post by: stahta01 on August 20, 2016, 09:02:45 pm
I just re-read the thread; if the original bug is in the MS Visual Studio IDE then using the Code::Blocks IDE with the MS Visual Studio Compiler is something to do. But, if the original bug is in MS Visual Studio Compiler then the bug will still exist using the CB IDE.

Tim S.
Title: Re: Cannot find libs ... but they are there...
Post by: msdobrescu on August 21, 2016, 06:55:20 am
OK, you see, I try GCC to see if it compiles. It does. Just linking is the problem now.
All the stuff is compiled by GCC now.
The MSVC++ compiler bug is not yet solved - it is related to some template evaluation I think.
So I can't use it for the moment.
If GCC works, I would use it anyway. It is some kind of experiment.

Now, I have the following linking issue, due to extern "C" variables in a file as defined in the project (worked in msvc++ this way):

Code
.objs\Adobe\sdk\Adobe Illustrator CC_2015.3 SDK\illustratorapi\illustrator\ASMemory.o:ASMemory.cpp:(.rdata$.refptr.sSPBasic[.refptr.sSPBasic]+0x0): undefined reference to `sSPBasic'

The header:

Code
#ifndef __jScriptorSuites_H__
#define __jScriptorSuites_H__

...

// Basic suites acquired by all plug-ins:
extern "C" SPBasicSuite*                    sSPBasic;

...
#endif

It is a header, I think it is the issue, should I set something in the project for it and where?



Title: Re: Cannot find libs ... but they are there...
Post by: msdobrescu on August 21, 2016, 10:24:37 am
I think I have found the issue. It seems that having files on several paths (not all in the same root) made the MSVC++ project import to C::B a bit messed up.
It did not include all the needed cpp files, although no message was given in the process.