Giter VIP home page Giter VIP logo

Comments (14)

sbtron avatar sbtron commented on May 24, 2024 3

cd was just change directory to the root of the repo so that the Cmakelists.txt file is accessible on the path.

You can get CMake from here: https://cmake.org/download/
Make sure CMake is also on the Path then run CMake . in the Collada2glTF directory to build out the solution file - Collada2GLTF.sln.

To open the sln file get Visual Studio Community Edition here: https://www.visualstudio.com/vs/community/

Build the solution file in Visual Studio (CTRL+SHIFT+B). This will give you collada2gltf.exe command line tool in the bin\debug or bin\release subfolder depending on your build configuration (I believe default is debug).

from collada2gltf.

javagl avatar javagl commented on May 24, 2024 2

(cd stands for "change directory", and is what you usually type to change between directories at the Command Prompt...)

BTW: You also need a Visual Studio installed for all this.

Regarding CMake: You can use it from the command line as well. For us windows users, using "cmake-gui" may be more convenient, though:

  • Start "cmake-gui"
  • In the field "Where is the source code", enter the directory where you cloned the repo. For example, C:/COLLADA2GLTF
  • In the field "Where to build the binaries", enter a target directory. I'd recommend to use a different directory than the source directory, to keep the source directory clean. For example, C:/COLLADA2GLTF.build
  • Press "Configure". This will ask for the compiler. Select your visual studio compiler there. It may print some warnings in the output, but you can ignore them for now.
  • Press "Generate". This will create the build files in the output directory that you defined.
  • Open ALL_BUILD.vcxproj with visual studio.
  • Press F7 to compile
  • If there are no errors, then the resulting exe file will be in C:\COLLADA2GLTF.build\bin\Debug\

EDIT: I was too slow here.

from collada2gltf.

lexaknyazev avatar lexaknyazev commented on May 24, 2024 1

Compiling on Windows w/o libpng is simple:

  1. Clone repository
git clone --recursive https://github.com/KhronosGroup/COLLADA2GLTF.git
  1. Create VS solution
cd COLLADA2GLTF
cmake . 
  1. Open COLLADA2GLTF.sln
  2. Build collada2gltf project

from collada2gltf.

javagl avatar javagl commented on May 24, 2024

There's a pending pull request with build instructions for Linux ( #6 ). Further build instructions (for Windows, where the handling of dependencies may be a bit more fiddly) will probably be added soon. Depending on whether you explicitly want to build it on your own or just use a precompiled binary, you might want to have a look at #1 (comment)

from collada2gltf.

dayanc avatar dayanc commented on May 24, 2024

@lexaknyazev Thank you for the tips,
But can you please explain a bit more?
--what does cd stand for? (in cd COLLADA2GLTF)
--cmake?

from collada2gltf.

dayanc avatar dayanc commented on May 24, 2024

@javagl @sbtron Thank you guys; I will try these steps. Hope it works

from collada2gltf.

jaskiratr avatar jaskiratr commented on May 24, 2024

Thank you for sharing the steps.
I ran into following error while building the .sln.

1>collada2gltfConvert.lib(commonProfileShaders.obj) : error LNK2019: unresolved external symbol _png_read_info referenced in function "bool __cdecl GLTF::imageHasAlpha(char const *)" (?imageHasAlpha@GLTF@@YA_NPBD@Z)
1>collada2gltfConvert.lib(commonProfileShaders.obj) : error LNK2019: unresolved external symbol _png_set_tRNS_to_alpha referenced in function "bool __cdecl GLTF::imageHasAlpha(char const *)" (?imageHasAlpha@GLTF@@YA_NPBD@Z)
1>collada2gltfConvert.lib(commonProfileShaders.obj) : error LNK2019: unresolved external symbol _png_set_gray_to_rgb referenced in function "bool __cdecl GLTF::imageHasAlpha(char const *)" (?imageHasAlpha@GLTF@@YA_NPBD@Z)
1>collada2gltfConvert.lib(commonProfileShaders.obj) : error LNK2019: unresolved external symbol _png_set_strip_16 referenced in function "bool __cdecl GLTF::imageHasAlpha(char const *)" (?imageHasAlpha@GLTF@@YA_NPBD@Z)
1>collada2gltfConvert.lib(commonProfileShaders.obj) : error LNK2019: unresolved external symbol _png_read_update_info referenced in function "bool __cdecl GLTF::imageHasAlpha(char const *)" (?imageHasAlpha@GLTF@@YA_NPBD@Z)
1>collada2gltfConvert.lib(commonProfileShaders.obj) : error LNK2019: unresolved external symbol _png_read_image referenced in function "bool __cdecl GLTF::imageHasAlpha(char const *)" (?imageHasAlpha@GLTF@@YA_NPBD@Z)
1>collada2gltfConvert.lib(commonProfileShaders.obj) : error LNK2019: unresolved external symbol _png_destroy_read_struct referenced in function "bool __cdecl GLTF::imageHasAlpha(char const *)" (?imageHasAlpha@GLTF@@YA_NPBD@Z)
1>collada2gltfConvert.lib(commonProfileShaders.obj) : error LNK2019: unresolved external symbol _png_set_read_fn referenced in function "bool __cdecl GLTF::imageHasAlpha(char const *)" (?imageHasAlpha@GLTF@@YA_NPBD@Z)
1>collada2gltfConvert.lib(commonProfileShaders.obj) : error LNK2019: unresolved external symbol _png_get_io_ptr referenced in function "void __cdecl GLTF::userReadData(struct png_struct_def *,unsigned char *,unsigned int)" (?userReadData@GLTF@@YAXPAUpng_struct_def@@PAEI@Z)
1>collada2gltfConvert.lib(commonProfileShaders.obj) : error LNK2019: unresolved external symbol _png_get_valid referenced in function "bool __cdecl GLTF::imageHasAlpha(char const *)" (?imageHasAlpha@GLTF@@YA_NPBD@Z)
1>collada2gltfConvert.lib(commonProfileShaders.obj) : error LNK2019: unresolved external symbol _png_get_rowbytes referenced in function "bool __cdecl GLTF::imageHasAlpha(char const *)" (?imageHasAlpha@GLTF@@YA_NPBD@Z)
1>collada2gltfConvert.lib(commonProfileShaders.obj) : error LNK2019: unresolved external symbol _png_get_image_width referenced in function "bool __cdecl GLTF::imageHasAlpha(char const *)" (?imageHasAlpha@GLTF@@YA_NPBD@Z)
1>collada2gltfConvert.lib(commonProfileShaders.obj) : error LNK2019: unresolved external symbol _png_get_image_height referenced in function "bool __cdecl GLTF::imageHasAlpha(char const *)" (?imageHasAlpha@GLTF@@YA_NPBD@Z)
1>collada2gltfConvert.lib(commonProfileShaders.obj) : error LNK2019: unresolved external symbol _png_get_bit_depth referenced in function "bool __cdecl GLTF::imageHasAlpha(char const *)" (?imageHasAlpha@GLTF@@YA_NPBD@Z)
1>collada2gltfConvert.lib(commonProfileShaders.obj) : error LNK2019: unresolved external symbol _png_get_color_type referenced in function "bool __cdecl GLTF::imageHasAlpha(char const *)" (?imageHasAlpha@GLTF@@YA_NPBD@Z)
1>C:\Users\Jess\Anaconda2\Library\lib\png.lib : warning LNK4272: library machine type 'x64' conflicts with target machine type 'X86'
1>C:\Users\Jess\Anaconda2\Library\lib\z.lib : warning LNK4272: library machine type 'x64' conflicts with target machine type 'X86'
1>D:\COLLADA2GLTF\bin\Debug\collada2gltf.exe : fatal error LNK1120: 19 unresolved externals
========== Build: 0 succeeded, 1 failed, 15 up-to-date, 0 skipped ==========

Following was the output from cmake .

The C compiler identification is MSVC 19.0.24215.1
The CXX compiler identification is MSVC 19.0.24215.1
Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio 14.0/VC/bin/cl.exe
Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio 14.0/VC/bin/cl.exe -- works
Detecting C compiler ABI info
Detecting C compiler ABI info - done
Check for working CXX compiler: C:/Program Files (x86)/Microsoft Visual Studio 14.0/VC/bin/cl.exe
Check for working CXX compiler: C:/Program Files (x86)/Microsoft Visual Studio 14.0/VC/bin/cl.exe -- works
Detecting CXX compiler ABI info
Detecting CXX compiler ABI info - done
Detecting CXX compile features
Detecting CXX compile features - done
Found ZLIB: C:/Users/Jess/Anaconda2/Library/lib/z.lib (found version "1.2.8") 
Found PNG: C:/Users/Jess/Anaconda2/Library/lib/png.lib (found version "1.6.22") 
Could NOT find LibXml2 (missing:  LIBXML2_LIBRARIES LIBXML2_INCLUDE_DIR) 
WARNING: Native LibXml2 not found, taking LibXml from ./Externals
Could NOT find PCRE (missing:  PCRE_INCLUDE_DIR PCRE_PCRE_LIBRARY) 
WARNING: Native PCRE not found, taking PCRE from ./Externals
[o3dgc] 	 LIB_TYPE STATIC
Configuring done

Any suggestions on how to resolve it?

from collada2gltf.

javagl avatar javagl commented on May 24, 2024

I cannot check of verify this right now, but a first guess based on the message: In the toolbar of Visual Studio, there are two dropdown menus: The left one allows selecting "Debug", "Release" etc. The right one by default shows "x86" (or "Win32", this depends on VS version and other things). You may have to select an entry that indicates 64 bits, usually called "x86_64" or "x64"

(If there is no such entry, you will have to create one - a quick websearch brings up http://www.viva64.com/en/l/0004/ which shows the basic steps, if necessary)

from collada2gltf.

jaskiratr avatar jaskiratr commented on May 24, 2024

@javagl Thank you for the suggestion. I tried the x64 config. Probably that wasn't the issue.

1>------ Build started: Project: UTF_static, Configuration: Debug x64 ------
2>------ Build started: Project: pcre_static, Configuration: Debug x64 ------
3>------ Build started: Project: MathMLSolver_static, Configuration: Debug x64 ------
4>------ Build started: Project: xml_static, Configuration: Debug x64 ------
5>------ Build started: Project: ftoa_static, Configuration: Debug x64 ------
6>------ Build started: Project: o3dgc_common_lib, Configuration: Debug x64 ------
7>------ Build started: Project: o3dgc_dec_lib, Configuration: Debug x64 ------
8>------ Build started: Project: o3dgc_enc_lib, Configuration: Debug x64 ------
2>x64\Debug\pcre_chartables.obj : fatal error LNK1112: module machine type 'x64' conflicts with target machine type 'X86'
1>x64\Debug\ConvertUTF.obj : fatal error LNK1112: module machine type 'x64' conflicts with target machine type 'X86'
8>x64\Debug\o3dgcDynamicVectorEncoder.obj : fatal error LNK1112: module machine type 'x64' conflicts with target machine type 'X86'
3>x64\Debug\MathMLEvaluatorVisitor.obj : fatal error LNK1112: module machine type 'x64' conflicts with target machine type 'X86'
4>x64\Debug\c14n.obj : fatal error LNK1112: module machine type 'x64' conflicts with target machine type 'X86'
6>x64\Debug\o3dgcArithmeticCodec.obj : fatal error LNK1112: module machine type 'x64' conflicts with target machine type 'X86'
7>x64\Debug\o3dgcDynamicVectorDecoder.obj : fatal error LNK1112: module machine type 'x64' conflicts with target machine type 'X86'
9>------ Build started: Project: OpenCOLLADABaseUtils_static, Configuration: Debug x64 ------
10>------ Build started: Project: test_o3dgc, Configuration: Debug x64 ------
5>x64\Debug\Commondtoa.obj : fatal error LNK1112: module machine type 'x64' conflicts with target machine type 'X86'
11>------ Build started: Project: buffer_static, Configuration: Debug x64 ------
10>x64\Debug\main.obj : fatal error LNK1112: module machine type 'x64' conflicts with target machine type 'X86'
9>x64\Debug\COLLADABUUtils.obj : fatal error LNK1112: module machine type 'x64' conflicts with target machine type 'X86'
12>------ Build started: Project: GeneratedSaxParser_static, Configuration: Debug x64 ------
13>------ Build started: Project: OpenCOLLADAFramework_static, Configuration: Debug x64 ------
11>x64\Debug\CommonBuffer.obj : fatal error LNK1112: module machine type 'x64' conflicts with target machine type 'X86'
14>------ Build started: Project: OpenCOLLADAStreamWriter_static, Configuration: Debug x64 ------
13>x64\Debug\COLLADAFWLight.obj : fatal error LNK1112: module machine type 'x64' conflicts with target machine type 'X86'
12>x64\Debug\GeneratedSaxParserCoutErrorHandler.obj : fatal error LNK1112: module machine type 'x64' conflicts with target machine type 'X86'
15>------ Build started: Project: OpenCOLLADASaxFrameworkLoader_static, Configuration: Debug x64 ------
14>x64\Debug\COLLADASWTechniqueFX.obj : fatal error LNK1112: module machine type 'x64' conflicts with target machine type 'X86'
15>x64\Debug\COLLADASaxFWLLibraryArticulatedSystemsLoader.obj : fatal error LNK1112: module machine type 'x64' conflicts with target machine type 'X86'
16>------ Build started: Project: collada2gltfConvert, Configuration: Debug x64 ------
17>------ Build started: Project: OpenCOLLADAValidator, Configuration: Debug x64 ------
16>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\Microsoft.CppBuild.targets(392,5): warning MSB8028: The intermediate directory (x64\Debug\) contains files shared from another project (collada2gltf.vcxproj).  This can lead to incorrect clean and rebuild behavior.
17>x64\Debug\main.obj : fatal error LNK1112: module machine type 'x64' conflicts with target machine type 'X86'
16>x64\Debug\COLLADA2GLTFWriter.obj : fatal error LNK1112: module machine type 'x64' conflicts with target machine type 'X86'
18>------ Build started: Project: collada2gltf, Configuration: Debug x64 ------
18>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\Microsoft.CppBuild.targets(392,5): warning MSB8028: The intermediate directory (x64\Debug\) contains files shared from another project (collada2gltfConvert.vcxproj).  This can lead to incorrect clean and rebuild behavior.
18>x64\Debug\main.obj : fatal error LNK1112: module machine type 'x64' conflicts with target machine type 'X86'
========== Build: 0 succeeded, 18 failed, 2 up-to-date, 0 skipped ==========

I'm assuming the original error on Win32 config exists due to unlinked libraries. Still looking into it.
Stack Overflow: lnk2019-unresolved-external-symbol-error-in-visual-studio-c

from collada2gltf.

javagl avatar javagl commented on May 24, 2024

Yes, exactly: My guess was that the "unresolved external symbol: png...." messages had been caused by the fact that it could not link the PNG library due to the wrong architecture type, which it said as the last message. And the messages "module machine type 'x64' conflicts with target machine type 'X86'" still indicate that there is something wrong with this setting. But you most likely already found the related stackoverflow posts (http://stackoverflow.com/questions/3563756/fatal-error-lnk1112-module-machine-type-x64-conflicts-with-target-machine-typ , which says indicates that you might have to manually select "Properties > Configuration Properties > Linker > Advanced > Target Machine: MachineX64", or http://stackoverflow.com/questions/25936688/lnk1112-module-machine-type-x64-conflicts-with-target-machine-type-x86 ...). But actually, the files as generated by CMake should be "clean" in that sense, and it should not be necessary to manually fiddle around with these settings. Since I can't reproduce the error at the moment, I can't give further or more focussed hints right now (sorry).

from collada2gltf.

jaskiratr avatar jaskiratr commented on May 24, 2024

The unofficial build provided here #1 worked.
I ended up using ubuntu bash now available in windows 10.

@javagl Thank you again for your input.

from collada2gltf.

DragonEmperorG avatar DragonEmperorG commented on May 24, 2024

C:\Users\123\Documents\GitHub\COLLADA2GLTF.build\bin\Debug>collada2gltf -f D:\CyberCity3D_Sample_Collada\Miami_Sample.dae
converting:D:\CyberCity3D_Sample_Collada\Miami_Sample.dae ... as \CyberCity3D_Sample_Collada\Miami_Sample.gltf
WARNING: unsupported opaque mode:RGB_ZERO fallback to A_ONE
cannot create file :\CyberCity3D_Sample_Collada\Miami_Sample.bin
After releasing the project, I got the exe. But I encountered this problem?

from collada2gltf.

javagl avatar javagl commented on May 24, 2024

Just the quick link for the main developers:

this->_asset->log("WARNING: unsupported opaque mode:%s fallback to A_ONE\n", opaqueModeToString(opaqueMode).c_str());

Transparency and opacity in COLLADA is .... sometimes not entirely straightforward, and there are some related issues already.

Do you have the option to change the transparency/opaqueness mode in the COLLADA input file?

A_ZERO and A_ONE should conceptually be supported. (Whether they are properly translated into glTF is a different story, though....)

from collada2gltf.

lasalvavida avatar lasalvavida commented on May 24, 2024

Closing as this seems to have been resolved, feel free to reopen if you have any other issues.

from collada2gltf.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.